cis-ssm-apply-validate

Publishes, pins, and applies AWS SSM remediation documents to one instance with evidence capture and rollback.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/amitkarpe/agent-skills --skill cis-ssm-apply-validate-amitkarpe
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cis-ssm-apply-validate
Source: https://github.com/amitkarpe/agent-skills/tree/main/skills/cis-ssm-apply-validate
Command: npx skills add https://github.com/amitkarpe/agent-skills --skill cis-ssm-apply-validate-amitkarpe

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires aws-cli, jq, and includes scripts (resource) components.

What problem does it solve? Applying CIS or remediation SSM documents to AWS instances is risky without validation, version pinning, and durable evidence. This Skill provides a controlled workflow that validates inputs and target reachability before mutation, pins document versions, applies to a single instance first, and captures rollback-ready evidence for every run. ## Core Features & Use Cases - Pre-mutation validation: Checks the SSM document file, parameter JSON structure, instance state, and SSM agent online status before any change. - Safe publish and apply: Creates or updates the SSM document, skips no-op uploads via content hashing, pins the default version, and sends the command to one instance with polling and timeout handling. - Durable evidence and rollback: Saves logs, command output, document metadata, and pre-mutation state per run, and automatically reverts the default document version when the command fails. - Use Case: A security engineer updates a CIS hardening SSM document, validates it against one test instance, applies it, and keeps a full evidence trail with automatic rollback if the command fails. ## Quick Start Ask the agent to validate and apply your SSM remediation document to one instance by providing the document file, parameters JSON file, target instance ID, and a unique output directory.

Frequently Asked Questions about cis-ssm-apply-validate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely apply an SSM document to an EC2 instance?▼

Run validate.sh first with the document file, parameters JSON, and instance ID to confirm the instance is running and the SSM agent is online. Then run apply.sh, which publishes or updates the document, pins the default version, sends the command, and waits for completion.

How do I validate SSM document parameters before sending a command?▼

Use validate.sh with --document-file and --parameters-file. It checks that the parameters file is valid JSON, is an object, and that every value is a string or an array of strings, which is the structure SSM send-command expects.

What happens if the SSM command fails after applying a document?▼

If the command status is not Success or the response code is non-zero, apply.sh automatically rolls back by reverting the document's default version to the previous one captured before mutation. The failure details are saved in stdout.txt and stderr.txt in the output directory.

Does this workflow support dry-run validation without applying changes?▼

Yes, apply.sh supports a --dry-run flag that runs validation only and skips the apply step. You can also use --skip-upload to apply the existing default document version without uploading new content.

What are the limitations of this SSM apply workflow?▼

It targets a single instance per run by design, so wider rollouts require separate orchestration. It also requires the AWS CLI and jq installed, valid AWS credentials, and an instance with the SSM agent online.