datadog/test-attack-technique
Tests and validates Stratus Red Team attack techniques by executing warmup, detonation, and cleanup phases with comprehensive validation. Validates cloud credentials, parses command output, checks expected outcomes, and generates HTML reports. Use when testing attack techniques, validating TTPs, verifying technique behavior, or when user mentions stratus, warmup, detonate, or technique IDs like aws.*, azure.*, gcp.*, k8s.*, or entra-id.*. Supports AWS, Azure, GCP, Kubernetes, and Entra ID.
npx skills add https://github.com/DataDog/stratus-red-team --skill test-attack-technique
When this skill is invoked, follow this workflow:
--skip-cleanup flagv2/ directory first: cd v2go run cmd/stratus/*.go show <technique-id> silently to verify the technique existsgo run cmd/stratus/*.go listBased on the technique platform, validate current credentials and get explicit user confirmation.
See references/credentials.md for detailed validation commands per cloud provider.
Quick reference:
aws sts get-caller-identity - show Account, UserId, Arnaz account show - show name, id, user, tenantId. CRITICAL: Export AZURE_SUBSCRIPTION_ID and ARM_SUBSCRIPTION_ID environment variables before running stratus commandsgcloud config get-value project && gcloud auth list - show project and active accountkubectl config current-context && kubectl config view --minify - show cluster and namespaceaz ad signed-in-user show - show userPrincipalName and idPresent credentials to user and ask for explicit confirmation:
Current credentials for <platform>:
<formatted credential info>
These credentials will be used to:
1. Create infrastructure (warmup)
2. Execute the attack technique (detonate)
3. Clean up resources (cleanup)
Do you want to proceed with these credentials?
Use AskUserQuestion to get confirmation. If user declines, stop and provide instructions for changing credentials.
Based on the technique documentation, source code analysis, and your understanding of the attack:
Read the technique details:
go run cmd/stratus/*.go show <technique-id> provides the descriptionDraft a high-level plan including:
Present the plan to the user:
FIRST, output the complete plan as regular text (not in a tool call):
═══════════════════════════════════════════════════════════════
Test Execution Plan for <technique-name>
═══════════════════════════════════════════════════════════════
WARMUP PHASE - Expected Infrastructure:
• <list of expected resources>
DETONATION PHASE - Expected Attack Behavior:
• <list of expected actions and outcomes>
VALIDATION - What I'll Check:
• After warmup: <validation checks>
• After detonation: <validation checks>
═══════════════════════════════════════════════════════════════
THEN, after displaying the plan, use AskUserQuestion to get user validation:
If the user wants to modify, discuss changes and update the plan before proceeding.
Use TodoWrite to track progress through phases.
Copy this checklist and track your progress:
Test Execution Progress:
- [ ] Step 1: Validate technique exists
- [ ] Step 2: Validate and confirm credentials
- [ ] Step 3: Draft and approve execution plan
- [ ] Step 4: Export AZURE_SUBSCRIPTION_ID and ARM_SUBSCRIPTION_ID (Azure only)
- [ ] Step 5: Run warmup and parse output
- [ ] Step 6: Run detonation and parse output
- [ ] Step 7: Validate assumptions against results
- [ ] Step 8: Run cleanup (unless --skip-cleanup)
- [ ] Step 9: Generate HTML report
For Azure techniques, first export the subscription IDs:
export AZURE_SUBSCRIPTION_ID=$(az account show --query id -o tsv)
export ARM_SUBSCRIPTION_ID=$AZURE_SUBSCRIPTION_ID
Then run warmup from the v2/ directory:
cd v2 && go run cmd/stratus/*.go warmup <technique-id>
Parse the output to extract:
Store for validation. Output is unstructured - intelligently parse based on technique type (e.g., look for "Created S3 bucket stratus-red-team-xxx" patterns).
cd v2 && go run cmd/stratus/*.go detonate <technique-id>
Parse the output to extract:
Compare expected vs. actual outcomes:
Example validation approaches:
*aws.credential-access.secretsmanager-retrieve-secrets:*
aws secretsmanager list-secrets or aws secretsmanager get-secret-value --secret-id <name>*aws.impact.s3-ransomware-individual-deletion:*
aws s3 ls and aws s3 ls s3://<bucket-name>/aws s3 ls s3://<bucket-name>/Store results (including CLI commands and outputs) for report.
cd v2 && go run cmd/stratus/*.go cleanup <technique-id>
Cleanup runs unless --skip-cleanup is set. Verify success and note any failures in report.
Generate a comprehensive HTML report saved to the scratchpad directory with filename:
test-report-<technique-id>-<timestamp>.html
Use the template file: Read assets/report-template.html and replace placeholders with actual values:
Placeholders to replace:
{{TECHNIQUE_ID}}, {{TECHNIQUE_NAME}}, {{PLATFORM}}, {{TACTIC}}, {{TIMESTAMP}}, {{CREDENTIAL_INFO}}{{EXPECTED_WARMUP_RESOURCES}}, {{EXPECTED_DETONATION_BEHAVIORS}}, {{PLANNED_CHECKS}}{{WARMUP_STATUS}}, {{WARMUP_STATUS_CLASS}} (success/failure), {{WARMUP_RESOURCES}}, {{WARMUP_OUTPUT}}{{DETONATION_STATUS}}, {{DETONATION_STATUS_CLASS}}, {{DETONATION_BEHAVIORS}}, {{DETONATION_OUTPUT}}{{VALIDATION_CHECKS}} - Generate HTML for each check including CLI commands and outputs: <div class="check pass">
<strong>Check:</strong> Storage account exists
<br><strong>Expected:</strong> stratus-rg-xxxxx created
<br><strong>Actual:</strong> stratus-rg-xxxxx found in output
<div class="check-command">$ aws s3 ls</div>
<div class="check-output">2024-01-15 10:30:45 stratus-red-team-bucket-abc123</div>
<strong>Status:</strong> Pass
</div>
Include CLI commands and outputs when validation involved running commands.
{{CLEANUP_STATUS}}, {{CLEANUP_STATUS_CLASS}}, {{CLEANUP_OUTPUT}}{{OVERALL_RESULT}}, {{CHECKS_PASSED}}, {{TOTAL_CHECKS}}, {{ISSUES}}, {{RECOMMENDATIONS}}After generation: show file path, display summary, suggest opening in browser.
v2/ directoryTake datadog/test-attack-technique from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.