Chuyển đến nội dung
Skillpedia
Bảo mật35k · #8365

securing-aws-iam-permissions

Skill này làm gì

Công cụ này giúp làm cho quyền truy cập trên đám mây AWS của bạn an toàn hơn. Nó kiểm tra và điều chỉnh xem ai có thể truy cập gì, đảm bảo mỗi người hoặc dịch vụ chỉ có đúng quyền cần thiết để làm việc.

Khi nào nên dùng

  • ✓Khi bạn thiết lập tài khoản hoặc dịch vụ AWS mới.
  • ✓Khi bạn nghi ngờ quyền truy cập hiện tại quá rộng.
  • ✓Khi bạn chuẩn bị một đợt kiểm toán bảo mật và muốn chứng minh quyền truy cập đã được hạn chế.

Liên kết skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/securing-aws-iam-permissions/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/securing-aws-iam-permissions/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

“Điều chỉnh quyền AWS của tôi để chỉ cho phép những gì cần thiết.”

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

Cách hoạt động

Công cụ phân tích quyền hiện tại của bạn, tìm ra quyền truy cập không cần thiết hoặc quá mức, rồi đề xuất hoặc áp dụng các chính sách hạn chế hơn. Nó cũng giúp thiết lập các cơ chế bảo mật bổ sung như permission boundary và xác thực đa yếu tố.

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.

Securing AWS IAM Permissions

When to Use

  • When onboarding new AWS accounts or workloads that require scoped IAM policies
  • When IAM Access Analyzer reports overly permissive policies or unused permissions
  • When preparing for a compliance audit requiring least privilege evidence (SOC 2, PCI-DSS)
  • When migrating from long-lived access keys to short-lived role-based credentials
  • When remediating findings from AWS Security Hub related to IAM misconfigurations

Do not use for Azure AD or Google Cloud IAM configurations, application-level authorization logic, or federated identity provider setup (see managing-cloud-identity-with-okta).

Prerequisites

  • AWS account with administrative access or IAM:FullAccess permissions
  • AWS CLI v2 installed and configured with named profiles
  • AWS CloudTrail enabled for at least 90 days of API activity history
  • Familiarity with JSON-based IAM policy syntax and ARN resource notation

Workflow

Step 1: Inventory Existing IAM Entities and Policies

Generate a comprehensive inventory of all IAM users, roles, groups, and attached policies using the AWS CLI and IAM credential reports. Identify accounts with console access, programmatic access keys, and their last-used timestamps.

# Generate IAM credential report
aws iam generate-credential-report
aws iam get-credential-report --query 'Content' --output text | base64 -d > iam-report.csv

# List all IAM roles and their attached policies
aws iam list-roles --query 'Roles[*].[RoleName,Arn,CreateDate]' --output table

# Find users with access keys older than 90 days
aws iam list-users --query 'Users[*].UserName' --output text | while read user; do
  aws iam list-access-keys --user-name "$user" \
    --query "AccessKeyMetadata[?CreateDate<='$(date -d '-90 days' +%Y-%m-%d)'].[UserName,AccessKeyId,Status,CreateDate]" \
    --output table
done

Step 2: Enable and Analyze IAM Access Analyzer Findings

Activate IAM Access Analyzer at the organization or account level to identify resources shared externally and generate least-privilege policy recommendations based on CloudTrail activity.

# Create an Access Analyzer for the account
aws accessanalyzer create-analyzer \
  --analyzer-name account-analyzer \
  --type ACCOUNT

# List active findings for external access
aws accessanalyzer list-findings \
  --analyzer-arn arn:aws:access-analyzer:us-east-1:123456789012:analyzer/account-analyzer \
  --filter '{"status": {"eq": ["ACTIVE"]}}'

# Generate a policy based on CloudTrail activity for a specific role
aws accessanalyzer start-policy-generation \
  --policy-generation-details '{
    "principalArn": "arn:aws:iam::123456789012:role/AppRole",
    "cloudTrailDetails": {
      "trailArn": "arn:aws:cloudtrail:us-east-1:123456789012:trail/management-trail",
      "startTime": "2025-01-01T00:00:00Z",
      "endTime": "2025-03-01T00:00:00Z"
    }
  }'

Step 3: Scope Policies to Specific Resources and Conditions

Replace wildcard resource ARNs with specific resource identifiers. Add IAM policy conditions for MFA enforcement, source IP restrictions, and time-based access windows.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowS3ReadSpecificBucket",
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:ListBucket"
      ],
      "Resource": [
        "arn:aws:s3:::production-data-bucket",
        "arn:aws:s3:::production-data-bucket/*"
      ],
      "Condition": {
        "Bool": {"aws:MultiFactorAuthPresent": "true"},
        "IpAddress": {"aws:SourceIp": "10.0.0.0/8"},
        "DateGreaterThan": {"aws:CurrentTime": "2025-01-01T00:00:00Z"}
      }
    }
  ]
}

Step 4: Implement Permission Boundaries

Attach permission boundaries to IAM roles and users to define the maximum scope of permissions an entity can receive, preventing privilege escalation even if an administrator attaches an overly permissive policy.

# Create a permission boundary policy
aws iam create-policy \
  --policy-name DeveloperPermissionBoundary \
  --policy-document file://developer-boundary.json

# Attach the boundary to an IAM role
aws iam put-role-permissions-boundary \
  --role-name DeveloperRole \
  --permissions-boundary "arn:aws:iam::123456789012:policy/DeveloperPermissionBoundary"
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowCommonServices",
      "Effect": "Allow",
      "Action": [
        "s3:*",

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

“Principle of least privilege” là gì?

Đây là nguyên tắc chỉ cấp cho người hoặc dịch vụ quyền tối thiểu cần để thực hiện nhiệm vụ, không hơn. Điều này làm giảm rủi ro nếu tài khoản bị xâm nhập.

“Permission boundary” là gì?

Đây là các quy tắc xác định phạm vi quyền tối đa mà người dùng hoặc dịch vụ có thể có. Ngay cả khi một chính sách khác cấp thêm quyền, giới hạn tối đa vẫn được tôn trọng.

Tôi có cần biết lập trình để dùng không?

Không cần kiến thức lập trình. Công cụ được thiết kế để giúp quản lý quyền một cách an toàn, ngay cả khi bạn không có chuyên môn lập trình sâu.

Chi tiết

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

Hardens AWS IAM configurations to enforce least-privilege access, covering IAM policy scoping, permission boundaries, IAM Access Analyzer integration, and credential rotation strategies. Use when reducing the blast radius of compromised AWS identities, auditing overly permissive IAM policies, or setting up permission boundaries and Access Analyzer findings review across cloud accounts. '

repo: mukul975/Anthropic-Cybersecurity-Skills

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#8365
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ự