Chuyển đến nội dung
Skillpedia
Cơ sở dữ liệu35k · #8305

performing-service-account-credential-rotation

Skill này làm gì

Công cụ này tự động thay đổi định kỳ mật khẩu và khóa truy cập của các tài khoản dùng cho chương trình (tài khoản dịch vụ). Điều này giúp ngăn thông tin đăng nhập cũ bị kẻ tấn công lợi dụng.

Khi nào nên dùng

  • ✓Khi thay đổi mật khẩu tài khoản dịch vụ.
  • ✓Khi thiết lập tự động thay đổi mật khẩu.
  • ✓Khi xác minh độ an toàn của tài khoản dịch vụ.

Liên kết skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-service-account-credential-rotation/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-service-account-credential-rotation/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Thay đổi thông tin đăng nhập tài khoản dịch vụ cho cơ sở dữ liệu và ứng dụng web của chúng tôi.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ kết nối với các hệ thống như Active Directory, nền tảng cloud (AWS, Azure, GCP) và cơ sở dữ liệu. Nó tạo thông tin đăng nhập mới, cập nhật ở nơi đang sử dụng và xác minh mọi thứ vẫn hoạt động.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Performing Service Account Credential Rotation

Overview

Service accounts are non-human identities used by applications, daemons, CI/CD pipelines, and automated processes to authenticate to systems and APIs. These accounts often have elevated privileges and their credentials (passwords, API keys, certificates, tokens) are frequently long-lived and shared across teams, making them prime targets for attackers. Credential rotation is the systematic process of replacing these secrets on a scheduled basis, propagating new credentials to all dependent systems, and verifying service continuity after rotation.

When to Use

  • When conducting security assessments that involve performing service account credential rotation
  • When following incident response procedures for related security events
  • When performing scheduled security testing or auditing activities
  • When validating security controls through hands-on testing

Prerequisites

  • Inventory of all service accounts across AD, cloud, and applications
  • Secrets management platform (HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, or CyberArk)
  • Service dependency mapping (which services use which credentials)
  • Change management process for rotation windows
  • Monitoring for service health post-rotation

Core Concepts

Service Account Types

Type Platform Credential Rotation Method
Active Directory Service Account Windows/AD Password gMSA (automatic) or PAM-managed
AWS IAM User AWS Access Key/Secret Key AWS Secrets Manager rotation Lambda
GCP Service Account GCP JSON key file Key rotation via IAM API
Azure Service Principal Azure Client secret/certificate Key Vault + rotation policy
Database Service Account SQL/Oracle/Postgres Password Vault dynamic secrets
API Key SaaS applications API token Application-specific API

Group Managed Service Accounts (gMSA)

Windows gMSAs provide automatic password management by Active Directory:

  • AD automatically rotates the password every 30 days
  • Password is 240 bytes, cryptographically random
  • Multiple servers can use the same gMSA simultaneously
  • No administrator knows or manages the password
  • Eliminates manual rotation for Windows services

Rotation Architecture

Secrets Manager / Vault
        │
        ├── Rotation Trigger (schedule or on-demand)
        │
        ├── Generate new credential
        │
        ├── Update credential at source (AD, cloud IAM, database)
        │
        ├── Update credential in all consumers:
        │   ├── Application configuration
        │   ├── CI/CD pipeline secrets
        │   ├── Kubernetes secrets
        │   └── Other dependent services
        │
        ├── Verify service health
        │   ├── Health check endpoints
        │   ├── Authentication test
        │   └── Functional smoke test
        │
        └── Revoke old credential (after grace period)

Workflow

Step 1: Discover and Inventory Service Accounts

Enumerate all service accounts and their dependencies:

# Active Directory: Find all service accounts
Get-ADServiceAccount -Filter * -Properties *
Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName,PasswordLastSet,LastLogonDate

# Find accounts with passwords older than 90 days
$threshold = (Get-Date).AddDays(-90)
Get-ADUser -Filter {PasswordLastSet -lt $threshold -and Enabled -eq $true} -Properties PasswordLastSet,ServicePrincipalName |
    Where-Object {$_.ServicePrincipalName} |
    Select-Object Name, PasswordLastSet, ServicePrincipalName

Step 2: Implement gMSA for Windows Services

# Create KDS Root Key (one-time, domain-wide)
Add-KdsRootKey -EffectiveImmediately

# Create the gMSA account
New-ADServiceAccount -Name "svc-webapp-gmsa" `
    -DNSHostName "svc-webapp-gmsa.corp.example.com" `
    -PrincipalsAllowedToRetrieveManagedPassword "WebServerGroup" `
    -KerberosEncryptionType AES128,AES256

# Install on target server
Install-ADServiceAccount -Identity "svc-webapp-gmsa"

# Test the account
Test-ADServiceAccount -Identity "svc-webapp-gmsa"

# Configure IIS Application Pool to use gMSA
# Set identity to: CORP\svc-webapp-gmsa$

Step 3: AWS Access Key Rotation with Secrets Manager

import boto3
import json

def rotate_iam_access_key(secret_arn, iam_username):

…
Câu hỏi thường gặp

Tài khoản dịch vụ là gì?

Đây là tài khoản mà chương trình và hệ thống dùng để giao tiếp với nhau, mà không cần con người nhập mật khẩu.

Vì sao cần thay đổi thông tin đăng nhập?

Mật khẩu và khóa cũ có thể bị hacker phát hiện. Thay đổi định kỳ giúp giảm nguy cơ bị tấn công.

Cần gì để dùng công cụ này?

Bạn cần danh sách mọi tài khoản dịch vụ, một nơi lưu trữ an toàn cho thông tin đăng nhập (như kho bảo mật số), và biết chương trình nào dùng thông tin đăng nhập nào.

Chi tiết

Mô tả gốc của tác giả

Automates credential rotation for service accounts across Active Directory, cloud platforms, and application databases to eliminate stale secrets and reduce compromise risk. Use when rotating or automating rotation of service account passwords, API keys, or secrets stored in a vault.

repo: mukul975/Anthropic-Cybersecurity-Skills

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#8305
Giấy phép
Apache-2.0
Cập nhật
31/8/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự