Remediating AWS Security Hub Findings with Kiro Skills
Import a skill, answer a few questions, and let Kiro walk you through every Security Hub finding — fetch, fix, verify.
You open AWS Security Hub and see failed findings across multiple accounts. CRITICAL security groups with every port open to the internet. SSM document sharing settings left wide open. You know what needs to happen — but the path from "finding" to "fixed" is a slog: click into each finding, read the remediation docs, figure out the right CLI command, check if the resource is even in use, switch to the right account, run it, come back, check the next one.
What if Kiro could do that loop for you?
That's what the Security Hub Remediation skill does. It's a Kiro skill — a portable instruction package that teaches Kiro how to fetch your Security Hub findings, prioritize them, generate remediation plans with exact CLI commands, execute fixes on your confirmation, and track everything locally so you know what's done even before Security Hub re-evaluates (which can take 12–24 hours). The full skill file is included at the end of this article — you can copy it directly into your project.
What You'll Need
- Kiro IDE installed
- AWS CLI v2 configured with access to your Security Hub account
- AWS Security Hub enabled in your account(s)
- Python 3
- IAM permissions:
securityhub:GetFindings,securityhub:DescribeHub,securityhub:GetEnabledStandardson your audit/primary account, plus remediation permissions on target accounts
Step 1: Create the Skill
In your Kiro IDE project:
- Create a folder:
.kiro/skills/security-hub-remediation/
- Create a file inside it:
SKILL.md
- Copy the full skill content from the Appendix: SKILL.md at the end of this article
That's it — the skill is ready to use. It's just structured instructions that Kiro follows.
Step 2: Start the Skill
Type
/security-hub-remediation in the Kiro chat. Kiro asks a few setup questions, one at a time:Question | What It Means |
|---|---|
Audit or single account? | Audit = aggregated findings across multiple accounts. Single = fetch and fix in one account. |
Account ID and CLI profile | Kiro lists your profiles, verifies the selected one, and checks that Security Hub is enabled. |
Compliance framework | Kiro auto-detects which standards are enabled (FSBP, CIS, NIST, PCI DSS, etc.) — no guessing. Pick one or all. |
Confirm each or plan only? | Confirm each (default) = Kiro waits for your OK before each fix. Plan only = plans without executing. |
Here's what setup looks like:
You: /security-hub-remediation
Kiro: Are you running from an Audit (aggregated findings) account or a single workload account?
You: Audit
Kiro: I found these CLI profiles on your system: - default - acme-admin - acme-prod - audit What is the CLI profile name for this audit account?
You: audit
Kiro: ✓ Account confirmed: 111111111111 using profile audit ✓ Security Hub is enabled
Standards enabled in your account: - AWS Foundational Security Best Practices (68% score) - CIS AWS Foundations Benchmark v1.2.0 (26% score) - NIST 800-53 Rev 5 (92% score) Filter by a specific one, or fetch across all?
You: All
Kiro: How should I handle remediations? - Confirm each (default) - Plan only
You: Plan only
Kiro: Creating steering file and tracker... Fetching CRITICAL compliance findings...
After setup, Kiro creates a steering file (
.kiro/steering/security-hub-remediation.md ) with your account IDs, profile mappings, and preferences — this loads automatically in every conversation so you don't repeat setup. It also creates remediation-tracker.json to track finding status across sessions.You don't need to pre-configure profiles for every target account. Kiro discovers target accounts from the findings and sets up profiles on demand — SSO first, then cross-account role assumption, then static credentials as a last resort. Every new profile is verified before use.
Step 3: Fetch and Review Findings
Kiro generates a fetch script on the fly, handles full pagination, and pulls CRITICAL compliance findings. In Audit mode, it discovers target accounts automatically.
Kiro: Fetching CRITICAL findings (compliance, profile: audit)... Page 1: 11 findings (total so far: 11) Total: 11 CRITICAL findings
| Account | Findings | |--------------|----------| | 222222222222 | 9 | | 111111111111 | 2 |
| Control | Description | Count | |---------|------------------------------------------------|-------| | SSM.7 | SSM documents should have block public sharing | 6 | | EC2.19 | Security groups — unrestricted high-risk ports | 5 |
You already have a profile for account 222222222222: acme-admin Which control would you like to start with?
We'll walk through SSM.7 in this guide.
The skill starts with CRITICAL and works down through HIGH → MEDIUM → LOW progressively. Once all findings at one severity are addressed, Kiro asks if you want to move to the next.
Why Compliance Findings First?
Security Hub aggregates findings from multiple sources. The skill defaults to compliance findings because they're directly fixable via CLI. Other types are available on request:
Type | Source | What Kiro Can Do |
|---|---|---|
Compliance | Security Hub | Directly remediate — fix misconfigurations via CLI |
Access | IAM Access Analyzer | Directly remediate — tighten IAM policies via CLI |
Vulnerability | Inspector | Help triage — group hundreds of CVEs by the one image or package that needs updating |
Threat | GuardDuty | Help investigate — show threat details and recommended response actions |
Sensitive Data | Macie | Partially remediate — adjust bucket policies; data classification needs human review |
Step 4: The Remediation Loop
For each finding, Kiro runs pre-remediation checks (is the resource in use? is it service-managed?), researches the control, generates a plan, and executes on your confirmation.
SSM.7 — Batched Across Regions
Kiro recognized all 6 SSM.7 findings were the same control across different account/region combinations and batched them into one plan:
Remediation Plan: SSM.7 — Block public sharing for SSM documents
Account: 222222222222 — 4 regionsAccount: 111111111111 — 2 regions
Commands (6 total):aws ssm update-service-setting \ --setting-id /ssm/documents/console/public-sharing-permission \ --setting-value Disable \ --region us-west-2 --profile acme-admin# ...repeated for each account/region
We started in plan-only mode, then switched to executing:
You: I would like to execute the commands and solve those findings
Kiro: [runs all 6 commands, each succeeds] All 6 SSM.7 findings are now fixed_locally. Move to the next control?
Six commands, 42 seconds, done. Kiro batches similar findings into one plan — you can approve them all at once or step through each individually.
Step 5: Verify and Resume
Security Hub can take 12–24 hours to re-evaluate findings. When you come back and ask Kiro to check status:
✅ Verified (4): SSM.7 in us-west-2, us-east-1, us-west-1, us-east-2⏳ Pending verification (2): SSM.7 in remaining regions — re-evaluation in progress
The tracker persists across sessions. When you invoke the skill again, Kiro reads the stored profile mappings (no re-scanning), shows session stats, and asks whether to continue, re-fetch, or verify.
Security Rules
The skill enforces these guardrails:
- Never stores credentials or adds wildcard IAM permissions
- Shows exact commands before execution; destructive operations always require confirmation
- Runs dry-run checks where supported to catch permission errors early
- Checks resource usage before planning — unused resources get a "just delete it" recommendation
- Detects service-managed resources and recommends upstream fixes instead of direct modification
- Suppression requires justification recorded in both Security Hub and the local tracker
Key Takeaways
- Add the skill, start remediating — no scripts to install, no infrastructure to deploy. The skill is a single
SKILL.mdthat teaches Kiro your remediation workflow.
- The skill adapts to you — Audit or single account, one standard or five, confirm each fix or plan only. Kiro asks, you answer, it builds the workflow around your environment.
- Auto-detection over manual input — Kiro discovers target accounts from findings, detects enabled standards, finds existing CLI profiles, and checks resource usage before suggesting fixes.
- Batching saves time — same control across 6 regions becomes one plan. Approve all at once or step through each.
- Human-in-the-loop where it matters — Kiro handles the research and CLI commands. You make the decisions on what to fix, skip, or suppress.
Security Hub remediation doesn't have to mean clicking through findings one by one. Add the skill, answer a few questions, and start fixing.
This skill is a starting point — customize the security rules, remediation patterns, and tracker schema for your team.
Appendix: SKILL.md
Create this file at
.kiro/skills/security-hub-remediation/SKILL.md in your project:---name: security-hub-remediationdescription: Fetch AWS Security Hub findings, summarize by account and severity, then remediate findings one at a time with implementation plans, execution, and local state tracking. Use when triaging security findings, remediating Security Hub controls, or checking remediation status across single or multi-account environments.---
## Initial Setup — Gather Environment Details
Before fetching any findings, ask the user the following questions one at a time. Wait for each answer before proceeding.
1. **Mode**: Are you running from an Audit (aggregated findings) account or a single workload account?2. **Current account**: Run `aws configure list-profiles` to discover available CLI profiles. Present the list, then ask: "What is the AWS account ID and CLI profile name for this account? Here are the profiles I found on your system:" followed by the profile list. After the user selects a profile, verify it and check Security Hub is enabled: ```bash aws sts get-caller-identity --profile <PROFILE_NAME> --region <REGION> aws securityhub describe-hub --profile <PROFILE_NAME> --region <REGION> ``` If `describe-hub` fails with `InvalidAccessException`, Security Hub is not enabled. Inform the user: "Security Hub is not enabled in this account/region. Would you like me to help you enable it?" If yes, guide them through enabling it. If no, stop.3. **Compliance framework**: Check which standards are enabled in the user's account: ```bash aws securityhub get-enabled-standards --profile <PROFILE_NAME> --region <REGION> --query 'StandardsSubscriptions[?StandardsStatus==`READY`].StandardsArn' --output json ``` Parse the ARNs to extract human-readable names and present only the enabled ones. Common mappings: - `aws-foundational-security-best-practices` → AWS Foundational Security Best Practices (FSBP) - `cis-aws-foundations-benchmark` → CIS AWS Foundations Benchmark (include version from ARN) - `nist-800-53` → NIST 800-53 - `nist-800-171` → NIST 800-171 - `pci-dss` → PCI DSS (include version from ARN) - `aws-resource-tagging-standard` → AWS Resource Tagging Standard
Present the list, then ask: "These are the standards currently enabled in your account. Filter by a specific one, or fetch findings across all of them?"
If no standards are enabled, inform the user and suggest enabling at least AWS Foundational Security Best Practices.4. **Execution mode** (default: Confirm each): - **Confirm each** — I generate a plan and wait for your approval before running each fix - **Plan only** — I generate plans but don't execute anything (you run the commands yourself)
After collecting answers, immediately fetch **CRITICAL compliance** findings using the provided profile (see Phase 1). These are infrastructure misconfigurations that can typically be resolved with CLI commands.
In Audit mode, do NOT ask the user to list target accounts — discover them automatically from the findings by extracting unique `AwsAccountId` values.
### Post-Setup
1. Generate a steering file at `.kiro/steering/security-hub-remediation.md` with account IDs, profiles, preferences, and mode. Use `inclusion: always` frontmatter. Include a **target account profile map** section that records discovered account-to-profile mappings (e.g., `222222222222 → acme-admin`). Update this map whenever a new profile is created or discovered during remediation. On resume, Kiro reads this map instead of re-scanning all profiles.2. Create `remediation-tracker.json` if it doesn't already exist3. Proceed to Phase 1
### Progressive Severity Processing
Always process findings in severity order: CRITICAL → HIGH → MEDIUM → LOW. Start by fetching only CRITICAL findings. Once all CRITICAL findings are addressed (or the user explicitly asks to move on), ask: *"All CRITICAL findings are addressed. Move to HIGH severity?"* Repeat for each subsequent severity level.
### Setting Up CLI Profiles for Target Accounts
When the user selects a finding to remediate, check if a CLI profile exists for that finding's target account. If not, guide the user through creating one using this priority order:
#### Option 1: IAM Identity Center (SSO) — Preferred
Check for existing SSO config:```bashgrep -i sso_start_url ~/.aws/config```
**If SSO is already configured**: Reuse the same `sso_start_url` and `sso_region`. Ask only for the `sso_role_name` for the new account. Generate:```[profile <ACCOUNT_NAME>]sso_start_url = <EXISTING_SSO_START_URL>sso_region = <EXISTING_SSO_REGION>sso_account_id = <ACCOUNT_ID>sso_role_name = <SSO_ROLE_NAME>region = <REGION>```
**If SSO is not configured**: Ask if the org uses IAM Identity Center. If yes, collect SSO start URL, region, and role name. After adding the profile, run `aws sso login --profile <ACCOUNT_NAME>` and wait for browser auth to complete.
#### Option 2: Cross-Account IAM Role Assumption — Fallback
Ask for the role name (default suggestion: `OrganizationAccountAccessRole`). Generate:```[profile <ACCOUNT_NAME>]role_arn = arn:aws:iam::<ACCOUNT_ID>:role/<ROLE_NAME>source_profile = <AUDIT_PROFILE_NAME>region = <REGION>```
#### Option 3: Static Credentials — Last Resort
Warn that static credentials aren't recommended. If confirmed, guide through `aws configure --profile <ACCOUNT_NAME>`.
#### After Profile Creation
1. Ask whether to append to `~/.aws/config` or show the block to add manually2. Verify with `aws sts get-caller-identity --profile <ACCOUNT_NAME>`3. If verification fails, troubleshoot: - **SSO**: Run `aws sso login --profile <ACCOUNT_NAME>` and retry - **Role assumption**: Check trust policy allows the Audit account (`arn:aws:iam::<AUDIT_ACCOUNT_ID>:root`) - **Static credentials**: Verify the access key is active4. Update the target account profile map in `.kiro/steering/security-hub-remediation.md` with the new mapping
## Environment Configuration
<!-- Kiro fills this into the steering file after setup: Mode, Primary Account, Target Accounts (discovered from findings), Severity (progressive), Framework, Execution Mode -->
## Phase 1 — Fetch & Summarize Findings
### Fetching Findings
Use the AWS CLI to fetch findings with full pagination. Generate a self-contained Python script on the fly and execute it as a single command. This is important for user experience — running one script that handles all pagination internally means the user only approves one command, not dozens of individual API calls. Write the script to a temporary file (e.g., `fetch_findings.py`), run it, then clean up. The script must:
1. **Build the filter** based on user preferences: ```json { "ComplianceStatus": [{"Value": "FAILED", "Comparison": "EQUALS"}], "RecordState": [{"Value": "ACTIVE", "Comparison": "EQUALS"}], "WorkflowStatus": [ {"Value": "NEW", "Comparison": "EQUALS"}, {"Value": "NOTIFIED", "Comparison": "EQUALS"} ], "SeverityLabel": [{"Value": "<CURRENT_SEVERITY>", "Comparison": "EQUALS"}] } ``` - For compliance findings, add `ComplianceStatus` filter and optionally filter by `ProductName` = `Security Hub` - For vulnerability findings, filter by `ProductName` = `Inspector` - For other types, filter by the appropriate `ProductName` (see Other Finding Types table) - For framework filtering, add `GeneratorId` with `PREFIX` comparison using the standard's ARN prefix - Only add `ComplianceStatus` filter for compliance-type findings
2. **Paginate fully**: Use `--max-items 100` and follow `NextToken` with `--starting-token` until all findings are fetched. Print progress: "Page N: X findings (total so far: Y)"
3. **Save two output files**: - `findings-raw.json` — the complete list of findings (as a JSON array) - `findings-summary.md` — grouped summary (see Summarizing below)
4. **Handle errors**: If the AWS CLI call fails, print the error and exit. If zero findings are returned, write an empty summary noting no findings were found at this severity.
When moving to the next severity level, re-run with the next severity value (CRITICAL → HIGH → MEDIUM → LOW).
### Summarizing
Generate `findings-summary.md` with this structure:
1. **Overview**: Total count, severity level, date fetched, accounts discovered2. **By Finding Type** (if fetching all types): Count per type (Compliance, Vulnerability, Threat, etc.)3. **By Account**: Table of account IDs with finding counts4. **By Control/CVE per type**: For compliance → group by control ID (e.g., S3.5, EC2.19). For vulnerability → group by image/repo/package. For others → group by title.5. **All Findings**: Numbered list with type tag, control/CVE ID, title, account, resource ARN, and remediation docs URL
Present the summary to the user. For compliance findings, ask: "Which control or finding would you like to start with? Or should I start from the top?"
For non-compliance findings, apply the intelligent grouping rules (see below) and present actionable summaries rather than raw finding lists.
### Other Finding Types
The skill defaults to compliance findings because they have the highest CLI-remediable rate. If the user asks why they're only seeing compliance findings, or asks to see other types, fetch them and present this guidance:
| Type | Source | What Kiro Can Do ||------|--------|------------------|| `compliance` | Security Hub | **Directly remediate** — fix misconfigurations via CLI commands || `access` | IAM Access Analyzer | **Directly remediate** — tighten IAM policies via CLI || `vulnerability` | Inspector | **Help triage** — group CVEs by image/repo/package, identify which images need rebuilds, show fix versions. The actual fix (image rebuild, dependency update) typically happens in CI/CD. || `threat` | GuardDuty | **Help investigate** — show threat details, affected resources, recommended response actions. Incident response may require steps beyond CLI. || `sensitive-data` | Macie | **Partially remediate** — can adjust bucket policies and encryption settings. Data classification decisions need human review. || `firewall` | Firewall Manager | **Case by case** — depends on the specific policy type and whether the resource is centrally managed. |
For non-compliance findings, Kiro's role shifts from "fix it" to "help you understand and triage it efficiently."
### Intelligent Grouping for Non-Compliance Findings
When fetching vulnerability or other non-compliance findings, group them intelligently to reduce noise:
- **Vulnerability (Inspector)**: Group by affected image/repository (ECR), package name, or Lambda function — not by individual CVE. A single outdated base image can generate hundreds of CVE findings. Present as: "Image `my-app:latest` in ECR repo `my-repo` has 47 CVEs (12 CRITICAL, 35 HIGH). Top packages needing updates: openssl (8 CVEs), curl (5 CVEs)..."- **Threat (GuardDuty)**: Group by resource and threat type. Present as: "EC2 instance `i-abc123` has 3 threat findings: CryptoCurrency mining, unusual API calls, SSH brute force."- **Sensitive Data (Macie)**: Group by S3 bucket. Present as: "Bucket `data-lake-prod` has 12 sensitive data findings: 5 PII, 4 financial, 3 credentials."
This prevents the user from being overwhelmed by hundreds of individual CVE findings when the action is "rebuild one image."
## Phase 2 — Remediate Findings (Loop)
For each finding the user selects (or in priority order if they said "start from top"):
### Batch Similar Findings
Before processing findings one-by-one, check if multiple findings share the same control ID and account. If so, batch them into a single remediation plan:
- **Same control + same account + multiple regions** (e.g., SSM.7 failing in us-west-2, us-east-1, us-east-2): Generate one plan with commands for all affected regions. Present as: "SSM.7 is failing in 4 regions for account 222222222222. Here are the commands for all regions:" followed by the full list.- **Same control + multiple accounts** (e.g., SSM.7 in account A and account B): Group by account, then batch regions within each account.- **Same control + same resource type but different resources** (e.g., EC2.19 on 5 different security groups): List all affected resources in one plan so the user can see the full scope before deciding how to proceed.
This avoids the user approving the same type of fix repeatedly. Present the batched plan and ask the user: "Would you like to approve all commands in this batch, or step through each one individually?" After batching, proceed through the steps below for each batch or individual finding:
### Step 1: Research
1. Look up the Security Hub control ID in AWS documentation using the `Remediation.Recommendation.Url` from the finding2. Read the finding's `Description`, `Remediation`, and `Resources` fields3. Identify the affected resource ARN and resource type
### Step 2: Pre-Remediation Checks
Before generating a plan, run these checks:
#### Resource attachment/usage checkCheck if the resource is actively in use. Unused resources can often just be deleted.- **Security groups**: `aws ec2 describe-network-interfaces --filters "Name=group-id,Values=<SG_ID>"` — if empty, suggest deletion- **IAM roles/policies**: Check `RoleLastUsed` or policy attachment count- **S3 buckets**: Check if the bucket has objects or is referenced by other services- **EBS volumes**: Check attachment state
If unused, recommend deletion and confirm with the user.
#### Service-managed resource detectionSome resources are managed by other AWS services and should not be modified directly. Check for:- Security group names starting with `d-` (AWS Directory Service)- Descriptions containing "managed by", "created by", "ELB", "RDS", "ElastiCache"- Tags: `aws:cloudformation:stack-name`, `aws:eks:cluster-name`, `aws:elasticmapreduce:job-flow-id`- ENI descriptions referencing other services
If service-managed: do NOT plan a direct modification. Identify the parent service and recommend suppression or upstream changes. Inform the user: "This resource is managed by <SERVICE>. Modifying it directly may be overwritten. The fix should be applied at the <SERVICE> level."
#### Parent resource dependency resolutionWhen a finding targets a child resource owned by a parent service:- Security groups owned by Directory Service → remediate via Directory Service settings- Security groups owned by ELB → modify via load balancer configuration- ENIs owned by Lambda/RDS/ECS → changes go through the parent service- IAM roles created by CloudFormation → update the stack template
Include the parent service and recommended approach in the plan.
### Step 3: Generate Plan
Present a plan including:1. **Finding**: Control ID, title, severity, affected resource ARN2. **Account**: Which account the resource lives in3. **Resource status**: In use / unused / service-managed (from Step 2)4. **Root Cause**: What's misconfigured5. **Fix**: Specific AWS CLI commands or recommended action6. **Impact Assessment**: What changes, potential disruption7. **Rollback**: How to undo the change
### Step 4: Execute
Behavior depends on execution mode:- **Confirm each** (default) — Show the exact command, wait for user to approve, skip, modify, or suppress- **Plan only** — Save the plan to the tracker, do NOT execute. Move to next finding.
When executing, use `--profile <TARGET_PROFILE_NAME>`. The CLI handles role assumption or SSO automatically via the profile.
Where supported, run a dry-run first to catch permission errors before the real execution:- **EC2 operations**: Use `--dry-run` flag (e.g., `aws ec2 revoke-security-group-ingress --dry-run`)- **S3 operations**: Verify access with a read operation before writing (e.g., `get-bucket-policy` before `put-bucket-policy`)- **IAM operations**: Use IAM Policy Simulator or `get-role` to verify access before modifying
If the dry-run fails with an access denied error, inform the user about the missing permission before attempting the real command.
After execution, verify the command succeeded (check exit code and output).
### Step 5: Suppression Workflow
If the user chooses to suppress a finding (accept the risk):
```bashaws securityhub batch-update-findings \ --finding-identifiers '[{"Id":"<FINDING_ID>","ProductArn":"<PRODUCT_ARN>"}]' \ --workflow '{"Status":"SUPPRESSED"}' \ --note '{"Text":"<USER_JUSTIFICATION>","UpdatedBy":"security-hub-remediation-skill"}' \ --profile <PROFILE_NAME> \ --region <REGION>```
- Always ask for a justification reason- For CRITICAL findings, require explicit acknowledgment: "This is a CRITICAL finding. Suppressing it means accepting the risk. Please confirm and provide a justification."- Record in tracker with status `suppressed` and justification in `notes`
### Step 6: Update Tracker
After each remediation (executed, planned, or suppressed), update `remediation-tracker.json`.
**Atomic writes only**: Always read the current file, modify in memory, then rewrite the entire file in a single operation. Never use incremental appends — this prevents partial or corrupt state.
```json{ "lastUpdated": "<ISO_TIMESTAMP>", "environment": { "mode": "<AUDIT|SINGLE_ACCOUNT>", "primaryAccount": "<ACCOUNT_ID>" }, "sessionStats": { "startedAt": "<ISO_TIMESTAMP>", "findingsResolved": 0, "findingsSuppressed": 0, "findingsPlanned": 0, "currentSeverity": "CRITICAL" }, "findings": [ { "findingId": "<SECURITY_HUB_FINDING_ID>", "controlId": "<CONTROL_ID>", "title": "<FINDING_TITLE>", "account": "<ACCOUNT_ID>", "region": "<REGION>", "severity": "<SEVERITY>", "resourceArn": "<RESOURCE_ARN>", "status": "<STATUS>", "fixAppliedAt": "<ISO_TIMESTAMP>", "verifiedInHub": false, "lastChecked": null, "notes": "<WHAT_WAS_DONE>", "rollbackCommand": "<ROLLBACK_COMMAND_IF_APPLICABLE>" } ]}```
Status values:- `planned` — plan generated, not yet executed- `fixed_locally` — fix applied, waiting for Security Hub to update- `verified` — Security Hub confirms the finding is resolved- `failed` — fix attempt failed, needs investigation- `suppressed` — user chose to suppress/accept the risk
### Step 7: Move to Next Finding
Ask: "Finding <CONTROL_ID> on <RESOURCE> is marked as <STATUS>. Move to the next finding, or would you like to check something else?"
Continue until the user stops or all findings are addressed.
## Phase 3 — Verify Remediation Status
When the user asks to check status:
1. Load `remediation-tracker.json`2. For each `fixed_locally` finding: re-fetch from Security Hub, check if `Compliance.Status` changed to `PASSED` - If PASSED: update to `verified` - If still FAILED: keep as `fixed_locally`, update `lastChecked`3. Present a status report: ``` ✅ Verified (3): S3.5 on bucket-a, EC2.19 on sg-123, IAM.6 on root-account ⏳ Pending verification (2): S3.8 on bucket-b, RDS.3 on db-prod ❌ Failed (1): Lambda.1 on my-function — needs investigation 📋 Planned (4): Not yet executed ```
**Note**: Security Hub can take 12-24 hours to re-evaluate. If findings still show FAILED shortly after remediation, inform the user this is expected.
## Resuming a Previous Session
1. Check if `remediation-tracker.json` exists2. If yes, load it and present the current status summary including session stats: "Previous session: X findings resolved, Y planned, Z suppressed. Currently on <SEVERITY> severity."3. Read the target account profile map from `.kiro/steering/security-hub-remediation.md` — no need to re-scan profiles4. Ask: "Continue where you left off, re-fetch for new findings, or verify previous fixes?"5. When re-fetching, merge new findings with existing tracker state — don't lose history
## Security Rules
- Never store AWS credentials in any file- Never modify IAM policies to add wildcard (*) permissions as a remediation- Always show the exact command before execution and wait for confirmation- Run dry-run checks where supported (e.g., EC2 `--dry-run`) to catch permission errors before real execution- Check resource usage before planning — unused resources should be recommended for deletion- Detect service-managed resources and recommend upstream fixes instead of direct modification- Destructive operations (deleting resources, modifying security groups) always require explicit confirmation regardless of execution mode- Suppression requires a justification reason recorded in both Security Hub and the local tracker- Never suppress a CRITICAL finding without explicit user acknowledgmentEnjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article