Przejdź do treści
Biblioteka skilli
Bezpieczeństwo · Przegląd i audyt

cloud-native-security-defensive

/cloud-native-security-defensive

Utwardza konta AWS, Azure i GCP zabezpieczeniami prewencyjnymi, telemetrią wykrywania i minimalnymi uprawnieniami IAM.

Repozytorium
agent-skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
10.11.2026

Ocena i bezpieczeństwo

95/ 100Klasa: dobry
Format20 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 10.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Utwardza konta AWS, Azure i GCP zabezpieczeniami prewencyjnymi, telemetrią wykrywania i minimalnymi uprawnieniami IAM.

Wyzwalacze z opisu

harden aws accountdetect cloud intrusioncloudtrail detectionservice control policyscp guardrailssecure azure tenantcloud postureguardduty
Oryginalny opis (EN)

Use this skill when the user says 'harden aws account', 'detect cloud intrusion', 'cloudtrail detection', 'service control policy', 'scp guardrails', 'secure azure tenant', 'cloud posture', 'guardduty', 'imdsv2 enforcement', 'least privilege iam'. Hardens AWS/Azure/GCP organizations with preventive guardrails, detective telemetry, and least-privilege IAM, and writes concrete detections and policy code. Do NOT use for: attack-path explanation (cloud-native-security-offensive), CSPM product selection (security-cspm), secret storage design (vault).

Jak działa

  1. Purpose
  2. Agent Protocol
  3. Control Layers
  4. Preventive Guardrails (AWS SCP)
  5. Detective Controls — High-Signal Events
  6. Least Privilege Workflow
  7. Anti-Patterns
  8. Checklist
  9. References
Sekcje z nagłówków SKILL.md, w oryginale · 135 linii, 861 słów
Podgląd SKILL.md
---
name: cloud-native-security-defensive
description: >
  Use this skill when the user says 'harden aws account', 'detect cloud intrusion', 'cloudtrail detection', 'service control policy', 'scp guardrails', 'secure azure tenant', 'cloud posture', 'guardduty', 'imdsv2 enforcement', 'least privilege iam'. Hardens AWS/Azure/GCP organizations with preventive guardrails, detective telemetry, and least-privilege IAM, and writes concrete detections and policy code. Do NOT use for: attack-path explanation (cloud-native-security-offensive), CSPM product selection (security-cspm), secret storage design (vault).
version: "2.0.0"
author: "j4flmao"
license: "MIT"
tags: [cloud-native, security, aws, azure, gcp, iam, scp, cloudtrail, detection]
---

# Cloud Security — Defensive Engineering

## Purpose
Turn a cloud estate into one where dangerous actions are prevented by organization-level guardrails, everything else is logged centrally and immutably, and anomalous identity activity is detected quickly. Identity is the perimeter in cloud, so most controls are IAM controls.

## Agent Protocol

### Trigger
"harden aws account", "detect cloud intrusion", "cloudtrail", "SCP", "guardrails", "secure azure tenant", "cloud posture", "guardduty", "IMDSv2", "least privilege".

### Input Context
- Cloud(s) and org structure (AWS Organizations OUs, Azure management groups, GCP folders).
- Existing logging destinations (SIEM, log archive account).
- Compliance targets (CIS Benchmarks, SOC 2, ISO 27001).

### Output Artifact
Policy-as-code (SCP/Azure Policy/Org Policy JSON or Terraform) and detection queries. No file unless requested.

### Response Format
```
Layer: {preventive|detective|responsive}
Control: {name}
Scope: {org/OU/account/subscription/project}
Code: {policy or query}
Break-glass impact: {who is exempt and how}
```

### Completion Criteria
- [ ] Preventive guardrails applied at org/OU level with a documented break-glass exemption.
- [ ] Org-wide audit logging to a separate, write-protected account/project.
- [ ] Detections mapped to concrete log events.

## Control Layers

| Layer | AWS | Azure | GCP |
|---|---|---|---|
| Org guardrails | Service Control Policies, Resource Control Policies, declarative policies | Azure Policy (deny), management-group RBAC | Organization Policy constraints |
| Audit log | CloudTrail organization trail (+ data events where needed) | Activity Log + Microsoft Entra sign-in/audit logs via diagnostic settings | Cloud Audit Logs (Admin Activity always on; Data Access opt-in) |
| Threat detection | GuardDuty, Security Hub | Microsoft Defender for Cloud, Sentinel | Security Command Center |
| Unused access | IAM Access Analyzer (unused access findings) | Entra access reviews | IAM Recommender |

