amitkarpe/agent-skills/cis-inspector-scan
Claude Code and agent skill by amitkarpe/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Run an AWS Inspector CIS scan on a single EC2 instance, enforce readiness rules, fetch results, and save durable evidence with recovery-aware bash helpers.
Install
npx vskill@latest install amitkarpe/agent-skills/cis-inspector-scanSKILL.md
The same SKILL.md was published earlier as amitkarpe/agent-skills/cis-inspector-scan.
CIS Inspector Scan
Run an AWS Inspector CIS scan on a single EC2 instance, enforce readiness rules, fetch results, and save durable evidence.
When to use this skill
- Run an Inspector CIS scan on an EC2 instance
- Recover a previous scan by config ARN
- Validate Inspector CIS readiness before scanning
- Fetch and archive failed CIS controls
Readiness rules (enforced by scripts)
A result is only valid when:
status = COMPLETEDtotalChecks > 0
If either condition fails, the scripts exit non-zero. Partial evidence (scan.json) is saved to help with troubleshooting, but aggregated-checks.json and failed-controls.json are not created.
Quick start
Prerequisites: The target instance must have a tag instance_id=<instance-id>. Add it if missing:
Single-command pipeline (recommended)
Exits 0 only on valid result. Auto-recovers once on timeout.
Cleanup before scan (if stale configs exist)
Manual step-by-step workflow
To recover an existing scan config instead of creating a new one:
Script flags
| Flag | Scripts | Required | |
|---|---|---|---|
--profile | preflight, create, fetch | yes | |
--region | preflight, create, fetch | yes | |
--instance-id | preflight, create | yes (create: only if not recovering) | |
--output-dir | all | yes | |
--scan-config-arn | create (recovery), fetch | conditional | |
--scan-name | create | yes (new scan) | |
--security-level | create | no (default: LEVEL_2) |
Note: inspector_cis_reduce_failed_controls.sh only requires --output-dir.
Evidence saved
| File | Description | |
|---|---|---|
preflight.json | Preflight check results | |
scan-config.json | Raw scan configuration from Inspector | |
scan.json | Raw scan row (status, counts, ARNs) | |
aggregated-targets.json | Raw target aggregation for invalid scans when the diagnostic query succeeds | |
target-status.json | Concise status and reason for each target, or a diagnostic error when the query fails | |
aggregated-checks.json | Full aggregated check results | |
failed-controls.json | Reduced: only checks with failed count > 0 |
Known failure modes
| Symptom | Likely cause | Resolution | |
|---|---|---|---|
totalChecks = 0 | Metadata tags disabled, wrong accountIds, IAM gap, endpoint/DNS issue | Check preflight items in order | |
Failed to get instance tags from instance metadata | InstanceMetadataTags not enabled | Enable via modify-instance-metadata-options | |
ConflictException | Stale scan config from cancelled run | Auto-cleaned by create script (v2) | |
status = FAILED | SSM agent unhealthy, IAM missing AmazonInspector2ManagedCisPolicy | Fix IAM/SSM, retry | |
| Infinite polling loop | (Fixed in v2) | Fetch script now uses list-all + Python filter |
Note: The create script automatically detects and deletes stale scan configs targeting the same instance before creating a new one. This prevents ConflictException from cancelled runs. The fetch script uses list-cis-scans (all) with Python filtering instead of --filter-criteria to avoid bash quoting issues.
IAM requirements
Instance profile must include:
AmazonSSMManagedInstanceCoreAmazonInspector2ManagedCisPolicy
References
references/inspector-workflow.md— step-by-step workflow and polling rulesreferences/source-artifacts.md— proven scan examples and check counts
Cleanup
After a scan completes, the scan config remains in Inspector. To avoid config sprawl:
One-time scan configs can be deleted immediately after fetching results.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cis-inspector-scan/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/amitkarpe/agent-skills/cis-inspector-scan)