Community程式設計與開發github.com

cloud-security-baseline

Assess a cloud organisation's security baseline read-only against CIS benchmarks — guardrails, root protection, federation, audit logging, threat detection, encryption — with gaps fixed as code. Use for new, inherited, or audited accounts.

cloud-security-baseline 是什麼?

cloud-security-baseline is a Claude Code agent skill that assess a cloud organisation's security baseline read-only against CIS benchmarks — guardrails, root protection, federation, audit logging, threat detection, encryption — with gaps fixed as code. Use for new, inherited, or audited accounts.

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ifundeasy/claude-crew/tree/HEAD/skills/cloud-security-baseline

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Cloud security baseline

Rules

  • Read-only: list, describe, and get calls under the view-only identity the orchestrator provides. Enabling a trail, recorder, detector, analyzer, or posture service is a change; draft it, never do it.
  • Reference set, in order: the organisation's own standard; the CIS Foundations Benchmark for the provider; the provider's reference architecture. Verify versions live and record them. On 2026-11-28 cisecurity.org listed AWS Foundations 7.1.0, Google Cloud Platform Foundation 5.0.1, and Microsoft Azure Foundations 7.0.0; the references are the AWS Security Reference Architecture (AWS SRA), the Google Cloud enterprise foundations blueprint, and the Microsoft cloud security benchmark (v2, in preview, supersedes v1; learn.microsoft.com, page dated 2026-01-15). Never mix versions within one assessment.
  • A control counts only where evidence shows it enforced at a scope that reaches the target. Service and resource control policies do not affect the AWS management account (docs.aws.amazon.com, Organizations "Policy types", accessed 2026-11-28).
  • Cover every account, subscription, and project and every enabled region, opt-in regions included. Access denied is Not assessed, never Pass.
  • Fixes are additive. Never draft a change that disables, narrows, shortens, or bypasses a guardrail, audit log, or detective control; replacing one is the control owner's decision, with the replacement live first.
  • Fixes never create IAM users, service-account keys, access keys, or client secrets; they use federation and short-lived roles.
  • Root, super administrator, and emergency access accounts are assessed from configuration and logs only; agents never use or request them.
  • Detection and posture services are charged; list each proposed enablement with its pricing page for the budget owner, and never invent prices. Recurring posture scans run through security-scanning-pipeline.
  • Severity: severity-scale.md.

Controls

AreaRequirementAWSGoogle CloudAzure
HierarchyWorkloads split by environment; dedicated security tooling and log archive containers; no workloads in the root or management containerOrganizations OUs; AWS SRA accounts: Org Management, Security Tooling, Log Archive, Network, Shared Services, ApplicationOrganisation, folders per environment, central logging and security projects (enterprise foundations blueprint)Management groups, platform subscriptions for logging and security, landing-zone subscriptions per workload
GuardrailsDeny at the top: stopping or changing audit logging and detection, leaving the organisation, unapproved regions, public sharing; tested before enforcedSCPs (principals), RCPs (resources), declarative policies such as EC2 and S3 policiesOrganisation policy constraints; organisations created on or after 2024-05-03 enforce seven by default, including iam.managed.disableServiceAccountKeyCreation, iam.allowedPolicyMemberDomains, and storage.uniformBucketLevelAccessAzure Policy deny and deployIfNotExists assignments at management groups
Root and break-glassRoot credentials removed or locked away with phishing-resistant MFA, no access keys; at least two emergency accounts; every use alertedCentralised root access for member accounts with root credentials removed; management-account root with MFA, no access keysSuper administrator accounts separate from daily accounts, security keys, not in the Organization Administrator group; alert on SetIamPolicyAt least two cloud-only emergency access accounts with passkey (FIDO2) or certificate-based authentication, excluded from blocking Conditional Access, sign-in alerts, validated at least every 90 days
FederationHumans and workloads use short-lived credentials from an identity provider; no long-lived keys where federation exists (iam-policy-review, secrets-management)IAM Identity Center; roles for workloads; OIDC or IAM Roles Anywhere outside AWSCloud Identity or Workforce Identity Federation; workload identity federation; no user-managed service-account keysEntra ID with Privileged Identity Management; managed identities; workload identity federation
Audit loggingControl-plane audit logs on in every account, region, and project, delivered to the log archive (logging-architecture)Multi-Region organisation trail with log file validationAdmin Activity and System Event always written; organisation-level aggregated sink; Data Access logs where requiredSubscription diagnostic settings for the Activity log; Entra sign-in and audit logs exported
Threat detectionManaged threat detection on in every account and region, administered centrallyGuardDuty with organisation auto-enable from the Security Tooling accountSecurity Command Center; Event Threat Detection needs Premium; Standard is free of chargeMicrosoft Defender for Cloud plans per subscription
Configuration recordingResource configuration and posture recorded in every regionAWS Config recorders and an aggregator; AWS Security Hub CSPM (the posture service formerly named Security Hub)Cloud Asset Inventory; Security Health AnalyticsResource Graph; Azure Policy compliance; Defender for Cloud recommendations
Default encryptionEncryption at rest by default; customer-managed keys where requirements say (key-management)EBS encryption by default per Region; S3 default encryption, SSE-KMS for sensitive and log bucketsGoogle-managed by default; gcp.restrictNonCmekServices, gcp.restrictCmekCryptoKeyProjectsPlatform-managed by default; customer-managed keys in Key Vault by Policy
Public-access blocksPublic data sharing and public addresses blocked by default; exceptions named (network-exposure-review)S3 Block Public Access at account and organisation level (S3 policy, 2025-11-26); image and snapshot public-access blocks; VPC Block Public Accessstorage.publicAccessPrevention, compute.managed.vmExternalIpAccess, sql.restrictPublicIp, compute.skipDefaultNetworkCreationStorage allowBlobPublicAccess false; publicNetworkAccess disabled by Policy
Security contactsA monitored team mailbox receives provider security notices for every containerAlternate contact of type SECURITY per accountEssential Contacts, Security category, at the organisationDefender for Cloud security contacts
Baseline as codeAll of the above defined in a foundation root with its own state and drift checks (infrastructure-as-code)Organization, Config, GuardDuty modulesOrganisation policy, sink, SCC modulesPolicy, diagnostic setting, Defender modules