## Preventive Guardrails (AWS SCP)
SCPs do not grant permissions; they cap what principals in member accounts can do. They never affect the management account.

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ProtectAuditTrail",
      "Effect": "Deny",
      "Action": ["cloudtrail:StopLogging", "cloudtrail:DeleteTrail", "cloudtrail:UpdateTrail",
                 "guardduty:DeleteDetector", "guardduty:DisassociateFromMasterAccount",
                 "config:StopConfigurationRecorder", "config:DeleteConfigurationRecorder"],
      "Resource": "*",
      "Condition": { "ArnNotLike": { "aws:PrincipalArn": "arn:aws:iam::*:role/BreakGlassAdmin" } }
    },
    {
      "Sid": "RegionAllowList",
      "Effect": "Deny",
      "NotAction": ["iam:*", "organizations:*", "sts:*", "support:*", "cloudfront:*", "route53:*"],
      "Resource": "*",
      "Condition": { "StringNotEquals": { "aws:RequestedRegion": ["eu-west-1", "eu-central-1"] } }
    },
    {
      "Sid": "RequireIMDSv2",
      "Effect": "Deny",
      "Action": "ec2:RunInstances",
      "Resource": "arn:aws:ec2:*:*:instance/*",
      "Condition": { "StringNotEquals": { "ec2:MetadataHttpTokens": "required" } }
    }
  ]
}
```
Global services (IAM, Organizations, STS global endpoint, CloudFront, Route 53) must be excluded from region deny lists or they break.

Also enable at account level: S3 Block Public Access (account-wide), EBS encryption by default, and the EC2 account default `HttpTokens=required` for new instances.

## Detective Controls — High-Signal Events
| Signal | Log event | Why |
|---|---|---|
| Root user activity | CloudTrail `userIdentity.type = "Root"` | Root should be unused after setup |
| Console login without MFA | `ConsoleLogin` with `additionalEventData.MFAUsed = "No"` | Credential theft |
| Logging tampering | `StopLogging`, `DeleteTrail`, `PutEventSelectors` | Defense evasion |
| Persistence via IAM | `CreateAccessKey`, `CreateLoginProfile`, `AttachUserPolicy`, `PutRolePolicy`, `UpdateAssumeRolePolicy` | Backdoor creation |
| Enumeration burst | Many `List*`/`Describe*`/`Get*` from one principal in minutes, especially `AccessDenied` | Recon tooling (e.g. Pacu, ScoutSuite run by an attacker) |
| Credential exfil | GuardDuty `UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS` | Stolen instance role creds used elsewhere |

Example (CloudTrail Lake / Athena SQL):
```sql
SELECT eventTime, userIdentity.arn, sourceIPAddress, eventName
FROM cloudtrail_logs
WHERE eventName IN ('CreateAccessKey','CreateLoginProfile','AttachUserPolicy','PutUserPolicy')
  AND eventTime > now() - interval '1' day
ORDER BY eventTime DESC;
```

## Least Privilege Workflow
1. Start from AWS managed job-function policies only for humans; workloads get custom policies.
2. Generate a policy from CloudTrail activity (IAM Access Analyzer policy generation) after a soak period.
3. Remove unused roles, keys, and permissions using Access Analyzer unused-access findings.
4. Replace IAM users + access keys with SSO (IAM Identity Center) for humans and roles/OIDC federation for CI.
5. Add permission boundaries for delegated role creation.

## Anti-Patterns
- `"Action": "*"` / `"Resource": "*"` on workload roles.
- Logs stored in the same account an attacker can administer.
- Long-lived access keys in CI systems (use GitHub/GitLab OIDC → `AssumeRoleWithWebIdentity`).
- Alerting on everything from CSPM with no owner routing → alert fatigue, real findings ignored.
- SCP deny without a break-glass path → locked out during an incident.

## Checklist
- [ ] Org trail + log archive account with S3 Object Lock or bucket policy denying deletes.
- [ ] SCPs: protect logging/security services, region allow-list, IMDSv2, deny leaving org.
- [ ] GuardDuty/Defender/SCC enabled org-wide with delegated admin.
- [ ] Detections above routed to on-call with runbooks.
- [ ] CIS Benchmark scan scheduled; drift in IaC detected (`terraform plan` in CI).

## References
- Related skills: `skills/cloud-native/cloud-security-offensive/SKILL.md`, `skills/devops/vault/SKILL.md`, `skills/devops/policy-as-code/SKILL.md`.

### Shared References
Additional reference material for this skill, stored outside its own `references/` folder.

- `../../security/cspm/references/automated-remediation.md` — Automated Remediation for CSPM
- `../../security/cspm/references/ciem-permissions.md` — CIEM — Cloud Infrastructure Entitlement Management
- `../../security/cspm/references/compliance-frameworks.md` — Compliance Frameworks for CSPM
- `../../security/cspm/references/cspm-advanced.md` — CSPM Advanced Topics
- `../../security/cspm/references/cspm-drift-detection.md` — CSPM: Cloud Configuration Drift Detection & Remediation Engine
- `../../security/cspm/references/cspm-fundamentals.md` — CSPM Fundamentals
- `../../security/cspm/references/cspm-integration.md` — CSPM Integration
- `../../security/cspm/references/cspm-platforms.md` — CSPM Platforms
- `../../security/cspm/references/cspm-scanning-architecture.md` — CSPM: Scanning Architecture & Multi-Account Strategy

Wersje

W bazie nie ma innych skilli o nazwie cloud-native-security-defensive.

Migawka bazy z 13.11.2026 · wersja paczki 387d5c2805e3 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100aws-security-guardduty-securityhub-iam-guardrails
    Monitoruje zagrożenia w AWS i zbiera wyniki przez GuardDuty oraz Security Hub, z zabezpieczeniami IAM.
  • 100cloud-security
    Ocenia bezpieczeństwo chmury w AWS, Azure i GCP: najmniejsze uprawnienia IAM, publiczną ekspozycję, szyfrowanie, pokrycie logowaniem i zabezpieczenia landing zone.
  • 90cloud-security-engineer
    Wdraża i audytuje kontrole bezpieczeństwa w chmurze: polityki organizacji, IAM, szyfrowanie, logowanie do SIEM i naprawy.
  • 100hardening-cloud-posture
    Wzmacnia konto lub organizację w chmurze przed incydentem: priorytet dla ryzyk IAM, zamykanie publicznych zasobów, zbyt szerokich ról i braków logowania audytowego, krytyczna lektura raportów CSPM oraz guardrails na poziomie organizacji.
  • 90cloud-posture-review
    Przegląda stan bezpieczeństwa konta chmurowego w IAM, sieci, danych i logowaniu, mapując wyniki na benchmarki CIS.
  • 100conducting-cloud-incident-response
    Reaguje na incydenty bezpieczeństwa w AWS, Azure i GCP: izoluje skompromitowane tożsamości, analizuje logi chmurowe i zabezpiecza dowody.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.