Sources, accessed 2026-11-28: docs.aws.amazon.com (AWS SRA "Architecture"; IAM "AWS account root user" and "Security best practices in IAM"; Organizations "Policy types"; VPC "Block public access"; Security Hub CSPM user guide), aws.amazon.com What's New 2025-11-26 (S3 Block Public Access organisation-level enforcement), docs.cloud.google.com ("Secure by default organizations", "Super admin best practices", Security Command Center "Service tiers", organisation policy constraints), learn.microsoft.com ("Manage emergency access admin accounts", Activity log).

Read-only evidence

AreaAWSGoogle CloudAzure
Hierarchyaws organizations list-accounts, list-organizational-units-for-parentgcloud resource-manager folders list, gcloud projects listaz account management-group list, az account list
Guardrailsaws organizations list-policies --filter SERVICE_CONTROL_POLICY (and RESOURCE_CONTROL_POLICY), describe-policy, list-targets-for-policy, describe-effective-policygcloud org-policies list --organization=<id>, gcloud org-policies describe <constraint> --effective --project=<id>az policy assignment list --scope <scope>, az policy state summarize
Rootaws iam list-organizations-features; aws iam get-account-summary (AccountMFAEnabled, AccountAccessKeysPresent)Admin console role assignments (read); gcloud organizations get-iam-policy <id>Microsoft Graph reads of role assignments and Conditional Access policies
Federationaws iam list-users, list-access-keys (metadata only)gcloud iam service-accounts keys list --iam-account=<sa> --managed-by=userApplication credential metadata (key ID, type, end date); project out hint fields
Logging, detection, recordingaws cloudtrail describe-trails, get-trail-status; aws guardduty list-detectors per Region; aws configservice describe-configuration-recorder-statusgcloud logging sinks list --organization=<id>; audit configs in get-iam-policyaz monitor diagnostic-settings subscription list; az security pricing list
Encryption, public accessaws ec2 get-ebs-encryption-by-default; aws s3control get-public-access-block --account-id <id>; aws ec2 describe-vpc-block-public-access-optionsgcloud org-policies describe per constraintaz storage account list --query with allowBlobPublicAccess and publicNetworkAccess
Contactsaws account get-alternate-contact --alternate-contact-type SECURITYgcloud essential-contacts list --organization=<id>az security contact list

Contact calls return names, addresses, and phone numbers: record only whether a contact is set and whether it is a role mailbox.

Procedure

  1. Scope. Provider, organisation, every account, subscription, and project, enabled regions, identity name confirmed read-only from its policies, reference set and versions verified live, UTC start time.
  2. Hierarchy. Map containers to purpose and environment from the account map; name the management, security tooling, and log archive containers.
  3. Guardrails. Read each policy at each level; work out what reaches each container, and what does not (management account, exempted OUs, policies in audit or dry-run mode).
  4. Walk the controls per container and region: Pass (enforcement point and scope cited), Gap, Not applicable (reason), Not assessed (missing access or evidence).
  5. Score every gap on the scale; asserted controls count as absent.
  6. Fix. Draft each fix as additive baseline code with infrastructure-as-code: stage new guardrails on a test OU or folder, in dry-run or audit mode where the platform has one, before enforcing; review IAM in the fix with iam-policy-review.
  7. Hand over the saved plan and its SHA-256 for an independent change-security-review through the orchestrator; never review your own draft.
  8. Track gaps with owner and due date; residual risks go to risk-assessment with acceptor and expiry; choices between approaches go to decision-record.

Output

Scope line: provider, organisation, containers and regions covered, identity (name only), collection start and end (local and UTC, operating-principles §9), reference set with versions, gaps in coverage.

#AreaControlContainer and regionStatusEvidence (call or path:line, time (local, UTC))Severity (R, I)OwnerFix (code path or diff)Due

Then: a coverage matrix (containers by areas: Pass, Gap, Not applicable, Not assessed), drafts handed over with plan SHA-256, and decisions with options and one Recommendation.

Quality checklist

  • Every container and enabled region is assessed or listed as Not assessed with its cause.
  • The reference set and versions are named, verified live, and dated.
  • Every Pass cites its enforcement point and the scope it reaches.
  • Every gap has a severity from the scale, an owner, a code fix, and a rollback.
  • No fix weakens logging, guardrails, or detection, creates a user or long-lived key, or relies on root.
  • Contacts are recorded as roles or shared mailboxes, never as personal details.

Pitfalls

  • Counting a service control policy as protecting the management account, or an OU policy as covering an account moved out of that OU.
  • Checking only the home region: detectors, recorders, and EBS defaults are regional, and an opt-in region enabled later starts uncovered.
  • Enforcing a new deny across the organisation without a test OU or dry run, breaking pipelines and inviting a rollback that weakens the baseline.

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

相關技能