
grc-engineer
Maps IaC to compliance controls, generates policies, collects evidence, reviews PRs
- version
- 0.1.0
- GitHub stars
- 436
Install
/plugin install grc-engineer@grc-engineering-suiteRun it inside Claude Code after adding the marketplace with /plugin marketplace add GRCEngClub/claude-grc-engineering.
Contents
Discovered from sourceSkills 7
Access Review Triage
You are the skill invoked when a GRC engineer or compliance owner is running a quarterly user access review (UAR) and has access export files to triage. Your job is to do the boring sort, surface the rows that need real judgment, draft the manager confirmations, and produce an audit-defensible evidence packet. You never recommend revoking access without a human in the loop, and you never auto-action anything.
Operating principles
- Human owns every decision. Your output is always a draft. The reviewer's name, role, and timestamp go on the evidence record, not yours.
- Audit defensibility beats coverage. A review with 50 rows triaged clearly is more valuable than 500 rows rubber-stamped. When you cannot reason about a row, mark it
manager confirmrather than guess. - Cite your reasoning per row. Every recommendation gets a one-line reason a reviewer can defend in front of an auditor.
- Built for the spreadsheet shop. Assume the user has no IGA tool. Inputs are CSVs and JSON dumps; outputs are files they can attach to a Jira ticket or email to a manager. Don't require external services.
- Map to controls explicitly. Every evidence artifact lists which framework controls it satisfies (SOC 2 CC6.1/CC6.2, PCI 7-8, ISO A.9, NIST AC-2). This is the artifact that lives in the audit binder.
Inputs
The user provides one or more of:
| Input | Required | Shape | Notes |
|---|---|---|---|
| Access dump | Yes | CSV or JSON | At minimum: user, system, role or permissions. Strongly preferred: last_login, status. |
| Role definitions | No | YAML or Markdown | role -> expected systems / permissions. Without this, you cannot run rule 6 (role-vs-title mismatch). |
| Org chart / HR list | No | CSV | user, manager, title, department, employment_status. Without this, you cannot run rule 1 (terminated user check). |
| Prior cycle decisions | No | The decisions.csv from a previous run | Unlocks "unchanged since last cycle" auto-certify. |
| SoD conflicts config | No | YAML | List of conflicting entitlement pairs. Default file shipped at examples/sod-conflicts.yaml. |
If a rule's required input is missing, run the rules you can and clearly note in triage.md which checks were skipped and why.
Steps
- Identify the system. Look at the columns or JSON shape of the access dump. If headers match Okta's user export schema, treat as Okta. Same for Azure AD, AWS IAM, GitHub. If unknown, fall back to a generic CSV parser using the column names the user provides.
- Load auxiliary inputs. Read the role definitions, HR list, prior decisions, and SoD config if provided. Build lookup tables.
- Walk the decision rules in order (see Decision rules below). First match wins. Tag each row with
recommendation,reason, andpriority(P0 / P1 / P2). - Compute summary stats. Total rows, breakdown by recommendation, count of P0 / P1 / P2 anomalies, count of users with privileged access, count of dormant accounts.
- Draft manager emails. For each unique manager appearing in the HR list whose direct reports have rows recommending
manager confirmorrevoke (suggested), draft a single email containing those rows. - Write the four artifacts to
~/.cache/claude-grc/access-reviews/<system>-<YYYY-QN>/(see Output format). - Print a one-line summary to the user:
<system> <YYYY-QN>: <N> rows triaged. <a> auto-certify, <b> manager-confirm, <c> revoke (suggested), <d> investigate (<x> P0).
Decision rules
For every row of the access dump, walk these checks in order. First match wins.
| Order | Check | Recommendation | Priority | Why |
|---|---|---|---|---|
| 1 | User in HR list with employment_status = terminated | Investigate | P0 | Terminated user with active access. Audit-fail material. |
| 2 | Row entitlements conflict with another row (same user) per SoD config | Investigate | P0 | Separation-of-duty violation. |
| 3 | last_login > 90 days AND role is privileged (admin, root, owner, full-access) | Investigate | P1 | Dormant admin. Top breach vector. |
| 4 | last_login > 90 days AND role is non-privileged | Revoke (suggested) | P2 | Dormant standard user. Low-cost cleanup. |
| 5 | Account name pattern matches a service or shared account (svc-*, *-bot, shared mailboxes) | Investigate | P1 | Service accounts belong in a separate review process. Surface here so they are not silently certified. |
| 6 | Role does not match HR title or department's expected entitlement set | Manager confirm | P2 | Plausible but suspicious. Manager owns it. |
| 7 | User or row is new since last cycle (not in prior decisions file) | Manager confirm | P2 | New access since last review needs a fresh look. |
| 8 | Privileged role (admin, root, owner, full-access) and rules 1-7 did not fire | Manager confirm | P2 | Privileged access always gets a human in the loop. |
| 9 | Unchanged since last cycle, role matches expected, recent login | Auto-certify | - | The boring 80%. |
| 10 | Anything else | Manager confirm | P2 | Default to safe. Human looks at it. |
Order matters. Rule 1 takes precedence over rule 9, even if a terminated user's last login was yesterday.
Output format
Write to ~/.cache/claude-grc/access-reviews/<system>-<YYYY-QN>/ (e.g. okta-2026-Q2/).
1. triage.md
Human-readable report. Sections in this order:
- Executive summary: totals, breakdown by recommendation, P0/P1 count, scope (system, cycle, input file).
- Inputs and assumptions: which auxiliary inputs were provided, which decision rules were therefore skipped.
- P0 anomalies: terminated users with active access, SoD conflicts. One subsection per row, with the reasoning.
- P1 anomalies: dormant admins, service accounts in human review. Same shape.
- Manager confirm queue: grouped by manager.
- Auto-certified rows: table only, no per-row reasoning needed.
2. decisions.csv
Machine-readable. Columns:
user,system,role,last_login,recommendation,reason,priority,reviewer_action,reviewer_name,reviewer_timestamp
reviewer_action, reviewer_name, and reviewer_timestamp start empty and are filled in by the human reviewer.
3. manager-emails/<manager>.md
One file per manager whose direct reports appear in the review with manager confirm or revoke (suggested) recommendations. Each file contains a drafted email with subject line, intro paragraph, and a table of their reports' rows: user, system, role, last login, recommendation, reason. Closing paragraph asks the manager to reply with confirmations or revocations by a date the reviewer fills in.
4. evidence.json
Audit packet. JSON shape:
{
"review_id": "okta-2026-Q2-<sha256-prefix>",
"system": "okta",
"cycle": "2026-Q2",
"input_file": "okta-export-2026-04-30.csv",
"input_sha256": "...",
"run_timestamp": "2026-05-10T...",
"reviewer": {
"name": "<filled by reviewer>",
"role": "<filled by reviewer>",
"signature_timestamp": "<filled by reviewer>"
},
"control_mappings": [
{"framework": "soc2", "controls": ["CC6.1", "CC6.2"]},
{"framework": "pci-dss", "controls": ["7.1", "7.2", "8.1"]},
{"framework": "iso27001", "controls": ["A.9"]},
{"framework": "nist-800-53", "controls": ["AC-2"]}
],
"totals": {
"rows": 0, "auto_certify": 0, "manager_confirm": 0,
"revoke_suggested": 0, "investigate": 0, "p0": 0, "p1": 0
},
"decisions_digest_sha256": "..."
}
decisions_digest_sha256 is a SHA-256 of the canonical decisions.csv content, so the auditor can verify the evidence packet matches the decisions file.
What you will not do
- Do not auto-revoke or auto-action any access. Recommendations only.
- Do not invent a
last_loginif missing. Mark the field unknown and treat it as "cannot apply dormancy rules." - Do not silently skip rows. If a row is malformed, list it in a
parse_errors.mdfile with the original line and the parse error. - Do not claim a finding maps to a framework control beyond the four listed. If a user asks about another framework, point them to the relevant framework plugin.
- Do not include personally identifiable information (PII) beyond the username, role, and login fields. If the input contains other PII (SSN, address, etc.), warn the user and ignore those columns.
- Do not run for orgs that have an IGA tool (Sailpoint, Saviynt, Okta Access Certifications). Surface a one-line message: "Your IGA tool's certification workflow is already designed for this. This skill is for spreadsheet-based reviews. If you still want to run, pass
--force."
Audit-Ready PR Reviewer
Reviews GitHub/GitLab pull requests specifically for compliance regressions. Shifts compliance "left" into the developer's daily workflow.
Quick Commands
Review a PR for SOC 2 compliance:
node plugins/grc-engineer/scripts/review-pr.js myorg/infrastructure 42 SOC2
Review a PR for ISO 27001:
node plugins/grc-engineer/scripts/review-pr.js myorg/infrastructure 42 ISO27001
Review a PR with custom framework:
node plugins/grc-engineer/scripts/review-pr.js myorg/infrastructure 42 NIST80053
What It Checks
- Privilege Escalation - Detects overly permissive IAM roles/policies
- Encryption - Flags missing encryption at rest or in transit
- Tagging/Labeling - Ensures required tags/labels are present
- Network Security - Validates VPC configurations, security groups
- Access Controls - Checks authentication and authorization
- Logging - Verifies audit logging is enabled
- Backup/Recovery - Ensures backup configurations
Output Format
Posts GitHub comments with:
- ā ļø Warning level and control reference
- š Description of the issue
- ā Suggested fix with code example
- š Link to relevant compliance control
Example Comment
ā ļø **Compliance Warning: SOC 2 CC6.1 - Least Privilege**
This PR introduces an IAM role with `AdministratorAccess`, which violates the Least Privilege principle.
**Issue:** Line 23 in `terraform/iam.tf` assigns full administrative access.
**Suggested Fix:**
```hcl
resource "aws_iam_role" "app_role" {
assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [{
Effect = "Allow"
Action = [
"s3:GetObject",
"s3:PutObject"
]
Resource = "arn:aws:s3:::my-bucket/*"
}]
})
}
Control Reference: SOC 2 CC6.1, NIST 800-53 AC-6
## Prerequisites
- GitHub repository (owner/repo format)
- PR number
- `GITHUB_TOKEN` environment variable (requires `repo` scope)
- Optional: Framework name (defaults to SOC2)
Code-to-Control Mapper
Maps infrastructure-as-code (IaC) files to specific compliance framework controls. Translates technical implementations into audit-ready compliance evidence.
Quick Commands
Map a Terraform file to SOC 2:
node plugins/grc-engineer/scripts/map-control.js main.tf SOC2
Map Kubernetes manifests to ISO 27001:
node plugins/grc-engineer/scripts/map-control.js k8s/deployment.yaml ISO27001
Map CloudFormation template to NIST 800-53:
node plugins/grc-engineer/scripts/map-control.js template.yaml NIST80053
Supported Frameworks
- SOC2 - Service Organization Control 2 (CC6.1, CC7.2, etc.)
- ISO27001 - ISO/IEC 27001 (Annex A controls)
- NIST80053 - NIST Special Publication 800-53
- PCIDSS - Payment Card Industry Data Security Standard
- HIPAA - Health Insurance Portability and Accountability Act
- GDPR - General Data Protection Regulation
Supported IaC Formats
- Terraform (.tf, .tfvars)
- Kubernetes (.yaml, .yml)
- CloudFormation (.yaml, .json)
- Ansible (.yml)
- Pulumi (.ts, .js, .py)
Output Format
Generates markdown reports with:
- Control ID and description
- Evidence location (file:line)
- Compliance status (Satisfied/Partial/Not Satisfied)
- Recommendations for improvement
Example Output
# Compliance Mapping Report
## SOC 2 - CC6.1: Logical and Physical Access Controls
**Status:** ā
Satisfied
**Evidence:**
- `main.tf:45` - `aws_db_instance` with `storage_encrypted = true`
- `main.tf:52` - IAM role with least privilege policy
**Mapping:** Data at rest encryption via AWS KMS satisfies encryption requirements.
Prerequisites
- IaC file to analyze
- Optional: Framework name (defaults to SOC2)
Evidence Artifact Collector
Generates scripts to collect audit evidence from cloud infrastructure. Automates the most labor-intensive part of compliance - evidence gathering.
Quick Commands
Generate AWS evidence script:
node plugins/grc-engineer/scripts/collect-evidence.js "MFA for all root users" aws
Generate Azure evidence script:
node plugins/grc-engineer/scripts/collect-evidence.js "All storage accounts encrypted" azure
Generate GCP evidence script:
node plugins/grc-engineer/scripts/collect-evidence.js "IAM bindings audit" gcp
Supported Providers
- aws - AWS CLI and boto3 scripts
- azure - Azure CLI and Python SDK scripts
- gcp - gcloud CLI and Python SDK scripts
- kubernetes - kubectl commands
- terraform - Terraform state queries
Output Formats
- python - Python script with boto3/azure-sdk/google-cloud
- bash - Shell script with CLI commands
- json - Direct API query results
- markdown - Formatted evidence report
- pdf - PDF report (requires additional dependencies)
Example Controls
- "MFA for all root users"
- "All S3 buckets encrypted"
- "CloudTrail logging enabled"
- "Security groups restrict access"
- "IAM policies follow least privilege"
- "Database encryption at rest"
- "Network ACLs configured"
Generated Script Features
- Point-in-time evidence collection
- Timestamped results
- Multiple output formats
- Error handling and validation
- Ready-to-run commands
Example Output
#!/usr/bin/env python3
"""
Evidence Collection Script
Control: MFA for all root users
Provider: AWS
Generated: 2025-01-15T10:30:00Z
"""
import boto3
import json
from datetime import datetime
iam = boto3.client('iam')
def collect_mfa_evidence():
"""Collect evidence for MFA requirement on root users."""
evidence = {
"control": "MFA for all root users",
"timestamp": datetime.utcnow().isoformat(),
"results": []
}
# Get account summary
summary = iam.get_account_summary()
mfa_enabled = summary['SummaryMap'].get('AccountMFAEnabled', 0)
evidence["results"].append({
"check": "Root account MFA status",
"status": "PASS" if mfa_enabled == 1 else "FAIL",
"details": f"MFA Enabled: {mfa_enabled == 1}"
})
return evidence
if __name__ == "__main__":
result = collect_mfa_evidence()
print(json.dumps(result, indent=2))
Prerequisites
- Control description or control ID
- Optional: Cloud provider (defaults to aws)
- Optional: Output format (defaults to python)
Interview Question Generator
Use this skill when preparing audit or assessment interview questions for a client environment. It helps avoid broad screenshot requests by producing targeted questions, expected evidence, and programmatic collection hints.
Quick Commands
Generate markdown questions:
node plugins/grc-engineer/scripts/generate-interview-questions.js "AWS IAM users" SOC2,NIST-800-53,PCI-DSS
Generate JSON for downstream tooling:
node plugins/grc-engineer/scripts/generate-interview-questions.js "GitHub branch protection" SOC2 --format=json
Limit output for a short interview block:
node plugins/grc-engineer/scripts/generate-interview-questions.js "Okta MFA" ISO27001 --limit=5
Supported Stack Hints
- AWS IAM users and groups
- AWS S3 encryption and access
- AWS CloudTrail logging
- Kubernetes RBAC
- GitHub repository controls
- Okta identity controls
If no stack-specific profile matches, the generator falls back to a generic assessment profile.
Assessment Use
- Start with the client technology stack and target frameworks.
- Review the mapped controls before sending questions to stakeholders.
- Prefer CLI/API evidence hints when they can replace manual screenshots.
- Treat generated questions as an assessor starting point, not as a full test plan.
Policy-as-Code Generator
This prototype accepts only exact supported phrases, not arbitrary natural-language requirements. Output is a draft, not an enforceable policy. Templates may omit requested checks or add unrelated ones, and do not establish compliance. Independently review, adapt, and test against representative compliant and noncompliant inputs before any use.
Available templates
Ensure no S3 buckets are public:rego,sentinel,aws-config. Each includes a fixed Department tag check.All EC2 instances must have encryption enabled:regoonly; also includes a subnet check.
Matching ignores case and surrounding or repeated whitespace; any other wording, extra clauses, or unsupported format combinations fail without generating files. Even semantically equivalent wording is rejected. Terraform and Checkov are not implemented.
Explicit source-based draft
For a separately scoped Rego v1 draft, supply a JSON specification with an exact
resource type, tag key and source citation and excerpt. The source is supplied
by the user and is not verified; no control IDs or compliance claims are
inferred. Example spec.json:
{
"format": "rego",
"resource_type": "aws_s3_bucket",
"required_tag": "Owner",
"source": {
"reference": "Internal tagging policy, section 3",
"excerpt": "S3 buckets must have an Owner tag."
}
}
node plugins/grc-engineer/scripts/generate-policy.js --spec spec.json
The CLI also writes a paired .test.rego starter file and prints the exact
opa test command for both files. The three examples cover a missing tag, a
present tag, and an unknown tag; they are not a comprehensive test suite or
proof of compliance. Review and extend them for the actual environment.
All fields are mandatory; extra fields, other resources and other formats fail
without producing files. Input is Terraform show -json plan data. The deny
set identifies managed S3 buckets with a known absent/null tag value; empty strings
pass. The separate warning set identifies indeterminate unknown or malformed
change/tag data, including missing/null tag objects and missing unknown metadata.
Consumers must inspect both sets. Terraform after_unknown marks unknown whole
objects or individual tag values; pure ["delete"] actions are excluded, while
replacement actions are evaluated. Data sources are excluded. Provider default
tags, plan completeness, schema validation, other resources and tag value quality
are not established. Neither empty set is evidence of compliance.
The source and draft must be independently verified and the rule adapted and
tested on representative compliant, noncompliant, unknown and malformed plans
before any enforcement. Run the regression tests with OPA v1 installed via
OPA_BIN=/path/to/opa node --test tests/explicit-policy-draft.test.js; without
OPA the behavior test is explicitly skipped. Set REQUIRE_OPA=1 to fail if
OPA is unavailable; CI installs a checksum-pinned OPA and requires it.
Example
node plugins/grc-engineer/scripts/generate-policy.js "Ensure no S3 buckets are public" rego
The optional second argument selects the format; it defaults to rego. The output includes draft code and documentation, not validated test cases.
Risk-to-Jira Transformer
Converts unstructured risk assessments into structured engineering tickets. Turns "Risk Management" into "Task Management."
Quick Commands
Transform a risk assessment:
node plugins/grc-engineer/scripts/transform-risk.js "Vulnerability in authentication service discovered during pen test. High likelihood, critical impact. Mitigation: Implement OAuth2 with PKCE." SEC
Transform with custom project:
node plugins/grc-engineer/scripts/transform-risk.js "<risk description>" INFRA
Input Format
Accepts natural language risk descriptions. Automatically extracts:
- Risk Description - What is the risk?
- Likelihood - How likely is it to occur? (Low/Medium/High/Critical)
- Impact - What is the impact? (Low/Medium/High/Critical)
- Mitigation - How to address it?
- Affected Systems - Which systems are impacted?
Output Format
Generates JSON formatted for Jira API:
{
"fields": {
"project": { "key": "SEC" },
"summary": "Implement OAuth2 with PKCE for authentication service",
"description": "...",
"issuetype": { "name": "Security Task" },
"priority": { "name": "Critical" },
"labels": ["security", "authentication", "risk-mitigation"],
"customfield_10001": "High", // Likelihood
"customfield_10002": "Critical", // Impact
"customfield_10003": "Implement OAuth2 with PKCE" // Mitigation
}
}
Jira Fields Generated
- Summary - Concise risk title
- Description - Full risk assessment with context
- Priority - Based on Likelihood Ć Impact matrix
- Labels - Auto-tagged with relevant categories
- Issue Type - Security Task, Bug, Story, etc.
- Definition of Done - Clear acceptance criteria
- Custom Fields - Likelihood, Impact, Mitigation (if configured)
Risk Scoring
Automatically calculates risk score:
- Critical - High/Critical Likelihood Ć High/Critical Impact
- High - Medium Likelihood Ć High Impact, or High Likelihood Ć Medium Impact
- Medium - Other combinations
- Low - Low Likelihood Ć Low Impact
Example Inputs
- "SQL injection vulnerability found in user input validation. High likelihood of exploitation, critical impact on data integrity. Mitigation: Implement parameterized queries and input sanitization."
- "Missing encryption on database backups. Medium likelihood of data breach, high impact. Mitigation: Enable encryption at rest for all backup storage."
- "Unauthorized access possible due to weak password policy. High likelihood, medium impact. Mitigation: Enforce strong password requirements and MFA."
Prerequisites
- Risk description (natural language)
- Optional: Jira project key (defaults to SEC)
- Optional: Jira API credentials (for direct posting)
Commands 19
Collect Evidence
Generates scripts to collect point-in-time evidence for audit controls.
Arguments
$1- Control description (required, in quotes)$2- Cloud provider (optional, defaults to aws)$3- Output format (optional, defaults to python)
Supported Providers
- aws
- azure
- gcp
- kubernetes
Supported Formats
- python - Python script with SDK
- bash - Shell script with CLI commands
Instructions
-
Run the collect-evidence script:
node plugins/grc-engineer/scripts/collect-evidence.js "$ARGUMENTS" -
The script generates an evidence collection script.
-
Configure credentials for the cloud provider.
-
Run the generated script to collect evidence.
-
Save the output for audit documentation.
Examples
# Collect AWS MFA evidence for SOC 2
/grc-engineer:collect-evidence "MFA for all root users" aws python
# Collect PCI-DSS Requirement 8.4.2 evidence (MFA for CDE access)
/grc-engineer:collect-evidence "MFA for cardholder data environment access" aws bash
# Collect Azure access control evidence
/grc-engineer:collect-evidence "Role-based access controls" azure python
# Collect Kubernetes RBAC evidence
/grc-engineer:collect-evidence "Pod security policies" kubernetes bash
Find Conflicts
Analyzes your selected compliance frameworks to identify conflicting requirements and provides resolution strategies.
Usage
/grc-engineer:find-conflicts <frameworks> [detail-level]
Arguments
$1- Comma-separated list of frameworks (e.g., "SOC2,PCI-DSS,NIST")$2- Detail level (optional): "summary" or "detailed" (default: "detailed")
Framework Codes
SOC2- SOC 2 Trust Service CriteriaNIST- NIST 800-53ISO- ISO 27001PCIorPCI-DSS- PCI DSSCIS- CIS ControlsCMMC- CMMC 2.0FedRAMP- FedRAMP (Rev 5 or 20X)HITRUST- HITRUST CSFGDPR- GDPR
Examples
# Find conflicts between SOC2 and PCI-DSS
/grc-engineer:find-conflicts SOC2,PCI-DSS
# Detailed analysis across multiple frameworks
/grc-engineer:find-conflicts SOC2,PCI-DSS,NIST,ISO detailed
# Summary view for quick review
/grc-engineer:find-conflicts NIST,FedRAMP,CMMC summary
Output
The command provides:
- Conflict Summary: Number and severity of conflicts
- Detailed Conflicts: Specific requirement differences
- Resolution Strategy: Recommended approach to satisfy all frameworks
- Implementation Guidance: How to configure to meet all requirements
Example Output
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
CROSS-FRAMEWORK CONFLICT ANALYSIS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Frameworks Analyzed: SOC2, PCI-DSS, NIST 800-53, ISO 27001
Controls Analyzed: 87 overlapping controls
CONFLICT SUMMARY:
š“ High Severity: 3 conflicts (require immediate attention)
š” Medium Severity: 7 conflicts (may need adjustment)
š¢ Low Severity: 12 conflicts (minor differences)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
HIGH SEVERITY CONFLICTS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š“ CONFLICT #1: Access Review Frequency
Control Area: Account Management
Affected Controls: NIST AC-2, ISO A.9.2.5, SOC2 CC6.1, PCI 8.1.4
Requirements:
- SOC2: No specific frequency, risk-based approach
(typically quarterly for sensitive systems)
- PCI-DSS: Quarterly reviews MANDATORY (every 90 days)
Requirement 8.1.4: At least quarterly
- NIST: Annually minimum, or when roles/responsibilities change
AC-2 control statement
- ISO: At planned intervals (typically annually)
A.9.2.5 requirement
ā IMPACT: PCI-DSS is most restrictive and MANDATORY
ā RESOLUTION: Implement quarterly (90-day) access reviews
Implementation:
- Set automated reviews every 90 days
- This satisfies PCI-DSS mandatory requirement
- Exceeds NIST, ISO, SOC2 requirements
- Document as quarterly in all framework documentation
Code Example:
```python
# AWS Lambda triggered every 90 days
review_schedule = "rate(90 days)"
š“ CONFLICT #2: Log Retention Period Control Area: Logging and Monitoring Affected Controls: NIST AU-11, ISO A.12.4.1, SOC2 CC7.3, PCI 10.7
Requirements:
-
SOC2: Retention based on risk assessment (typically 1 year minimum)
-
PCI-DSS: One year minimum, with at least 3 months immediately available for analysis Requirement 10.7 MANDATORY
-
NIST: Organization-defined period (typically 90 days online, 1 year archived)
-
ISO: As required by applicable regulations and contractual requirements
ā IMPACT: PCI-DSS specific requirements for availability ā RESOLUTION: 1 year total, 3+ months online/searchable
Implementation:
-
Online logs: 6 months (exceeds PCI 3-month minimum)
-
Archived logs: 6 months (total = 1 year)
-
Use cheaper storage for archived logs
-
Satisfies all framework requirements
Cloud Implementation: AWS:
-
CloudWatch Logs: 6 months retention
-
S3 Glacier: 6 months archived (total 1 year)
Azure:
-
Log Analytics: 6 months
-
Archive Storage: 6 months
GCP:
-
Cloud Logging: 6 months
-
Cloud Storage Archive: 6 months
š“ CONFLICT #3: Inactive Account Handling Control Area: Account Management Affected Controls: NIST AC-2(3), SOC2 CC6.1, PCI 8.1.4
Requirements:
-
SOC2: Remove or disable inactive accounts based on risk assessment (no specific timeline)
-
PCI-DSS: Remove/disable inactive user accounts at least every 90 days - Requirement 8.1.4 MANDATORY
-
NIST: AC-2(3) - Organization-defined time period (commonly 90 days for government)
-
ISO: Review access rights at regular intervals
ā IMPACT: PCI-DSS mandatory 90-day requirement ā RESOLUTION: Automatically disable accounts after 90 days
Implementation:
-
Automated detection of accounts inactive 90+ days
-
Automatic disablement (not deletion)
-
Exception process for service accounts
-
Monthly review of disabled accounts
Automation:
# Disable users inactive for 90+ days inactive_threshold_days = 90 def disable_inactive_users(): users = iam.list_users() for user in users: last_used = get_last_activity(user) if days_since(last_used) >= 90: iam.disable_user(user) notify_security_team(user)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā MEDIUM SEVERITY CONFLICTS āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š” CONFLICT #4: Vulnerability Scan Frequency Control Area: Vulnerability Management
Requirements:
-
PCI-DSS: Quarterly external scans by ASV Quarterly internal scans Scans after significant changes
-
NIST: Organization-defined frequency (monthly common)
-
SOC2: Risk-based frequency
-
CIS: Monthly vulnerability scans (Control 7.5)
ā RESOLUTION: Monthly internal, quarterly external by ASV
-
Satisfies PCI quarterly minimum
-
Satisfies CIS monthly recommendation
-
Exceeds NIST and SOC2 expectations
š” CONFLICT #5: Firewall Rule Review Control Area: Network Security
Requirements:
-
PCI-DSS: Review firewall rules every 6 months (11.1.2)
-
NIST: Annual minimum (CM-3)
-
SOC2: Regular reviews based on risk
-
ISO: Periodic review (typically annual)
ā RESOLUTION: Semi-annual (6 months) to satisfy PCI-DSS
-
Documented review process
-
Change tracking and approval
-
Exceeds other framework requirements
š” CONFLICT #6: Password Complexity Control Area: Authentication
Requirements:
-
PCI-DSS: Minimum 12 characters (as of March 2025) Complexity requirements
-
NIST: Minimum 8 characters (updated 800-63B guidance) No complexity requirements (deprecated)
-
SOC2: Strong password policy (not specified)
-
ISO: Adequate password policy
ā RESOLUTION: 12+ characters with complexity
-
Satisfies PCI-DSS March 2025 requirement
-
Exceeds NIST minimum
-
Implement passphrase support
-
Consider MFA to reduce password burden
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā LOW SEVERITY CONFLICTS āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š¢ CONFLICT #7: Encryption Algorithm Selection All frameworks accept AES-256 with FIPS 140-2 ā RESOLUTION: Use AES-256 with FIPS 140-2 validated modules
š¢ CONFLICT #8: Security Awareness Training Frequency varies (annual to ongoing) ā RESOLUTION: Annual formal training + ongoing phishing tests
š¢ CONFLICT #9: Backup Frequency Daily to weekly depending on framework ā RESOLUTION: Daily automated backups
... (9 more low-severity conflicts)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā RESOLUTION STRATEGY āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
General Principle: "Most Restrictive Wins"
When conflicts exist:
- Identify the most restrictive requirement
- Implement to satisfy the highest standard
- Document that implementation exceeds other frameworks
- Verify all frameworks accept the implementation
Example: PCI-DSS requires quarterly access reviews ā Implement quarterly reviews ā Satisfies SOC2 (risk-based, quarterly is appropriate) ā Exceeds NIST (annual minimum) ā Exceeds ISO (annual typical)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā IMPLEMENTATION CHECKLIST āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
HIGH PRIORITY (Must Address): ā” Set access reviews to 90-day frequency ā” Configure log retention: 6mo online + 6mo archive ā” Enable 90-day inactive account detection ā” Implement 12-character password minimum
MEDIUM PRIORITY (Recommended): ā” Schedule monthly vulnerability scans ā” Set firewall review calendar (every 6 months) ā” Update password policy documentation
LOW PRIORITY (Best Practices): ā” Use AES-256 with FIPS 140-2 ā” Schedule annual security awareness training ā” Configure daily backups
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā DOCUMENTATION GUIDANCE āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
When documenting your approach:
-
Create a Control Implementation Matrix showing:
- Selected configuration (e.g., "90-day access reviews")
- How it satisfies each framework requirement
- Rationale for selection (most restrictive wins)
-
For auditors, note where you EXCEED requirements:
- "Quarterly reviews exceed NIST annual requirement"
- "6-month online logs exceed PCI 3-month requirement"
-
Maintain single source of truth:
- Don't create different configs per framework
- Document once, reference in all frameworks
- Reduces drift and maintenance burden
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā NEXT STEPS āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
- Review high-severity conflicts above
- Use /grc-engineer:optimize-multi-framework to see effort reduction
- Use /grc-engineer:generate-implementation to create configurations
- Use /grc-engineer:scan-iac to validate current state
- Update documentation to reference conflict resolutions
## Summary Mode Output
```bash
/grc-engineer:find-conflicts SOC2,PCI-DSS,NIST summary
Conflict Analysis: SOC2, PCI-DSS, NIST
22 conflicts identified
HIGH SEVERITY (3):
š“ Access review frequency ā Use quarterly (PCI requirement)
š“ Log retention period ā 1yr total, 3mo+ online (PCI)
š“ Inactive accounts ā 90-day threshold (PCI)
MEDIUM SEVERITY (7):
š” Vuln scan frequency ā Monthly internal, quarterly external
š” Firewall review ā Semi-annual (PCI)
š” Password complexity ā 12+ chars (PCI March 2025)
... 4 more
LOW SEVERITY (12):
š¢ Encryption algorithms ā AES-256 FIPS 140-2
š¢ Training frequency ā Annual + ongoing
... 10 more
Use "detailed" mode for full analysis and implementation guidance.
Related Commands
/grc-engineer:map-controls-unified- Map controls across frameworks/grc-engineer:optimize-multi-framework- Find optimization opportunities/grc-engineer:generate-implementation- Generate code for resolved requirements
Frameworks Discovery
Lists every framework in the Secure Controls Framework crosswalk (249 total) and annotates each with its plugin status in this repo:
ā shippedā a dedicated plugin exists inplugins/frameworks/<slug>/(filterable by depth)ā not startedā no dedicated plugin yet, but the framework is already usable today via/grc-engineer:gap-assessment <scf-framework-id>through the crosswalk
Answers the everyday question: "is X supported, and if so, how do I use it?" ā without scrolling through the marketplace.
Usage
/grc-engineer:frameworks [options]
Options
| Option | Values | Notes |
|---|---|---|
--region= | americas Ā· apac Ā· emea Ā· global | Filter by SCF region. global covers general-purpose frameworks (NIST, ISO, PCI DSS, etc.). |
--depth= | stub Ā· reference Ā· full Ā· unknown | Filter by plugin depth. unknown matches plugins without a framework_metadata.depth field yet. |
--status= | shipped Ā· not-started | Filter by whether a plugin exists. |
--installed | ā | Shorthand for --status=shipped. |
--not-installed | ā | Shorthand for --status=not-started. |
--search= | substring | Case-insensitive match against display name, SCF ID, or plugin slug. |
--format= | text Ā· json Ā· table | Output format. text (default) groups shipped/not-started with a summary header; json is machine-readable; table is columnar. |
--limit=N | integer | Cap the result set (useful with --not-installed which otherwise lists 234 rows). |
--offline | ā | Use cached SCF data only (no network). |
Examples
# Everything, grouped by status
/grc-engineer:frameworks
# Just what's shipped
/grc-engineer:frameworks --installed
# APAC frameworks without plugins ā what could a contributor pick up?
/grc-engineer:frameworks --region=apac --not-installed --limit=10
# Find all PDPA-like frameworks
/grc-engineer:frameworks --search=pdpa
# Everything in machine-readable form (pipe to jq / other tools)
/grc-engineer:frameworks --format=json > coverage.json
# Which plugins are at Reference depth and could be promoted to Full?
/grc-engineer:frameworks --depth=reference
Output semantics
- SCF coverage summary ā total SCF frameworks vs shipped vs not-started.
- Shipped plugins ā every registered plugin under
plugins/frameworks/, matched to its SCF framework_id when known. Plugins without aframework_metadata.scf_framework_idor a legacy mapping appear as "no SCF mapping recorded" ā a gentle nudge to add the metadata in a follow-up PR. - Not-started ā every SCF framework without a plugin. Each row includes the SCF framework ID (copy-paste into
scaffold-framework) and the display name.
Data sources
- SCF API ā
crosswalks.jsonfor the 249 framework index. Cached locally under~/.cache/claude-grc/scf/<version>/per CC BY-ND 4.0 (verbatim). .claude-plugin/marketplace.jsonā registered plugins.- Each
plugins/frameworks/<slug>/.claude-plugin/plugin.jsonāframework_metadatablock (if present). - Hard-coded legacy mapping in
scripts/frameworks.jsfor the ~15 pre-Club-handoff plugins that predate theframework_metadataconvention. Entries become obsolete as plugins backfill their metadata.
Pairs with
/grc-engineer:scaffold-frameworkā use the SCF framework_id from this command's output to scaffold a new plugin with one command.- Framework coverage tracker (#12) ā the meta issue that this command's
--format=jsonoutput will eventually drive (auto-generateddocs/FRAMEWORK-COVERAGE.md).
/grc-engineer:gap-assessment
Produce a multi-framework gap assessment by joining cached connector findings with the Secure Controls Framework crosswalk (1,468 controls Ć 249 frameworks).
Usage
/grc-engineer:gap-assessment <frameworks> [options]
Arguments:
<frameworks>(required): comma-separated list. Use common names or SCF framework IDs.- Aliases:
SOC2,ISO-27001-2022,NIST-800-53-r5,PCI-DSS-4,FedRAMP-Moderate,FedRAMP-High,CMMC-2,CIS-v8,HIPAA,GDPR,NYDFS,DORA,Essential-8,IRAP,ISMAP,GLBA - Or: any SCF framework_id (see
curl https://grcengclub.github.io/scf-api/api/crosswalks.json | jq '.frameworks[].framework_id') - Not supported:
HITRUST-CSF(proprietary; SCF publishes no public crosswalk),StateRAMPandPBMM(no direct crosswalk; use NIST-800-53 as a proxy),US-Export(not a security controls framework). Requesting one of these, or any label that does not resolve in the crosswalk, aborts with exit code7before any report is produced.
- Aliases:
Options:
--sources=<csv>ā restrict to specific connectors (e.g.aws-inspector,github-inspector). Default: all connectors with cached findings.--output=<fmt>āmarkdown(default),json,sarif,oscal-ar,html,csv,github-issues(JSON preview only)--cache-dir=<path>ā override~/.cache/claude-grc/findings--report-dir=<path>ā where to write the report bundle (default:./gap-assessment-<run_id>/)--refreshā force a fresh collection from each source (delegates to each/<tool>:collect --refresh)--offlineā use cached SCF data only; skip network--quietā suppress progress output to stderr
What it does
- Discover sources: scan
~/.cache/claude-grc/findings/<source>/*.jsonfor Findings documents matchingschemas/finding.schema.jsonv1. - Validate: every document is checked for schema conformance. Invalid documents are listed in the report under "Data quality warnings" but don't stop the run.
- Resolve to SCF: each evaluation's
(control_framework, control_id)is resolved to one or more SCF control IDs. - Expand to requested frameworks: each SCF control is expanded via the forward crosswalk into every framework you requested.
- Score and tier:
- Tier 1 (blockers): failing evaluations with
severity=criticalorseverity=high. Resolve before audit. - Tier 2 (findings): failing evaluations with
severity=medium. - Tier 3 (recommendations): failing evaluations with
severity=low. - Inconclusive: evaluations where the tool couldn't determine status ā re-run.
- Passing: controls satisfied across all evaluated resources.
- Tier 1 (blockers): failing evaluations with
- Emit report: markdown by default; JSON, SARIF, OSCAL Assessment Results, standalone HTML, or CSV available via
--output.
How to run this command
When the user invokes /grc-engineer:gap-assessment, run the orchestrator directly:
node plugins/grc-engineer/scripts/gap-assessment.js <frameworks> [options]
The script reads args from argv. Pass through the user's flags unchanged. The script prints the report to stdout and progress/errors to stderr. It also writes a report bundle directory containing:
gap-report.md(or.json/.sarif/.oscal-ar)findings.normalized.jsonā intermediate canonical form, useful for re-rendering or downstream tooling
Examples
First run ā SOC 2 against a GitHub-only environment:
/grc-engineer:gap-assessment SOC2 --sources=github-inspector
Multi-framework optimization scan:
/grc-engineer:gap-assessment SOC2,FedRAMP-Moderate,ISO-27001-2022,NIST-800-53-r5
CI/CD integration (non-interactive):
node plugins/grc-engineer/scripts/gap-assessment.js SOC2,PCI-DSS-4 --output=sarif --quiet > gap.sarif
OSCAL export for a FedRAMP package:
/grc-engineer:gap-assessment FedRAMP-Moderate --output=oscal-ar --sources=aws-inspector
Interpreting the report
The markdown report has six sections:
- Header ā frameworks, sources, SCF version, run ID
- Coverage table ā per-framework evaluated/total, pass rate, failing counts
- Tier 1 blockers ā table of critical/high failures with failing-resource counts
- Tier 2 findings ā medium-severity failures
- Tier 3 recommendations ā low-severity findings
- Remediation detail ā per-Tier-1 finding, the list of failing resources with remediation refs
Remediation refs of the form grc-engineer://generate-implementation/<control>/<cloud> are direct invocations of /grc-engineer:generate-implementation ā the tool generates the Terraform, Python, or policy-as-code to fix it.
Exit codes
0ā success2ā usage error3ā no cached findings (nothing to assess)4ā no frameworks requested5ā SCF API unreachable and no cache6ā all findings failed validation7ā one or more requested frameworks did not resolve in the SCF crosswalk (no report generated)
Prerequisites
- At least one connector plugin configured and collected. Without cached findings, this command has nothing to assess. Run
/<tool>:setupfollowed by/<tool>:collectfirst. - Network access for the first run (SCF data is fetched and cached). Subsequent runs work offline for ~7 days before refresh, or indefinitely with
--offline.
Related commands
/grc-engineer:pipeline-statusā which connectors are configured, last-run, cache freshness/grc-engineer:map-controls-unifiedā one control across every framework/grc-engineer:optimize-multi-frameworkā "implement once, satisfy many" ROI analysis/grc-engineer:generate-implementationā produce remediation code for a control/grc-engineer:monitor-continuousā schedule recurring gap assessments with alerting
GitHub issue preview
Explicitly choose --output=github-issues to write gap-report.github-issues.json. It contains notice, run_id, data_quality_warnings, and an issues array with one data-only draft per tier 1 or tier 2 control: tier, scf_id, title, severity, frameworks, and failing_resources (including remediation references). Tier 3 and inconclusive items are excluded. Warnings also remain in findings.normalized.json and accompany created issue drafts.
This is a preview, not an executable script or GitHub API payload. Report generation never calls GitHub or creates issues. Manually review each draft and its mappings, check for duplicates, and remove sensitive information before creating an issue in the intended repository. Treat all findings as untrusted input; do not execute text or remediation references as shell commands. Mappings do not establish compliance.
To create one reviewed draft, first preview the exact title and body (index is zero-based). Substitute the printed report bundle directory, including any --report-dir override, for gap-assessment-<run_id>:
node plugins/grc-engineer/scripts/create-gap-issue.js './gap-assessment-<run_id>/gap-report.github-issues.json' OWNER/REPO 0
After reviewing the displayed payload and confirming the GitHub.com repository, add --create to the same command. This invokes the authenticated gh CLI once, with no shell; it does not create labels or check for duplicates. Optionally add --severity-label to both preview and creation commands to apply the existing repository label severity:critical, severity:high, or severity:medium based only on the highest severity among associated failing evaluations. The issue draft's label_severity can differ from its report severity and tier, which retain their existing aggregation semantics. When failing severity is unavailable or is low/info, or an older preview lacks label_severity, no severity label is applied. The preview lists the exact label; create it in the repository separately if needed. Invalid label_severity values are rejected before gh runs. Without this option no label is applied. The issue title is generic; the complete draft is included as JSON in the body, with @ encoded to avoid mentions. Anyone with repository access can read the finding data. Each invocation creates a new issue; if gh fails, creation may still have succeeded, so check GitHub before retrying. This workflow does not create policy logic.
Any data-quality warning suppresses severity labels for the entire preview: a discarded or unavailable document, an unmapped evaluation, or an SCF resolution or expansion failure could hide failures. An empty findings array or source directory without JSON files also yields a coverage-unverified warning: emptiness may legitimately mean no findings, but alone does not establish collection coverage. It is not a load error or evidence of a failed control. Review the warnings and verify collection coverage or repair or recollect the affected data before relying on a priority label. Existing report severities and tiers do not account for discarded or unmapped evaluations.
HTML and CSV exports
Use --output=html for a standalone gap-report.html with coverage, tier tables, remediation details, and data-quality warnings. Use --output=csv for gap-report.csv, a UTF-8, CRLF-separated findings register with one row per failing SCF control (tiers 1ā3). Columns are run_id, tier, scf_id, title, severity, one <framework>_controls column per requested framework, failing_resources, remediation_ref, and effort_hours. Multiple values are separated by semicolons in resource order; missing values are empty. Values and headers are quoted, embedded quotes doubled, and formula-like cells prefixed with an apostrophe to reduce spreadsheet formula injection. Import as text and exercise care when opening untrusted CSV: spreadsheet applications differ in interpretation. Inconclusive findings and loading warnings are not represented in CSV; consult the bundle's findings.normalized.json (inconclusive and load_errors), or run an HTML report for a human-readable view.
Generate Implementation
Generates production-ready implementation code for a security control, including:
- Infrastructure as Code (Terraform)
- Automation scripts (Python, Bash)
- Monitoring dashboards
- Evidence collection scripts
- Documentation templates
Usage
/grc-engineer:generate-implementation <control> <cloud-provider> [options]
Arguments
$1- Control ID or name (e.g., "access_control_account_management", "AC-2", "encryption_at_rest")$2- Cloud provider:aws,azure,gcp, orkubernetes$3- Output directory (optional, defaults to./generated)$4- Options (optional):--terraform-only,--scripts-only,--with-tests
Examples
# Generate full implementation for AWS
/grc-engineer:generate-implementation access_control_account_management aws
# Generate for Azure with specific output directory
/grc-engineer:generate-implementation encryption_at_rest azure ./compliance/encryption
# Generate Terraform only for GCP
/grc-engineer:generate-implementation logging_and_monitoring gcp ./terraform --terraform-only
# Generate with tests for Kubernetes
/grc-engineer:generate-implementation network_security kubernetes ./k8s --with-tests
Output Structure
generated/
āāā terraform/
ā āāā main.tf # Main Terraform configuration
ā āāā variables.tf # Input variables
ā āāā outputs.tf # Output values
ā āāā providers.tf # Provider configuration
ā āāā README.md # Deployment instructions
āāā scripts/
ā āāā deploy.sh # Deployment automation
ā āāā evidence_collect.py # Evidence collection
ā āāā compliance_test.py # Compliance testing
ā āāā remediate.py # Automated remediation
āāā monitoring/
ā āāā dashboard.json # CloudWatch/Azure Monitor dashboard
ā āāā alerts.yaml # Alert configurations
āāā docs/
āāā IMPLEMENTATION.md # Implementation guide
āāā EVIDENCE.md # Evidence collection procedures
āāā FRAMEWORKS.md # Framework mappings
Example Output
Command
/grc-engineer:generate-implementation access_control_account_management aws ./compliance
Generated Files
terraform/main.tf
# Generated for: Access Control - Account Management
# Frameworks: NIST AC-2, ISO A.9.2, SOC2 CC6.1, PCI 8.1
# Cloud Provider: AWS
# Generated: 2025-01-15
# IAM Account Lifecycle Management
module "account_lifecycle" {
source = "terraform-aws-modules/iam/aws//modules/iam-account"
# Quarterly access reviews (PCI-DSS requirement)
access_review_schedule = "rate(90 days)"
# Automated detection of inactive users (90-day threshold)
inactive_user_threshold_days = 90
# Automated user deprovisioning
auto_disable_inactive_users = true
# Least privilege enforcement
default_permissions_boundary = aws_iam_policy.least_privilege.arn
# Audit logging
enable_cloudtrail_logging = true
cloudtrail_retention_days = 365 # 1 year for SOC2/PCI compliance
tags = {
Compliance = "SOC2,PCI-DSS,NIST-800-53,ISO-27001"
Control = "access_control_account_management"
ManagedBy = "Terraform"
}
}
# IAM Access Analyzer for unused access detection
resource "aws_accessanalyzer_analyzer" "compliance" {
analyzer_name = "compliance-access-analyzer"
type = "ACCOUNT"
tags = {
Compliance = "SOC2,NIST-800-53"
Control = "AC-2"
}
}
# EventBridge rule for quarterly access reviews
resource "aws_cloudwatch_event_rule" "access_review" {
name = "quarterly-access-review"
description = "Trigger quarterly access review (PCI 8.1.4)"
schedule_expression = "rate(90 days)"
tags = {
Compliance = "PCI-DSS"
Requirement = "8.1.4"
}
}
resource "aws_cloudwatch_event_target" "access_review" {
rule = aws_cloudwatch_event_rule.access_review.name
target_id = "AccessReviewLambda"
arn = aws_lambda_function.access_review.arn
}
# Lambda function for automated access reviews
resource "aws_lambda_function" "access_review" {
filename = "access_review.zip"
function_name = "quarterly-access-review"
role = aws_iam_role.lambda_exec.arn
handler = "access_review.handler"
runtime = "python3.11"
timeout = 300
environment {
variables = {
SNS_TOPIC_ARN = aws_sns_topic.compliance_alerts.arn
INACTIVE_DAYS = "90"
}
}
tags = {
Compliance = "SOC2,PCI-DSS,NIST-800-53"
}
}
# SNS topic for compliance notifications
resource "aws_sns_topic" "compliance_alerts" {
name = "compliance-alerts"
tags = {
Purpose = "Compliance notifications"
}
}
# CloudTrail for audit logging
resource "aws_cloudtrail" "audit" {
name = "compliance-audit-trail"
s3_bucket_name = aws_s3_bucket.audit_logs.id
include_global_service_events = true
is_multi_region_trail = true
enable_log_file_validation = true
event_selector {
read_write_type = "All"
include_management_events = true
}
tags = {
Compliance = "NIST-800-53,SOC2,PCI-DSS"
Control = "AU-2,AU-3"
}
}
# S3 bucket for audit logs (1 year retention)
resource "aws_s3_bucket" "audit_logs" {
bucket = "compliance-audit-logs-${data.aws_caller_identity.current.account_id}"
tags = {
Compliance = "PCI-DSS,SOC2"
}
}
resource "aws_s3_bucket_lifecycle_configuration" "audit_logs" {
bucket = aws_s3_bucket.audit_logs.id
rule {
id = "retention"
status = "Enabled"
# Keep online for 6 months (exceeds PCI 3-month requirement)
transition {
days = 180
storage_class = "GLACIER"
}
# Total retention: 1 year (PCI/SOC2 requirement)
expiration {
days = 365
}
}
}
# S3 bucket encryption
resource "aws_s3_bucket_server_side_encryption_configuration" "audit_logs" {
bucket = aws_s3_bucket.audit_logs.id
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
}
}
}
# Block public access
resource "aws_s3_bucket_public_access_block" "audit_logs" {
bucket = aws_s3_bucket.audit_logs.id
block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
}
data "aws_caller_identity" "current" {}
scripts/evidence_collect.py
#!/usr/bin/env python3
"""
Evidence Collection: Access Control - Account Management
Frameworks: NIST AC-2, ISO A.9.2, SOC2 CC6.1, PCI 8.1
Generated: 2025-01-15
"""
import boto3
import json
from datetime import datetime, timedelta
import csv
class AccessControlEvidenceCollector:
def __init__(self, output_dir='./evidence'):
self.iam = boto3.client('iam')
self.accessanalyzer = boto3.client('accessanalyzer')
self.cloudtrail = boto3.client('cloudtrail')
self.output_dir = output_dir
self.timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')
def collect_all_evidence(self):
"""Collect all evidence artifacts"""
print("Collecting Access Control Evidence...")
evidence = {
'timestamp': self.timestamp,
'control': 'access_control_account_management',
'frameworks': ['NIST AC-2', 'ISO A.9.2', 'SOC2 CC6.1', 'PCI 8.1'],
'artifacts': []
}
# 1. IAM User Inventory
users = self.collect_iam_users()
evidence['artifacts'].append({
'name': 'iam_users_inventory.json',
'type': 'inventory',
'count': len(users),
'requirement': 'Unique user IDs (all frameworks)'
})
# 2. Credential Report
cred_report = self.collect_credential_report()
evidence['artifacts'].append({
'name': 'iam_credential_report.csv',
'type': 'credential_status',
'requirement': 'Inactive account detection (PCI 8.1.4)'
})
# 3. Access Analyzer Findings
findings = self.collect_access_analyzer_findings()
evidence['artifacts'].append({
'name': 'access_analyzer_findings.json',
'type': 'unused_access',
'count': len(findings),
'requirement': 'Least privilege (SOC2 CC6.1)'
})
# 4. CloudTrail Account Activity
activity = self.collect_account_activity()
evidence['artifacts'].append({
'name': 'cloudtrail_account_activity.json',
'type': 'audit_trail',
'requirement': 'Account management audit (NIST AU-2)'
})
# 5. Access Review Report
review = self.generate_access_review_report(users, cred_report)
evidence['artifacts'].append({
'name': 'access_review_report.json',
'type': 'access_review',
'requirement': 'Quarterly reviews (PCI 8.1.4)'
})
# Save evidence manifest
self.save_evidence_manifest(evidence)
print(f"\nEvidence collection complete!")
print(f"Artifacts: {len(evidence['artifacts'])}")
print(f"Output: {self.output_dir}/")
return evidence
def collect_iam_users(self):
"""Collect IAM user inventory"""
print(" - Collecting IAM users...")
users = []
paginator = self.iam.get_paginator('list_users')
for page in paginator.paginate():
for user in page['Users']:
user_detail = {
'UserName': user['UserName'],
'UserId': user['UserId'],
'CreateDate': user['CreateDate'].isoformat(),
'Arn': user['Arn']
}
# Get user tags
tags_response = self.iam.list_user_tags(UserName=user['UserName'])
user_detail['Tags'] = tags_response.get('Tags', [])
# Get attached policies
policies = self.iam.list_attached_user_policies(UserName=user['UserName'])
user_detail['AttachedPolicies'] = [
p['PolicyArn'] for p in policies['AttachedPolicies']
]
# Get group memberships
groups = self.iam.list_groups_for_user(UserName=user['UserName'])
user_detail['Groups'] = [g['GroupName'] for g in groups['Groups']]
users.append(user_detail)
# Save to file
filename = f"{self.output_dir}/iam_users_inventory_{self.timestamp}.json"
with open(filename, 'w') as f:
json.dump(users, f, indent=2)
return users
def collect_credential_report(self):
"""Generate and collect credential report"""
print(" - Generating credential report...")
# Generate report (may take up to 4 hours for first generation)
self.iam.generate_credential_report()
# Get report
response = self.iam.get_credential_report()
report_csv = response['Content'].decode('utf-8')
# Save to file
filename = f"{self.output_dir}/iam_credential_report_{self.timestamp}.csv"
with open(filename, 'w') as f:
f.write(report_csv)
# Parse CSV for analysis
import io
reader = csv.DictReader(io.StringIO(report_csv))
credentials = list(reader)
return credentials
def collect_access_analyzer_findings(self):
"""Collect Access Analyzer findings for unused access"""
print(" - Collecting Access Analyzer findings...")
findings = []
# List analyzers
analyzers = self.accessanalyzer.list_analyzers()
for analyzer in analyzers['analyzers']:
# Get findings
paginator = self.accessanalyzer.get_paginator('list_findings')
for page in paginator.paginate(analyzerArn=analyzer['arn']):
findings.extend(page['findings'])
# Save to file
filename = f"{self.output_dir}/access_analyzer_findings_{self.timestamp}.json"
with open(filename, 'w') as f:
json.dump(findings, f, indent=2)
return findings
def collect_account_activity(self):
"""Collect CloudTrail events for account management"""
print(" - Collecting CloudTrail account activity...")
# Look back 90 days
end_time = datetime.now()
start_time = end_time - timedelta(days=90)
events = []
paginator = self.cloudtrail.get_paginator('lookup_events')
# Filter for IAM account management events
for page in paginator.paginate(
LookupAttributes=[
{'AttributeKey': 'ResourceType', 'AttributeValue': 'AWS::IAM::User'}
],
StartTime=start_time,
EndTime=end_time
):
events.extend(page['Events'])
# Save to file
filename = f"{self.output_dir}/cloudtrail_account_activity_{self.timestamp}.json"
with open(filename, 'w') as f:
json.dump(events, f, indent=2, default=str)
return events
def generate_access_review_report(self, users, credentials):
"""Generate quarterly access review report"""
print(" - Generating access review report...")
report = {
'review_date': datetime.now().isoformat(),
'total_users': len(users),
'inactive_users': [],
'privileged_users': [],
'compliance_issues': []
}
# Identify inactive users (90+ days)
for cred in credentials:
if cred['password_last_used'] != 'N/A':
last_used = datetime.fromisoformat(cred['password_last_used'].replace('Z', '+00:00'))
days_inactive = (datetime.now(last_used.tzinfo) - last_used).days
if days_inactive > 90:
report['inactive_users'].append({
'username': cred['user'],
'days_inactive': days_inactive,
'action_required': 'Disable or justify retention'
})
# Identify privileged users
for user in users:
for policy_arn in user.get('AttachedPolicies', []):
if 'AdministratorAccess' in policy_arn:
report['privileged_users'].append(user['UserName'])
# Compliance checks
if report['inactive_users']:
report['compliance_issues'].append({
'severity': 'HIGH',
'issue': f"{len(report['inactive_users'])} users inactive >90 days",
'requirement': 'PCI-DSS 8.1.4',
'action': 'Disable inactive accounts'
})
# Save to file
filename = f"{self.output_dir}/access_review_report_{self.timestamp}.json"
with open(filename, 'w') as f:
json.dump(report, f, indent=2)
return report
def save_evidence_manifest(self, evidence):
"""Save evidence collection manifest"""
filename = f"{self.output_dir}/evidence_manifest_{self.timestamp}.json"
with open(filename, 'w') as f:
json.dump(evidence, f, indent=2)
if __name__ == '__main__':
import os
import sys
output_dir = sys.argv[1] if len(sys.argv) > 1 else './evidence'
os.makedirs(output_dir, exist_ok=True)
collector = AccessControlEvidenceCollector(output_dir)
collector.collect_all_evidence()
docs/IMPLEMENTATION.md
# Implementation Guide: Access Control - Account Management
**Control ID:** access_control_account_management
**Category:** Access Control
**Generated:** 2025-01-15
## Framework Compliance
This implementation satisfies requirements from:
- **NIST 800-53**: AC-2 (Account Management), AC-2(1-4)
- **ISO 27001**: A.9.2.1, A.9.2.2, A.9.2.3, A.9.2.5
- **SOC 2**: CC6.1, CC6.2, CC6.3
- **PCI-DSS**: 8.1, 8.1.1, 8.1.3, 8.1.4
## Architecture
### Components
1. **IAM Account Lifecycle Module**
- Automated user provisioning/deprovisioning
- Least privilege enforcement via permissions boundaries
- Quarterly access reviews (90-day schedule)
2. **Access Analyzer**
- Continuous detection of unused access
- External access identification
- Policy validation
3. **CloudTrail Audit Logging**
- All account management events logged
- 1-year retention (6 months online, 6 months archived)
- Tamper-proof storage with S3 object lock
4. **Automated Access Reviews**
- Lambda function triggered quarterly
- Identifies inactive users (90+ days)
- Generates compliance reports
## Deployment
### Prerequisites
- AWS CLI configured with appropriate credentials
- Terraform >= 1.0
- Python 3.11+
### Steps
1. **Initialize Terraform**
```bash
cd terraform/
terraform init
-
Review Plan
terraform plan -out=tfplan -
Apply Configuration
terraform apply tfplan -
Deploy Lambda Functions
cd ../scripts/ ./deploy.sh -
Verify Deployment
python compliance_test.py
Configuration
Terraform Variables
Edit terraform/terraform.tfvars:
# Customize these values
access_review_schedule = "rate(90 days)" # PCI requirement
inactive_user_threshold_days = 90 # PCI 8.1.4
cloudtrail_retention_days = 365 # 1 year for SOC2/PCI
Conflict Resolutions
Access Review Frequency:
- SOC2: Risk-based (flexible)
- PCI-DSS: Quarterly (mandatory)
- NIST: Annually minimum
- Implementation: Quarterly (90 days) to satisfy PCI
Inactive Account Threshold:
- PCI-DSS: 90 days (mandatory)
- NIST: Organization-defined
- Implementation: 90 days to satisfy PCI
Evidence Collection
Run automated evidence collection:
python scripts/evidence_collect.py ./evidence/2025-Q1
Artifacts Generated:
- IAM user inventory
- Credential report
- Access Analyzer findings
- CloudTrail account activity
- Quarterly access review report
Compliance Testing
python scripts/compliance_test.py
Tests:
- ā Unique user IDs present
- ā Quarterly access reviews scheduled
- ā Inactive account detection enabled
- ā CloudTrail logging active
- ā Audit log retention = 365 days
Maintenance
Quarterly Tasks
- Review access review reports
- Disable/remove inactive accounts
- Validate Access Analyzer findings
- Update documentation
Annual Tasks
- Review and update IAM policies
- Validate permissions boundaries
- Update Terraform configurations
- Renew auditor attestations
Cost Estimate
- CloudTrail: ~$2/month
- S3 Storage (1 year): ~$5/month
- Lambda (quarterly): ~$0.20/month
- Access Analyzer: ~$0/month (free tier)
Total: ~$7.20/month
Support
For issues or questions:
- Review logs:
aws logs tail /aws/lambda/quarterly-access-review - Check CloudTrail: CloudWatch Insights
- Contact: security-team@example.com
## Generated Output Summary
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā IMPLEMENTATION GENERATED āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Control: Access Control - Account Management Cloud Provider: AWS Output Directory: ./generated
FILES CREATED:
terraform/ ā main.tf (300 lines) - Complete Terraform configuration ā variables.tf - Input variables ā outputs.tf - Output values ā providers.tf - AWS provider setup
scripts/ ā evidence_collect.py (250 lines) - Automated evidence collection ā compliance_test.py - Compliance testing ā deploy.sh - Deployment automation
docs/ ā IMPLEMENTATION.md - Complete implementation guide ā EVIDENCE.md - Evidence collection procedures ā FRAMEWORKS.md - Framework requirement mappings
FRAMEWORKS SATISFIED: ā NIST 800-53: AC-2, AC-2(1-4) ā ISO 27001: A.9.2.1, A.9.2.2, A.9.2.3, A.9.2.5 ā SOC 2: CC6.1, CC6.2, CC6.3 ā PCI-DSS: 8.1, 8.1.1, 8.1.3, 8.1.4
NEXT STEPS:
- Review generated code: cd ./generated
- Customize variables: edit terraform/terraform.tfvars
- Deploy: terraform init && terraform apply
- Collect evidence: python scripts/evidence_collect.py
- Run tests: python scripts/compliance_test.py
## Related Commands
- `/grc-engineer:map-controls-unified` - Understand cross-framework mappings
- `/grc-engineer:scan-iac` - Scan existing infrastructure
- `/grc-engineer:collect-evidence` - Manual evidence collection
- `/grc-engineer:optimize-multi-framework` - Optimization roadmap
Generate Interview Questions
Generates focused client interview questions from a technology stack, maps them to framework controls, and includes practical CLI/API evidence hints.
Arguments
$1- Technology stack or scope (required, in quotes)$2- Comma-separated frameworks (optional, defaults toSOC2,NIST-800-53)
Options
Pass options after the arguments:
--format=markdown|json- Output format (default:markdown)--limit=N- Maximum questions to emit (default:12)
Supported Framework Short Names
SOC2NISTorNIST-800-53ISOorISO-27001PCIorPCI-DSSCISCMMCFedRAMP
Instructions
-
Run the generator:
node plugins/grc-engineer/scripts/generate-interview-questions.js "$ARGUMENTS" -
Review each question with the mapped controls and evidence hints.
-
Ask for CLI/API exports where possible instead of screenshots.
-
Save the final question set in the assessment workpaper or interview agenda.
Examples
# AWS IAM user interview questions mapped to SOC 2, NIST, and PCI DSS
/grc-engineer:generate-interview-questions "AWS IAM users" SOC2,NIST-800-53,PCI-DSS
# JSON output for downstream tooling
/grc-engineer:generate-interview-questions "AWS S3, CloudTrail" FedRAMP,NIST --format=json
# Mixed stack with a shorter agenda
/grc-engineer:generate-interview-questions "Kubernetes RBAC and GitHub repositories" CIS,SOC2 --limit=5
Example Evidence Hint
For AWS IAM users, the generator prefers programmatic evidence such as:
aws iam list-users --query 'Users[*].[UserName,Arn,CreateDate]' --output table
This gives assessors a repeatable artifact with user names, ARNs, and creation dates instead of a manually captured screenshot.
Generate Policy
This prototype selects a fixed template only for exact supported phrases, not a reliable interpretation of arbitrary requirements. Output is a draft, not an enforceable policy. Independently review, adapt, and test it before any use. Templates may miss requirements or add unrelated checks; for example the S3 template always includes a Department tag check. No compliance coverage is inferred.
Arguments
- Requirement description (required, in quotes)
- Output format (optional, defaults to rego)
Available templates
Ensure no S3 buckets are public:rego,sentinel,aws-configAll EC2 instances must have encryption enabled:regoonly
Matching ignores case and surrounding or repeated whitespace; any other wording, extra clauses, or unsupported format combinations fail without generating files. Even semantically equivalent wording is rejected. Terraform and Checkov are not implemented.
Instructions
Parse $ARGUMENTS as a quoted requirement followed by an optional format.
Pass the actual requirement as the first CLI argument and the format, if supplied,
as the second. Preserve the entire requirement as one argument; do not
substitute an example or silently change either value. Pass arguments safely
without interpreting their contents as shell syntax. Omit the second argument
when no format was supplied so the script defaults to rego. If the requirement
is missing or the arguments are ambiguous, ask the user rather than guessing.
Propagate errors without producing a substitute draft.
For example, only for a request for this specific requirement and format:
node plugins/grc-engineer/scripts/generate-policy.js "Ensure no S3 buckets are public" rego
Inspect the draft and validate it against representative compliant and noncompliant inputs. Do not deploy it as-is.
Map Control
Maps infrastructure-as-code (IaC) files to specific compliance framework controls.
Arguments
$1- IaC file path (required)$2- Framework name (optional, defaults to SOC2)
Supported Frameworks
- SOC2
- ISO27001
- NIST80053
- PCIDSS
- HIPAA
- GDPR
- CMMC
- HITRUST
- CIS
- CSA-CCM
- NYDFS
- DORA
- STATERAMP
- ESSENTIAL8
- GLBA
Instructions
-
Run the map-control script:
node plugins/grc-engineer/scripts/map-control.js $ARGUMENTS -
The script analyzes the IaC file and generates a compliance mapping report.
-
Review the generated markdown report showing which controls are satisfied.
-
Use the report for audit documentation and compliance tracking.
Examples
# Map to SOC 2 controls
/grc-engineer:map-control main.tf SOC2
# Map to PCI-DSS requirements
/grc-engineer:map-control main.tf PCIDSS
# Map to ISO 27001 controls
/grc-engineer:map-control terraform/ ISO27001
# Map to NIST 800-53 controls
/grc-engineer:map-control infrastructure/ NIST80053
Map Controls Unified
Maps a single security control across ALL compliance frameworks to identify overlaps and optimization opportunities.
Usage
/grc-engineer:map-controls-unified <control-name-or-id>
Arguments
$1- Control name or ID (e.g., "access_control_account_management", "AC-2", "CC6.1", "encryption")
Examples
# Map by common name
/grc-engineer:map-controls-unified access_control_account_management
# Map by NIST control ID
/grc-engineer:map-controls-unified AC-2
# Map by SOC2 control ID
/grc-engineer:map-controls-unified CC6.1
# Map by search term
/grc-engineer:map-controls-unified encryption
Output
The command provides:
- Framework Mappings: Shows equivalent controls across all frameworks
- Common Requirements: Shared requirements across frameworks
- Conflicts: Identifies conflicting requirements and provides resolution
- Cloud Implementation: Multi-cloud implementation patterns (AWS, Azure, GCP, Kubernetes)
- Optimization Insight: Shows how many frameworks benefit from single implementation
Example Output
UNIFIED CONTROL MAPPING: Account Management
Category: Access Control
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
FRAMEWORK MAPPINGS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
NIST 800-53:
ā AC-2 - Account Management
ā AC-2(1) - Automated Account Management
ā AC-2(2) - Temporary/Emergency Accounts
ā AC-2(3) - Disable Inactive Accounts
ā AC-2(4) - Automated Audit Actions
ISO 27001:
ā A.9.2.1 - User Registration and De-registration
ā A.9.2.2 - User Access Provisioning
ā A.9.2.3 - Management of Privileged Access
ā A.9.2.5 - Review of User Access Rights
SOC 2:
ā CC6.1 - Logical and Physical Access Controls
ā CC6.2 - Prior to Issuing System Credentials
ā CC6.3 - Removes Access When Appropriate
PCI-DSS:
ā 8.1 - Identification and Authentication
ā 8.1.1 - Unique User IDs
ā 8.1.3 - Revoke Access for Terminated Users
ā 8.1.4 - Remove Inactive Accounts Every 90 Days
CIS Controls:
ā 5.1 - Inventory of Accounts
ā 5.2 - Use Unique Passwords
ā 5.3 - Disable Dormant Accounts
ā 6.1 - Establish Access Control Policy
ā 6.2 - Access Based on Need to Know
CMMC:
ā AC.L2-3.1.1 - Authorized Access Control
ā AC.L2-3.1.2 - Transaction and Function Control
ā IA.L2-3.5.1 - Identify Users
ā IA.L2-3.5.2 - Authenticate Users
FedRAMP:
ā AC-2 - NIST 800-53 Control
Baseline: Moderate
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
COMMON REQUIREMENTS (All Frameworks)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Unique user IDs for all individuals
ā Formal access request and approval process
ā Periodic access reviews (quarterly to annually)
ā Automated provisioning and de-provisioning
ā Separation of duties for privileged access
ā Audit trail of all account management actions
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
CONFLICTS DETECTED
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Access Review Frequency:
- SOC2: No specific frequency, risk-based approach
- PCI-DSS: Quarterly reviews required (every 90 days)
- NIST: Annually minimum, or when roles change
- ISO 27001: At planned intervals (typically annually)
ā RESOLUTION: Use quarterly (90 days) to satisfy
most restrictive requirement (PCI-DSS)
ā Inactive Account Detection:
- PCI-DSS: Remove/disable after 90 days
- NIST: Organization-defined time period
- SOC2: Risk-based determination
ā RESOLUTION: Use 90 days to satisfy PCI-DSS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
CLOUD IMPLEMENTATION PATTERNS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
AWS:
- IAM users with unique identifiers
- IAM Access Analyzer for unused access detection
- AWS IAM Identity Center (SSO) for federated access
- AWS Config rules for compliance monitoring
- CloudTrail for audit logging
- Lambda + EventBridge for automated lifecycle
Azure:
- Azure Active Directory users
- Azure AD Privileged Identity Management (PIM)
- Azure AD Access Reviews for periodic certification
- Azure Policy for compliance enforcement
- Azure Monitor for audit logging
- Logic Apps for automation
GCP:
- Cloud IAM users and service accounts
- Policy Analyzer for access analysis
- Workforce Identity Federation
- Organization Policy for constraints
- Cloud Logging for audit trails
- Cloud Functions for automation
Kubernetes:
- RBAC for role-based access control
- ServiceAccounts for workload identity
- Admission controllers for policy enforcement
- Audit logging enabled
- Automated RBAC reviews via scripts
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
OPTIMIZATION INSIGHT
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
šÆ TIER 1: Highest Value Implementation
Implement once, satisfies 7 frameworks simultaneously
Frameworks covered:
ā NIST 800-53 (5 controls)
ā ISO 27001 (4 controls)
ā SOC 2 (3 controls)
ā PCI-DSS (4 controls)
ā CIS Controls (5 controls)
ā CMMC (4 controls)
ā FedRAMP (1 control)
Total: 26 controls satisfied
Estimated effort: 40 hours
ROI: 650% (26 controls / 40 hours = 0.65 controls/hour)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
RECOMMENDED NEXT STEPS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
1. Review cloud implementation patterns above
2. Use /grc-engineer:generate-implementation to create code
3. Use /grc-engineer:scan-iac to validate existing infrastructure
4. Use /grc-engineer:test-control to verify implementation
Related Commands
/grc-engineer:find-conflicts- Identify conflicting requirements across frameworks/grc-engineer:optimize-multi-framework- Optimize implementation across multiple frameworks/grc-engineer:generate-implementation- Generate code for control implementation/grc-engineer:scan-iac- Scan infrastructure for compliance
Monitor Continuous
Runs a single pass of recurring compliance monitoring: orchestrates
/grc-engineer:gap-assessment, applies warn/critical thresholds per framework,
optionally chains /grc-engineer:record-automation-metrics, and emits a
structured JSON summary suitable for cron, GitHub Actions, Slack, email, or
PagerDuty.
Implementation: scripts/monitor-continuous.js.
Usage
/grc-engineer:monitor-continuous <frameworks> [options]
/grc-engineer:monitor-continuous --config=<path>
The host scheduler (cron, EventBridge, GitHub Actions) provides recurrence; this
command executes one monitoring pass per invocation. The schedule value is
recorded in the output summary so downstream dashboards can group runs by
cadence.
Arguments
<frameworks>- Comma-separated frameworks (e.g.SOC2,PCI-DSS,NIST-800-53). Required unless supplied via--config.
Options
--config=<path>- YAML or JSON config (see below). CLI flags override config values.--sources=<csv>- Connectors whose cached findings should feed the assessment.--schedule=<name>- Label only (daily,weekly,hourly). Recorded in output.--report-dir=<path>- Where gap-assessment writes its bundle (default:./monitor-continuous-<run_id>/).--output=<path>- Write the JSON summary to this path. stdout always gets it too.--warn-threshold=<0..1>- Per-framework pass-rate warning floor (default:0.90).--critical-threshold=<0..1>- Per-framework pass-rate critical floor (default:0.80).--record-metrics- After assessment, runrecord-automation-metrics.js.--metrics-config=<path>- Config for record-automation-metrics (implies--record-metrics).--window-label=<label>- Forwarded to record-automation-metrics.--cache-dir=<path>- Forwarded to gap-assessment (finding cache dir).--offline- Use the local SCF cache only (no network).--no-exit-code- Always exit 0 even on threshold breach.--quiet- Suppress stderr progress.--dry-run- Resolve config + print planned actions; no subprocess runs.
Examples
# Single pass over three frameworks using cached findings
node plugins/grc-engineer/scripts/monitor-continuous.js SOC2,PCI-DSS,NIST-800-53
# Daily monitoring driven by a config file
node plugins/grc-engineer/scripts/monitor-continuous.js \
--config=plugins/grc-engineer/examples/monitor-continuous.yaml
# Chain automation-metrics snapshot on the same run
node plugins/grc-engineer/scripts/monitor-continuous.js SOC2 \
--metrics-config=./automation-metrics.yaml --window-label=current-week
# Dry-run to validate config without spawning subprocesses
node plugins/grc-engineer/scripts/monitor-continuous.js \
--config=./monitor-continuous.yaml --dry-run
Exit codes
0- All frameworks at or above the warning threshold.2- At least one framework below the warning threshold.3- At least one framework below the critical threshold.1- Usage error or subprocess failure.
Set --no-exit-code to always exit 0 (for example, when a CI step must
continue running downstream notification steps regardless of status).
Config file
YAML or JSON. Example: examples/monitor-continuous.yaml.
frameworks: [SOC2, PCI-DSS, NIST-800-53]
schedule: daily
sources: [aws-inspector, github-inspector]
thresholds:
warning: 0.90
critical: 0.80
report_dir: ./monitor-reports
record_metrics:
enabled: true
config: ./automation-metrics.yaml
window_label: current-week
Output contract
stdout is a single JSON document. Downstream alerting tools (Slack, email,
PagerDuty) should key off summary.overall_status, alerts[], and
framework_results[].status.
{
"schema_version": "1.0.0",
"kind": "monitor_continuous_run",
"run_id": "20260424T140000-a1b2c3d4",
"generated_at": "2026-04-24T14:00:00Z",
"schedule": "daily",
"frameworks": ["SOC2", "PCI-DSS", "NIST-800-53"],
"sources": ["aws-inspector", "github-inspector"],
"thresholds": { "warning": 0.9, "critical": 0.8 },
"framework_results": [
{
"framework": "SOC2",
"evaluated": 50,
"passing": 49,
"failing": 1,
"inconclusive": 0,
"total_controls": 64,
"pass_rate": 0.98,
"pass_rate_pct": 98,
"coverage_pct": 78,
"status": "ok"
}
],
"summary": {
"overall_status": "warning",
"overall_pass_rate": 0.92,
"tier1_blockers": 3,
"tier2_findings": 7,
"tier3_recommendations": 4,
"passes": 118,
"inconclusive": 2
},
"alerts": [
{
"severity": "warning",
"framework": "PCI-DSS",
"pass_rate": 0.86,
"threshold": 0.9,
"message": "PCI-DSS pass rate 86.0% below warning floor 90%"
}
],
"artifacts": {
"gap_report_dir": "./monitor-reports",
"metrics": { "skipped": false, "failed": false }
},
"gap_assessment_summary": { "...": "pass-through from gap-assessment.js" }
}
What this command does not ship
By design, the runner is transport-agnostic. It does not POST to Slack, send email, or page on-call. Those steps live in the host scheduler (examples below), so the same run output can drive any combination of channels.
For trend analysis over time, consume the JSON output (or the grc-data/metrics/
snapshots written when record_metrics is enabled) with a reporting workflow
such as /report:exec-summary.
If you only need scheduled automation-history snapshots for the PR #54 reporting
flows, use the copy-pasteable GitHub Actions template at
examples/github-actions/automation-metrics-snapshot.yml.
Setup
1. Stage a config file
Copy plugins/grc-engineer/examples/monitor-continuous.yaml to your project
root and edit the framework list, thresholds, and optional
record_metrics.config pointer.
2. Schedule in your host
The runner itself is stateless; point a scheduler at it.
GitHub Actions:
# .github/workflows/compliance-monitor.yml
name: Continuous Compliance Monitoring
on:
schedule:
- cron: '0 2 * * *' # Daily at 02:00 UTC
workflow_dispatch:
jobs:
monitor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20 }
- run: npm ci
- name: Run monitor-continuous
run: |
node plugins/grc-engineer/scripts/monitor-continuous.js \
--config=./monitor-continuous.yaml \
--output=./monitor-result.json
continue-on-error: true
- name: Alert on threshold breach
if: always()
run: |
STATUS=$(jq -r '.summary.overall_status' monitor-result.json)
if [ "$STATUS" = "critical" ] || [ "$STATUS" = "warning" ]; then
jq '.alerts' monitor-result.json
exit 1
fi
Cron on a runner:
0 2 * * * cd /srv/grc && node plugins/grc-engineer/scripts/monitor-continuous.js \
--config=./monitor-continuous.yaml --output=./monitor-result.json
3. Wire alerts downstream
The runner emits JSON; wiring to channels is a CI concern. Example Slack step that only fires when the run crossed the warning threshold:
- uses: slackapi/slack-github-action@v1
if: failure()
with:
payload: |
{
"text": "Compliance alert: $(jq -r '.summary.overall_status' monitor-result.json)",
"attachments": $(jq '.alerts' monitor-result.json)
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
Roadmap (not in this runner yet)
These were part of the original /monitor-continuous spec and are tracked for
follow-up:
- 30-day trend analysis over
grc-data/metrics/history - Control-health degradation detection (per-control pass rates over time)
- Built-in Slack/email/PagerDuty HTTP calls
- Live compliance dashboard
- Auto-remediation hooks
Legacy reference output (pre-executable spec)
The example below was the narrative output described before the command had an executable runner. It is kept for reference while reporting workflows continue to build on this data. The actual runtime contract is the JSON shape above.
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
CONTINUOUS COMPLIANCE MONITORING
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Frameworks: SOC2, PCI-DSS, NIST 800-53
Schedule: Daily @ 02:00 UTC
Status: ACTIVE
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
COMPLIANCE TREND (Last 30 Days)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Jan 1: āāāāāāāāāāāāāāāāāāāāā 95% (142/150 controls)
Jan 8: āāāāāāāāāāāāāāāāāāāāā 94% (141/150 controls) ā -1%
Jan 15: āāāāāāāāāāāāāāāāāāāāā 94% (141/150 controls) ā Stable
Jan 22: āāāāāāāāāāāāāāāāāāāāā 96% (144/150 controls) ā +2%
Jan 28: āāāāāāāāāāāāāāāāāāāāā 96% (144/150 controls) ā Stable
Trend: ā IMPROVING (+1% this month)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
CURRENT STATUS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Overall Compliance: 96% (144/150 controls)
By Framework:
SOC2: 98% āāāāāāāāāāāāāāāāāāāāā (49/50)
PCI-DSS: 92% āāāāāāāāāāāāāāāāāāāāā (46/50)
NIST 800-53: 98% āāāāāāāāāāāāāāāāāāāāā (49/50)
By Status:
ā Effective: 144 controls (96%)
ā Partially Effective: 4 controls (3%)
ā Ineffective: 2 controls (1%)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
RECENT FAILURES (Last 7 Days)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š“ HIGH PRIORITY (1):
Jan 28: AU-11 (Audit Retention)
Status: FAILING (2 days)
Cause: S3 lifecycle policy misconfigured
Impact: Logs deleted after 60 days (should be 365)
Action: Fix S3 lifecycle policy
Frameworks: NIST, SOC2, PCI-DSS
š” MEDIUM PRIORITY (3):
Jan 25: AC-2 (Account Management)
Status: DEGRADED (was passing, now partial)
Cause: 3 inactive users detected >90 days
Impact: PCI-DSS 8.1.4 violation
Action: Disable inactive users
Jan 22: IA-5 (Password Policy)
Status: WARNING
Cause: 2 users with weak passwords detected
Impact: Best practice violation
Action: Enforce password complexity
... 1 more
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
CONTROL HEALTH
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š¢ HEALTHY (30-day pass rate >95%):
ā Access Control (AC-2): 100% (30/30)
ā Encryption (SC-28): 100% (30/30)
ā Logging (AU-2): 97% (29/30)
... 138 more
š” DEGRADING (pass rate declining):
ā Vulnerability Management (SI-2): 93% ā 87% (-6%)
Last 7 days: 3 failures
Trend: Declining
Action: Review patch management process
š“ AT RISK (pass rate <80%):
ā Audit Retention (AU-11): 73% (22/30)
Recent failures: 8 in last 10 days
Trend: Failing consistently
Action: URGENT - Fix S3 lifecycle configuration
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ALERTS SENT (Last 24 Hours)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
šØ CRITICAL (1):
22:15 - Audit retention control failed (AU-11)
ā Sent to: #security-alerts (Slack)
ā Sent to: security@company.com
ā WARNING (2):
14:30 - 3 inactive users detected
06:00 - Daily compliance summary (96%)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
SCHEDULED TESTS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Next run: 2025-01-29 02:00 UTC (in 3h 15m)
Test schedule:
02:00 - Full control test suite (all 150 controls)
06:00 - Daily summary report
14:00 - High-priority controls only
22:00 - High-priority controls only
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
CONFIGURATION
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Schedule: Daily @ 02:00 UTC
Alerts: Slack (#security-alerts), Email (security@company.com)
Retention: 90 days of test history
Dashboard: https://compliance.company.com/dashboard
Auto-remediation: Disabled (manual approval required)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
RECOMMENDATIONS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
1. Fix AU-11 S3 lifecycle policy (URGENT)
Command: /grc-engineer:scan-iac ./terraform PCI-DSS --fix
Estimated time: 15 minutes
2. Disable 3 inactive users
Command: python scripts/disable_inactive_users.py --execute
Estimated time: 10 minutes
3. Review vulnerability management process (SI-2 declining)
Action: Schedule patch management review with ops team
Estimated time: 2 hours
Related Commands
/grc-engineer:test-control- Test individual controls/grc-engineer:scan-iac- Scan infrastructure for violations/grc-engineer:collect-evidence- Collect compliance evidence/grc-engineer:record-automation-metrics- Persist weekly automation coverage history/grc-engineer:generate-implementation- Implement controls
Optimize Multi-Framework
Analyzes multiple compliance frameworks to identify "implement once, satisfy many" opportunities and provides an optimized implementation roadmap.
Usage
/grc-engineer:optimize-multi-framework <frameworks> [output-format]
Arguments
$1- Comma-separated list of frameworks (e.g., "SOC2,PCI-DSS,NIST,ISO")$2- Output format (optional): "roadmap", "matrix", "summary" (default: "roadmap")
Framework Codes
SOC2- SOC 2 Trust Service CriteriaNIST- NIST 800-53ISO- ISO 27001PCIorPCI-DSS- PCI DSS v4.0.1CIS- CIS Controls v8CMMC- CMMC 2.0FedRAMP- FedRAMP (uses NIST 800-53)HITRUST- HITRUST CSFGDPR- GDPRHIPAA- HIPAA
Examples
# Optimize for SOC2 + PCI-DSS
/grc-engineer:optimize-multi-framework SOC2,PCI-DSS
# Detailed roadmap for 4 frameworks
/grc-engineer:optimize-multi-framework SOC2,PCI-DSS,NIST,ISO roadmap
# Control implementation matrix
/grc-engineer:optimize-multi-framework SOC2,PCI-DSS,NIST matrix
# Quick summary
/grc-engineer:optimize-multi-framework SOC2,PCI-DSS,NIST summary
Output Formats
Roadmap (default)
Provides a phased implementation plan prioritized by ROI
Matrix
Shows control-by-control mapping across all frameworks
Summary
High-level statistics and optimization potential
Example Output (Roadmap Format)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
MULTI-FRAMEWORK OPTIMIZATION ANALYSIS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Target Frameworks: SOC2, PCI-DSS, NIST 800-53, ISO 27001
Analysis Date: 2025-01-15
FRAMEWORK DETAILS:
ā SOC 2: 68 applicable controls (Trust Service Criteria)
ā PCI-DSS: 329 requirements (v4.0.1)
ā NIST 800-53: 325 controls (Moderate baseline)
ā ISO 27001: 93 controls (Annex A)
Total Controls: 815 (if implemented separately)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
OPTIMIZATION RESULTS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Overlapping Controls Identified: 300 (83% of unique controls)
Unique Implementations Required: 362
Framework-Specific Controls: 62 (17%)
EFFORT REDUCTION:
ā Without Optimization: 815 controls Ć 8 hours = 6,520 hours
ā
With Optimization: 362 controls Ć 8 hours = 2,896 hours
š° SAVINGS: 3,624 hours (56% reduction)
~$543,600 at $150/hour
~18 person-months
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
TIER 1: IMPLEMENT ONCE, SATISFY 4 FRAMEWORKS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
87 controls in this tier (40% framework coverage)
Estimated effort: 696 hours (87 Ć 8 hours)
ROI: 4Ć (implement 1, satisfy 4)
Priority: HIGHEST - Start here for maximum impact
CONTROL #1: Access Control - Account Management
Satisfies:
ā NIST AC-2 (Account Management)
ā ISO A.9.2.1, A.9.2.2 (User access)
ā SOC2 CC6.1 (Logical access controls)
ā PCI 8.1 (User identification)
Implementation:
- AWS IAM with automated lifecycle
- Quarterly access reviews (90 days)
- Automated inactive user detection (90 days)
- Audit logging with CloudTrail
Effort: 40 hours
Value: 4 frameworks Ć 26 total controls = 104 control-implementations
Next steps:
/grc-engineer:generate-implementation access_control_account_management aws
CONTROL #2: Encryption at Rest
Satisfies:
ā NIST SC-28 (Protection of information at rest)
ā ISO A.10.1.1, A.10.1.2 (Cryptographic controls)
ā SOC2 CC6.7 (Encryption)
ā PCI 3.4, 3.5 (PAN encryption)
Implementation:
- AWS KMS customer-managed keys
- AES-256 encryption
- FIPS 140-2 Level 3 validation
- Automated key rotation (annual)
Effort: 24 hours
Value: 4 frameworks Ć 8 controls = 32 control-implementations
Next steps:
/grc-engineer:generate-implementation encryption_at_rest aws
CONTROL #3: Security Logging and Monitoring
Satisfies:
ā NIST AU-2, AU-3, AU-6, AU-11 (Audit logging)
ā ISO A.12.4.1-4 (Event logging)
ā SOC2 CC7.2, CC7.3 (System monitoring)
ā PCI 10.1-10.7 (Audit trails)
Implementation:
- CloudTrail (all regions, all accounts)
- VPC Flow Logs
- CloudWatch Logs aggregation
- 6 months online + 6 months archived (1 year total)
- S3 object lock for tamper-proofing
Effort: 60 hours
Value: 4 frameworks Ć 18 controls = 72 control-implementations
Next steps:
/grc-engineer:generate-implementation logging_and_monitoring aws
CONTROL #4: Vulnerability Management
Satisfies:
ā NIST RA-5, SI-2 (Vulnerability scanning, patching)
ā ISO A.12.6.1 (Technical vulnerabilities)
ā SOC2 CC7.1 (Anomaly detection)
ā PCI 5.2, 6.2, 11.3 (Anti-malware, patching, scanning)
Implementation:
- AWS Inspector for vulnerability scanning
- Systems Manager Patch Manager
- Monthly internal scans
- Quarterly external scans by ASV (PCI requirement)
- Critical patches: 15 days, High: 30 days
Effort: 80 hours
Value: 4 frameworks Ć 12 controls = 48 control-implementations
CONTROL #5: Network Security and Segmentation
Satisfies:
ā NIST SC-7 (Boundary protection)
ā ISO A.13.1.1-3 (Network controls, segregation)
ā SOC2 CC6.6 (Logical access)
ā PCI 1.2, 1.3 (Firewall configuration, segmentation)
Implementation:
- VPC with public/private subnets
- Security Groups (deny by default)
- Network ACLs for subnet-level filtering
- VPC Flow Logs for monitoring
- Semi-annual firewall rule reviews (PCI requirement)
Effort: 50 hours
Value: 4 frameworks Ć 15 controls = 60 control-implementations
... (82 more Tier 1 controls)
TIER 1 SUMMARY:
Controls: 87
Effort: 696 hours
Value: 348 control-implementations
ROI: 4.0Ć (implement once, satisfy 4 frameworks)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
TIER 2: IMPLEMENT ONCE, SATISFY 3 FRAMEWORKS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
124 controls in this tier (35% additional coverage)
Estimated effort: 992 hours (124 Ć 8 hours)
ROI: 3Ć (implement 1, satisfy 3)
Priority: HIGH - Implement after Tier 1
Examples:
ā Multi-factor Authentication (MFA)
- NIST IA-2(1), ISO A.9.4.2, PCI 8.3
- Effort: 32 hours
ā Change Management
- NIST CM-3, ISO A.12.1.2, SOC2 CC8.1
- Effort: 48 hours
ā Incident Response
- NIST IR-4, ISO A.16.1.1, SOC2 CC7.4
- Effort: 60 hours
... (121 more controls)
TIER 2 SUMMARY:
Controls: 124
Effort: 992 hours
Value: 372 control-implementations
ROI: 3.0Ć
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
TIER 3: IMPLEMENT ONCE, SATISFY 2 FRAMEWORKS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
89 controls in this tier (17% additional coverage)
Estimated effort: 712 hours (89 Ć 8 hours)
ROI: 2Ć (implement 1, satisfy 2)
Priority: MEDIUM - Implement after Tier 2
Examples:
ā Configuration Management
- NIST CM-2, ISO A.12.1.1
- Effort: 40 hours
ā Media Protection
- NIST MP-6, PCI 9.8
- Effort: 24 hours
... (87 more controls)
TIER 3 SUMMARY:
Controls: 89
Effort: 712 hours
Value: 178 control-implementations
ROI: 2.0Ć
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
TIER 4: FRAMEWORK-SPECIFIC CONTROLS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
62 controls in this tier (8% additional coverage)
Estimated effort: 496 hours (62 Ć 8 hours)
ROI: 1Ć (no overlap)
Priority: LOW - Implement only if framework required
PCI-DSS Specific (18 controls):
ā Quarterly ASV scans (Requirement 11.3.2)
ā Compensating controls documentation (12.3)
ā Service provider requirements (12.8)
ā PCI DSS Attestation of Compliance
... 14 more
SOC2 Specific (12 controls):
ā Vendor management for TSC
ā Service Organization Controls disclosure
ā Trust Services Criteria specific evidence
... 9 more
NIST Specific (15 controls):
ā Security authorization (CA-6)
ā System and Services Acquisition (SA family)
ā Planning controls (PL family)
... 12 more
ISO 27001 Specific (17 controls):
ā Management review of ISMS (9.3)
ā Internal audit of ISMS (9.2)
ā Context of the organization (4.1)
... 14 more
TIER 4 SUMMARY:
Controls: 62
Effort: 496 hours
Value: 62 control-implementations
ROI: 1.0Ć
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
RECOMMENDED IMPLEMENTATION ROADMAP
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
PHASE 1: Foundation (Weeks 1-8)
Focus: Tier 1 high-impact controls (top 20)
Effort: 400 hours
Coverage: 25% (all 4 frameworks)
Controls:
1. Account Management (40h)
2. Encryption at Rest (24h)
3. Logging and Monitoring (60h)
4. Vulnerability Management (80h)
5. Network Security (50h)
6. MFA Implementation (32h)
7. Backup and Recovery (40h)
8. Access Control Policies (24h)
... 12 more
PHASE 2: Core Security (Weeks 9-16)
Focus: Remaining Tier 1 + High-priority Tier 2
Effort: 800 hours
Coverage: 60% (all 4 frameworks)
Controls:
- Remaining 67 Tier 1 controls
- Top 40 Tier 2 controls
PHASE 3: Comprehensive (Weeks 17-24)
Focus: Tier 2 + Tier 3
Effort: 1,200 hours
Coverage: 92% (all 4 frameworks)
Controls:
- Remaining 84 Tier 2 controls
- All 89 Tier 3 controls
PHASE 4: Framework-Specific (Weeks 25-30)
Focus: Tier 4 only-if-needed controls
Effort: 496 hours
Coverage: 100% (all 4 frameworks)
Controls:
- 62 framework-specific requirements
TOTAL IMPLEMENTATION:
Duration: 30 weeks (~7.5 months)
Effort: 2,896 hours
Team size: 3-4 engineers
Cost: ~$434,400 at $150/hour
ALTERNATIVE (separate implementations):
Duration: 60+ weeks (~15 months)
Effort: 6,520 hours
Team size: 6-8 engineers
Cost: ~$978,000 at $150/hour
OPTIMIZATION BENEFIT:
š° Cost savings: $543,600 (56%)
ā± Time savings: 7.5 months
š„ Resource savings: 50% fewer engineers
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
QUICK WINS (Start This Week)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
These controls provide immediate value with minimal effort:
1. Enable CloudTrail (All Regions)
Effort: 2 hours
Satisfies: NIST AU-2, ISO A.12.4.1, SOC2 CC7.2, PCI 10.2
Command: /grc-engineer:generate-implementation cloudtrail_enable aws
2. Enable S3 Bucket Encryption
Effort: 4 hours
Satisfies: NIST SC-28, ISO A.10.1.1, SOC2 CC6.7, PCI 3.4
Command: /grc-engineer:generate-implementation s3_encryption aws
3. Enable MFA for Root Account
Effort: 1 hour
Satisfies: NIST IA-2(1), ISO A.9.4.2, SOC2 CC6.1, PCI 8.3
Command: /grc-engineer:generate-implementation root_mfa aws
4. Enable VPC Flow Logs
Effort: 2 hours
Satisfies: NIST AU-2, ISO A.12.4.1, SOC2 CC7.2, PCI 10.2
Command: /grc-engineer:generate-implementation vpc_flow_logs aws
5. Deploy AWS Config
Effort: 8 hours
Satisfies: NIST CM-2, ISO A.12.1.1, SOC2 CC8.1, PCI 2.4
Command: /grc-engineer:generate-implementation aws_config aws
QUICK WINS TOTAL:
Effort: 17 hours
Controls satisfied: 40+ across 4 frameworks
ROI: 235% (40 controls / 17 hours)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
NEXT STEPS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
1. Review and approve this optimization roadmap
2. Start with Quick Wins (17 hours, massive impact)
3. Begin Phase 1 Tier 1 implementations
4. Use these commands for each control:
/grc-engineer:map-controls-unified <control>
āā Understand cross-framework mappings
/grc-engineer:generate-implementation <control> <cloud>
āā Generate Terraform, scripts, docs
/grc-engineer:scan-iac <directory> <frameworks>
āā Validate current state
/grc-engineer:test-control <control>
āā Verify implementation
5. Track progress with compliance dashboard
6. Document resolutions for auditors
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
FRAMEWORK COVERAGE BY PHASE
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
After Phase 1 (8 weeks):
SOC2: 25% āāāāāāāāāāāāāāāāāāāāāāāā
PCI-DSS: 25% āāāāāāāāāāāāāāāāāāāāāāāā
NIST: 25% āāāāāāāāāāāāāāāāāāāāāāāā
ISO: 25% āāāāāāāāāāāāāāāāāāāāāāāā
After Phase 2 (16 weeks):
SOC2: 60% āāāāāāāāāāāāāāāāāāāāāāāā
PCI-DSS: 60% āāāāāāāāāāāāāāāāāāāāāāāā
NIST: 60% āāāāāāāāāāāāāāāāāāāāāāāā
ISO: 60% āāāāāāāāāāāāāāāāāāāāāāāā
After Phase 3 (24 weeks):
SOC2: 95% āāāāāāāāāāāāāāāāāāāāāāāā
PCI-DSS: 92% āāāāāāāāāāāāāāāāāāāāāāāā
NIST: 90% āāāāāāāāāāāāāāāāāāāāāāāā
ISO: 93% āāāāāāāāāāāāāāāāāāāāāāāā
After Phase 4 (30 weeks):
SOC2: 100% āāāāāāāāāāāāāāāāāāāāāāāā
PCI-DSS: 100% āāāāāāāāāāāāāāāāāāāāāāāā
NIST: 100% āāāāāāāāāāāāāāāāāāāāāāāā
ISO: 100% āāāāāāāāāāāāāāāāāāāāāāāā
Matrix Format Output
/grc-engineer:optimize-multi-framework SOC2,PCI-DSS,NIST,ISO matrix
Produces a spreadsheet-style control mapping matrix (CSV format).
Summary Format Output
/grc-engineer:optimize-multi-framework SOC2,PCI-DSS,NIST,ISO summary
Multi-Framework Optimization Summary
Frameworks: SOC2, PCI-DSS, NIST 800-53, ISO 27001
Total Controls (separate): 815
Optimized Controls: 362
Reduction: 56%
Effort Savings: 3,624 hours ($543,600)
Time Savings: 7.5 months
Tier 1 (4 frameworks): 87 controls (40% coverage)
Tier 2 (3 frameworks): 124 controls (75% cumulative)
Tier 3 (2 frameworks): 89 controls (92% cumulative)
Tier 4 (1 framework): 62 controls (100% cumulative)
Quick Wins Available: 5 controls, 17 hours, 40+ control-implementations
Recommended: Start with Tier 1 for maximum ROI
Related Commands
/grc-engineer:map-controls-unified- Map individual controls across frameworks/grc-engineer:find-conflicts- Identify conflicting requirements/grc-engineer:generate-implementation- Generate code for controls/grc-engineer:scan-iac- Scan infrastructure for compliance
/grc-engineer:pipeline-status
Reports on every connector registered in ~/.config/claude-grc/connectors/. One block per connector with: status, auth validity, last-run timestamp, cached resource/evaluation counts, and any stale/expired signals.
How to run
bash plugins/grc-engineer/scripts/pipeline-status.sh
Output
CLAUDE-GRC PIPELINE STATUS (2026-04-13 15:04 UTC)
github-inspector
status: ready
auth: valid (octocat, scopes: repo,read:org)
last run: 3h ago
cached: 127 resources, 512 evaluations
rate limit: 4872/5000 remaining
aws-inspector
status: credentials-expired
fix: aws sso login --profile=audit
last run: 17h ago (stale)
cached: 24 resources, 87 evaluations
okta-inspector
status: not-configured
fix: /okta-inspector:setup
SCF
version: 2026.1
cache age: 2d (refresh in 5d)
Aggregate
configured: 3 connectors
healthy: 1 / 3
cached total: 151 resources, 599 evaluations
oldest cache: 17h (aws-inspector)
Status semantics
readyā configured, auth valid, runs availablecredentials-expiredā configured but the tool rejected auth at check timenot-configuredā config file doesn't existstaleā last run > 7 days agono-cacheā configured but never run
Exit codes
0ā every connector isready(possiblystale)2ā at least one connector iscredentials-expiredornot-configured
Plan evidence transfer
Prepare a plan, not a package or transmission. This is an initial manual workflow toward secure evidence packaging, not an encryption or delivery implementation.
Arguments
$ARGUMENTS- Intended recipient and purpose, classification, approximate size, and approved delivery constraints. Use generic descriptions; do not paste evidence, secrets, credentials, private keys, access tokens, or personal data into the conversation.
Instructions
- Ask for missing information: authorized recipient and independent verification contact, permitted classification and approved transfer method, retention/deletion requirements, and whether signing is required. Do not assume that a portal or email is approved.
- Produce an inventory template containing only artifact identifiers/descriptions, owner, classification, intended recipient, and retention date. Explain that names, paths, metadata, hashes, and even the inventory can be sensitive. The evidence owner must select the minimum necessary artifacts and review them for secrets and third-party data before inclusion; this workflow does not scan or redact them.
- Recommend use of an organization-approved, access-controlled workstation and private encrypted staging location. Avoid shared temporary directories, repositories, chat transcripts and logs. Review file permissions, symlinks, unexpected files and archive paths before packaging; do not follow links into unrelated locations. A normal archive is not encrypted. Archive metadata may reveal sensitive information.
- If asymmetric encryption is approved, have the recipient provide a supported public key and verify its full fingerprint out of band with a known contact before use. Determine approved signing keys and fingerprint verification separately. Use the organization's supported GnuPG/PGP implementation and documented key-management procedures; never invent cryptography or request a private key, passphrase or recovery code. A public key in an unverified email is not sufficient. 1Password CLI is not treated as an encryption format.
- Within the approved secure workspace, the operator can create a manifest of selected files and their SHA-256 digests, then package the reviewed files and manifest using approved tooling. Have an authorized operator sign the manifest or package when required and encrypt the archive to the independently verified recipient key(s). Confirm signer and recipient fingerprints and verify the output with the organization's documented tools before release. Hashes alone do not authenticate the sender; the recipient must validate the signature using a separately verified signing key and check the file digests after safe extraction.
- Obtain explicit human approval of the recipient, contents and delivery channel before any transfer. A human uses the approved portal or transfer tool; do not upload, email, publish links, change permissions or contact recipients automatically. Record the transfer reference, time, recipient identity, key fingerprints, package digest and approval in the approved restricted audit system, without credentials, evidence content or secret-bearing links. Confirm receipt and signature/checksum verification through an agreed channel.
- Apply the organization's retention and cleanup policy to staging files and keys. Do not promise secure deletion: backups, snapshots, SSDs and synchronized folders can retain copies. Record exceptions and failed verification; do not release a failed package.
Local packaging (optional)
The operator may use the experimental local CLI below after completing the planning and key verification steps above. Run it directly on a trusted, access-controlled machine, not through a chat containing evidence or credentials. Import the recipient's public key into the operator's GnuPG keyring first and independently verify the full primary key fingerprint. The CLI deliberately uses GnuPG's --trust-model always only after requiring that exact fingerprint; it cannot verify the recipient's identity for you.
python3 plugins/grc-engineer/scripts/package-evidence.py /private/reviewed-evidence /private/output/evidence.zip.gpg FULL_PRIMARY_KEY_FINGERPRINT
The source must be a stable, trusted directory, not writable by other users or processes during packaging. The output must not already exist or be within the source. The command stores regular files in a ZIP, includes a SHA-256 JSON manifest inside it, and encrypts to one GnuPG recipient. It refuses symlinks and special files; empty directories are omitted. ZIP timestamps use local time with two-second precision: dates before 1980 are clamped to 1980-01-01 00:00:00 and dates after 2107 to 2107-12-31 23:59:58 rather than preserved. Permission bits are stored where supported, but other metadata is not. File contents and the archive are held in memory, so use only for reasonably sized evidence. It creates no plaintext archive on disk, but memory, swap, crash dumps and backups can expose plaintext. The output digest is printed for the operator's restricted audit record. File names, metadata, hashes and manifest can be sensitive.
Before encryption the packager runs the offline verifier against its in-memory ZIP. It refuses unsafe archive paths and archives exceeding the verifier's limits, including the manifest; no output is created on verification failure. The check runs only after the ZIP is constructed in memory, so these limits do not prevent excessive memory use during packaging. This adds an internal consistency check, not sender authentication. Use a trusted, stable output parent directory, not writable by untrusted users: output creation is exclusive but publication is not atomic and an observer may see a partial file during writing.
This initial CLI does not sign the manifest or authenticate the sender, verify recipient identity, scan or redact secrets, transmit files, create an audit trail, integrate with 1Password, or provide tar.gz, multi-recipient or portal support. A hash obtained over the same untrusted channel is not proof of authenticity. Use an independently verified signer and the organization's approved signature and delivery procedures; do not treat this command as completing those steps. The recipient must authenticate the sender, decrypt in a private workspace, safely inspect archive paths before extraction, and compare extracted files against the manifest. Do not release if verification fails. Do not use where signatures are required until a separately approved signing workflow is completed.
Offline manifest verification (optional)
After GnuPG reports successful decryption to a private, access-controlled ZIP file, the recipient can check the archive without extracting it:
python3 plugins/grc-engineer/scripts/verify-evidence.py /private/workspace/decrypted.zip
Use only a completed, successfully decrypted input: do not pipe unauthenticated or partially decrypted output into this check, and discard failed GnuPG output. The verifier requires the packaging CLI's exact manifest format, checks every regular file's SHA-256 and size, rejects missing, extra, duplicate and unsafe paths, and extracts nothing. It accepts at most 10,000 entries and 100 MiB total uncompressed data, including a manifest of at most 4 MiB. It is intended for the trusted host and stable input described above, not as a sandbox for hostile archives. Successful verification establishes internal consistency only: anyone with the public encryption key can create a new encrypted package with matching hashes. GnuPG encryption and its integrity protection do not identify the sender. Independently authenticate the sender and verify an approved signature using a separately verified signing key; this verifier performs neither operation. Before any extraction, continue to use an approved safe extraction procedure in a private workspace, and apply retention and cleanup policy to the plaintext ZIP.
The verifier supports only stored and deflated ZIP entries; other compression methods are rejected. Its limits apply to bytes actually decompressed, not just ZIP size fields.
Output
Return a concise checklist with known inputs, open questions, owner approvals, planned verification and delivery, and limitations. Never claim that anything was packaged, encrypted, signed, delivered, or verified unless an authorized operator actually performed and confirmed that action. This command does not itself create manifests, archives, signatures, logs or encrypted bundles and does not integrate with 1Password, SFTP or auditor portals.
Record Automation Metrics
Writes reporting-friendly automation metric rows into ./grc-data/metrics/ so
/report:automation-coverage has real historical snapshots to compare.
The command always writes these metric IDs:
automation.coverage_pctautomation.controls_automatedautomation.controls_manualautomation.controls_total
Use it in one of three modes:
- Derived mode for
fedramp-low,fedramp-moderate,fedramp-high, orfedramp-20x-ksi, where the toolkit can count automated controls from the evidence collector config. This is a tooling-capability baseline, not proof that your program is already running every automation in production. - Manual mode for any framework alias, where you provide the total and automated counts directly. Use this for operator-observed reporting.
- Framework metadata total mode for framework plugins that publish
framework_metadata.framework_controls_mapped, where you provide only the operator-observed automated count and the command derives the total. - Batch mode with
--config=<path>, where a scheduler can write multiple framework snapshots in one run.
Metric rows follow docs/GRC-DATA.md and
schemas/metric.schema.json.
Usage
/grc-engineer:record-automation-metrics <framework> [provider] [options]
Arguments
$1- Framework alias or FedRAMP scope$2- Provider in derived mode (optional, defaults toaws)
Common options
--controls-total=<n>- Required for manual mode unless paired with--controls-manual--controls-automated=<n>- Required for manual mode--controls-manual=<n>- Optional manual count override--from-framework-metadata- Derivecontrols_totalfrom the framework plugin manifest, leavingcontrols_automatedoperator-observed--recorded-at=<iso8601>- Observation timestamp (defaults to now)--window-start=<iso8601>- Optional reporting window start--window-end=<iso8601>- Optional reporting window end--window-label=<label>- Optional period label like2026-W16orcurrent-week--dimension=<key=value>- Extra dimensions; may be repeated--source=<string>- Optional provenance override--out-dir=<path>- Override./grc-data/metrics/--config=<path>- YAML or JSON config for batch mode--dry-run- Print rows instead of writing files
Instructions
-
Run the writer directly:
node plugins/grc-engineer/scripts/record-automation-metrics.js "$ARGUMENTS"For batch mode, point it at the example config:
node plugins/grc-engineer/scripts/record-automation-metrics.js \ --config=plugins/grc-engineer/examples/automation-metrics.yaml \ --window-label=current-week -
Commit the generated files under
./grc-data/metrics/, or let your CI job publish them into the repo on a schedule. -
Rerun
/report:automation-coverageafter you have at least two snapshots seven or more days apart.
Examples
# Derive coverage for FedRAMP Moderate on AWS
/grc-engineer:record-automation-metrics fedramp-moderate aws --window-label=2026-W16
# Derive coverage for FedRAMP 20x on GCP
/grc-engineer:record-automation-metrics fedramp-20x-ksi gcp --window-label=2026-W16
# Record an operator-observed SOC 2 snapshot
/grc-engineer:record-automation-metrics soc2 --controls-total=64 --controls-automated=22 --window-label=2026-W16
# Derive the total from SOC 2 plugin metadata, but keep the automated count observed
/grc-engineer:record-automation-metrics soc2 --controls-automated=22 --from-framework-metadata --window-label=2026-W16
# Add an extra business-unit dimension
/grc-engineer:record-automation-metrics iso27001 --controls-total=93 --controls-automated=40 --dimension=business_unit=platform --window-label=2026-W16
# Write multiple snapshots from a config file
/grc-engineer:record-automation-metrics --config=plugins/grc-engineer/examples/automation-metrics.yaml --window-label=current-week
Review PR
Reviews GitHub pull requests for compliance regressions and security issues.
Arguments
$1- Repository (required, format: owner/repo)$2- PR number (required)$3- Framework (optional, defaults to SOC2)
Prerequisites
GITHUB_TOKENenvironment variable (requiresreposcope)
Instructions
-
Set up GitHub token:
export GITHUB_TOKEN=your_token_here -
Run the review-pr script:
node plugins/grc-engineer/scripts/review-pr.js $ARGUMENTS -
The script analyzes the PR diff and generates compliance review comments.
-
Review the generated comments and post them to the PR if needed.
Example
/grc-engineer:review-pr myorg/infrastructure 42 SOC2
Scaffold Framework Plugin
Generates a new framework plugin directory under plugins/frameworks/<slug>/ from templates, filling in framework metadata from the SCF crosswalk ({{SCF_FRAMEWORK_ID}} ā 249 possible frameworks).
Turns the usual half-day of hand-authoring plugin.json + SKILL.md + commands/*.md + README.md + marketplace registration into a one-command operation. The output is intentionally a starting point, not a finished plugin ā you add the framework-specific expertise (TODO: markers throughout the templates point at what to fill in).
Usage
/grc-engineer:scaffold-framework <scf-framework-id-or-label> [options]
Arguments
| Argument | Required | Notes |
|---|---|---|
<scf-framework-id-or-label> | yes | Either the raw SCF ID (e.g. apac-sgp-pdpa-2012) or a human label ("Singapore PDPA", "Brazil LGPD"). The script resolves aliases via scf-client.js. |
--depth=stub|reference | optional | Template depth. Default stub. Full-depth plugins are authored manually ā Full isn't scaffolded because the framework-specific workflow commands are the whole point. |
--slug=<name> | optional | Override the auto-derived plugin directory name. Default strips the SCF region prefix and year suffix (americas-bra-lgpd-2018 ā bra-lgpd). |
--no-register | optional | Skip writing to .claude-plugin/marketplace.json. Useful when preparing changes to stage manually. |
--force | optional | Overwrite an existing plugin directory. Used for idempotent re-scaffolding. |
--offline | optional | Use cached SCF data only (no network). Fails if cache misses. |
--dry-run | optional | Print the actions that would be taken; don't touch the filesystem. |
What gets created
Stub depth (default)
plugins/frameworks/<slug>/
āāā .claude-plugin/plugin.json # Plugin metadata + framework_metadata block
āāā commands/assess.md # Routes to /grc-engineer:gap-assessment
āāā skills/<slug>-expert/SKILL.md # Framework identity + TODO sections
āāā README.md # Install + level-up instructions
Plus a new entry in .claude-plugin/marketplace.json (unless --no-register).
Reference depth
Stub, plus:
plugins/frameworks/<slug>/
āāā commands/scope.md # Applicability determination
āāā commands/evidence-checklist.md # Evidence baseline by control family
āāā skills/... # Richer SKILL.md with TODO scaffolding
Full depth (framework-specific workflow commands, persona-specific UX) is not auto-scaffolded ā add those commands manually when promoting a Reference plugin to Full.
Examples
# Stub scaffold from SCF ID
node plugins/grc-engineer/scripts/scaffold-framework.js apac-sgp-pdpa-2012
# Reference depth with a custom slug
node plugins/grc-engineer/scripts/scaffold-framework.js "Singapore PDPA" \
--depth=reference --slug=singapore-pdpa
# Preview without writing
node plugins/grc-engineer/scripts/scaffold-framework.js americas-bra-lgpd-2018 --dry-run
# Staging workflow: scaffold files but skip marketplace.json until human review
node plugins/grc-engineer/scripts/scaffold-framework.js emea-che-fadp-2023 --no-register
Error modes
- Unknown SCF ID / label ā exits with code 2, lists the 5 closest matches.
- Plugin directory already exists ā exits with code 3 unless
--forceis passed. - Offline + cache miss ā exits with a clear message pointing at
~/.cache/claude-grc/scf/. - Invalid slug ā exits with code 1; slug must match
^[a-z][a-z0-9-]*$.
Data provenance
Framework metadata (display name, region, country, SCF control counts) comes from the SCF API (api/crosswalks.json and per-framework api/crosswalks/<id>.json). Cached locally under ~/.cache/claude-grc/scf/<version>/ per CC BY-ND 4.0 terms ā cached data is redistributed verbatim, never modified.
See docs/SCF-ATTRIBUTION.md for licensing detail.
Next steps after scaffolding
- Edit
skills/<slug>-expert/SKILL.mdā fill in theTODO:sections with framework-specific context. - At Reference depth, edit
commands/assess.md,commands/scope.md,commands/evidence-checklist.mdfor framework-specific guidance. - Commit. Markdown lint + CODEOWNERS review run on every PR.
- Claim the matching issue in the framework coverage tracker.
Scan IaC
Scans Infrastructure as Code (Terraform, CloudFormation, Kubernetes) for compliance violations and provides automated remediation suggestions.
Usage
/grc-engineer:scan-iac <directory> <frameworks> [options]
Arguments
$1- Directory to scan (e.g.,./terraform,./k8s)$2- Comma-separated frameworks (e.g.,SOC2,PCI-DSS,NIST)$3- Output format (optional):detailed,summary,json,sarif(default:detailed)$4- Options (optional):--fix,--severity=high,--exclude=test/
Supported IaC Formats
- Terraform (
.tffiles) - CloudFormation (
.yaml,.jsontemplates) - Kubernetes (
.yamlmanifests) - Azure ARM (
.jsontemplates) - Pulumi (
.yamlstack files)
Examples
# Scan Terraform directory for multiple frameworks
/grc-engineer:scan-iac ./terraform SOC2,PCI-DSS,NIST detailed
# Quick summary scan
/grc-engineer:scan-iac ./infrastructure ISO,GDPR summary
# Scan with auto-fix
/grc-engineer:scan-iac ./terraform PCI-DSS detailed --fix
# High severity issues only
/grc-engineer:scan-iac ./k8s SOC2,NIST summary --severity=high
# Export SARIF for CI/CD integration
/grc-engineer:scan-iac ./terraform SOC2,PCI-DSS sarif
Output Format
Detailed Mode
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
IAC COMPLIANCE SCAN RESULTS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Scan Target: ./terraform
Frameworks: SOC2, PCI-DSS, NIST 800-53
Files Scanned: 23 (15 .tf, 5 .yaml, 3 .json)
Scan Duration: 4.2s
SUMMARY:
ā Satisfied: 42 controls (73%)
ā Violations: 8 controls (14%)
ā Partial: 7 controls (12%)
ā¹ Recommendations: 12
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
VIOLATIONS (8)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š“ HIGH SEVERITY (3)
[1] Encryption at Rest - Missing S3 Bucket Encryption
Frameworks: SOC2 CC6.7, PCI-DSS 3.4, NIST SC-28
File: terraform/s3_buckets.tf:12
Resource: aws_s3_bucket.data
Issue:
S3 bucket does not have server-side encryption enabled.
This violates encryption at rest requirements for all
three frameworks.
Current Configuration:
```hcl
resource "aws_s3_bucket" "data" {
bucket = "customer-data-bucket"
# Missing encryption configuration
}
```
ā Remediation:
Add server-side encryption configuration:
```hcl
resource "aws_s3_bucket" "data" {
bucket = "customer-data-bucket"
# Required for SOC2 CC6.7, PCI 3.4, NIST SC-28
server_side_encryption_configuration {
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256" # or "aws:kms" for PCI
}
}
}
}
```
Auto-fix available: Run with --fix flag
[2] Audit Logging - CloudTrail Retention Too Short
Frameworks: SOC2 CC7.3, PCI-DSS 10.7, NIST AU-11
File: terraform/cloudtrail.tf:8
Resource: aws_cloudtrail.audit
Issue:
CloudTrail log retention is set to 90 days, but PCI-DSS
requires 1 year minimum (365 days).
Current Configuration:
```hcl
resource "aws_cloudtrail" "audit" {
name = "audit-trail"
s3_bucket_name = aws_s3_bucket.logs.id
# Retention too short
event_selector {
...
}
}
resource "aws_s3_bucket_lifecycle_configuration" "logs" {
rule {
expiration {
days = 90 # ā TOO SHORT
}
}
}
```
ā Remediation:
Update lifecycle rule to 365 days:
```hcl
resource "aws_s3_bucket_lifecycle_configuration" "logs" {
bucket = aws_s3_bucket.logs.id
rule {
id = "retention"
status = "Enabled"
# Keep online for 6 months
transition {
days = 180
storage_class = "GLACIER"
}
# Total retention: 1 year (PCI/SOC2 requirement)
expiration {
days = 365 # ā COMPLIANT
}
}
}
```
[3] Network Security - Security Group Too Permissive
Frameworks: PCI-DSS 1.2, NIST SC-7, SOC2 CC6.6
File: terraform/security_groups.tf:24
Resource: aws_security_group.web
Issue:
Security group allows unrestricted SSH access (0.0.0.0/0:22).
Violates least privilege and network segmentation requirements.
Current Configuration:
```hcl
resource "aws_security_group" "web" {
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"] # ā TOO PERMISSIVE
}
}
```
ā Remediation:
Restrict SSH to specific IP ranges:
```hcl
resource "aws_security_group" "web" {
ingress {
description = "SSH from corporate VPN only"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["10.0.0.0/8"] # ā RESTRICTED
}
}
```
Or remove SSH entirely and use AWS Systems Manager Session Manager.
š” MEDIUM SEVERITY (5)
[4] Vulnerability Management - Missing Patch Management
Frameworks: NIST SI-2, PCI-DSS 6.2
File: terraform/ec2_instances.tf:45
Issue: No AWS Systems Manager Patch Manager configuration detected.
ā Remediation:
Add patch baseline and maintenance window:
```hcl
resource "aws_ssm_patch_baseline" "compliance" {
name = "compliance-baseline"
operating_system = "AMAZON_LINUX_2"
approval_rule {
approve_after_days = 7
compliance_level = "CRITICAL"
patch_filter {
key = "CLASSIFICATION"
values = ["Security"]
}
}
}
resource "aws_ssm_maintenance_window" "patching" {
name = "critical-patching"
schedule = "cron(0 2 ? * SUN *)" # Weekly
duration = 3
cutoff = 1
}
```
[5] Access Control - Missing MFA for Root Account
Frameworks: NIST IA-2(1), PCI-DSS 8.3, SOC2 CC6.1
Issue: No evidence of MFA enforcement for root account.
ā Remediation:
Enable MFA manually (cannot be automated via Terraform):
1. Log in to AWS Console as root
2. Navigate to IAM > Security Credentials
3. Activate MFA
Verify with:
```bash
aws iam get-account-summary | jq '.SummaryMap.AccountMFAEnabled'
```
... (3 more medium severity violations)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
PARTIAL COMPLIANCE (7)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā [8] Encryption at Rest - KMS Rotation Not Enabled
Frameworks: NIST SC-12, PCI-DSS 3.6
File: terraform/kms.tf:5
Status: Partial
Current: KMS key exists but rotation disabled
Required: Annual key rotation enabled
ā Fix:
```hcl
resource "aws_kms_key" "compliance" {
description = "Compliance encryption key"
enable_key_rotation = true # ā Add this
}
... (6 more partial compliance issues)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā SATISFIED CONTROLS (42) āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā SOC2 CC6.1 - IAM users configured with unique IDs ā PCI-DSS 8.1.1 - Unique user IDs enforced ā NIST AC-2 - Account management automated ā SOC2 CC7.2 - CloudWatch Logs enabled ā PCI-DSS 10.2 - Audit trails configured ā NIST SC-7 - VPC boundary protection in place ā SOC2 CC6.6 - Network segmentation implemented ... (35 more)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā RECOMMENDATIONS (12) āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā¹ Consider enabling AWS Config for continuous compliance monitoring ā¹ Add AWS GuardDuty for threat detection (SOC2 CC7.1) ā¹ Implement AWS Security Hub for centralized findings ā¹ Enable VPC Flow Logs for network monitoring (NIST AU-2) ā¹ Add resource tagging for better compliance tracking ... (7 more)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā COMPLIANCE SCORE āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Overall: 73% āāāāāāāāāāāāāāāāāāāāāāāāāā
By Framework: SOC2: 78% āāāāāāāāāāāāāāāāāāāāāāāā PCI-DSS: 65% āāāāāāāāāāāāāāāāāāāāāāāā NIST 800-53: 76% āāāāāāāāāāāāāāāāāāāāāāā
Critical Issues: 3 (MUST FIX for compliance) High Priority: 5 (SHOULD FIX before audit) Medium Priority: 7 (GOOD TO FIX)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā NEXT STEPS āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
-
Fix critical issues (3):
- Add S3 bucket encryption
- Extend CloudTrail retention to 365 days
- Restrict security group rules
-
Apply automated fixes: /grc-engineer:scan-iac ./terraform SOC2,PCI-DSS,NIST detailed --fix
-
Validate fixes: /grc-engineer:scan-iac ./terraform SOC2,PCI-DSS,NIST summary
-
Generate compliance report: /grc-engineer:scan-iac ./terraform SOC2,PCI-DSS,NIST json > report.json
-
Collect evidence after remediation: /grc-engineer:collect-evidence
### Summary Mode
IaC Compliance Scan: ./terraform Frameworks: SOC2, PCI-DSS, NIST 800-53
Compliance: 73% (42/57 controls)
Issues: š“ High: 3 (CRITICAL) š” Medium: 5 ā Partial: 7 ā Passing: 42
Top Issues:
- S3 encryption missing (affects 3 frameworks)
- Log retention too short (PCI-DSS violation)
- Security groups too permissive (network security)
Run with 'detailed' for full analysis.
### JSON Output (for CI/CD)
```json
{
"scan_timestamp": "2025-01-15T10:30:00Z",
"directory": "./terraform",
"frameworks": ["SOC2", "PCI-DSS", "NIST-800-53"],
"summary": {
"total_controls": 57,
"satisfied": 42,
"violations": 8,
"partial": 7,
"compliance_percentage": 73
},
"violations": [
{
"id": "V001",
"severity": "HIGH",
"control": "encryption_at_rest",
"frameworks": ["SOC2 CC6.7", "PCI-DSS 3.4", "NIST SC-28"],
"file": "terraform/s3_buckets.tf",
"line": 12,
"resource": "aws_s3_bucket.data",
"issue": "S3 bucket missing server-side encryption",
"remediation": {
"description": "Add server-side encryption configuration",
"code": "...",
"auto_fixable": true
}
}
],
"recommendations": [...],
"compliance_by_framework": {
"SOC2": 0.78,
"PCI-DSS": 0.65,
"NIST-800-53": 0.76
}
}
SARIF Output (for GitHub Security)
Outputs SARIF 2.1.0 format compatible with:
- GitHub Security tab
- GitLab Security Dashboard
- Azure DevOps Security
- Jenkins Security plugins
/grc-engineer:scan-iac ./terraform SOC2,PCI-DSS sarif > results.sarif
Auto-Fix Mode
/grc-engineer:scan-iac ./terraform SOC2,PCI-DSS detailed --fix
Auto-fixes:
- ā Add missing S3 bucket encryption
- ā Enable S3 versioning
- ā Add S3 public access blocks
- ā Enable KMS key rotation
- ā Update log retention periods
- ā Add missing resource tags
- ā Enable EBS encryption by default
- ā Cannot auto-fix: Security group rules (requires manual review)
- ā Cannot auto-fix: IAM policies (security sensitive)
Backup: Creates .tf.backup files before modifications
CI/CD Integration
GitHub Actions
name: IaC Compliance Scan
on: [pull_request]
jobs:
compliance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Scan Infrastructure
run: |
/grc-engineer:scan-iac ./terraform SOC2,PCI-DSS,NIST sarif > results.sarif
- name: Upload Results
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
- name: Check Compliance Threshold
run: |
COMPLIANCE=$(jq '.summary.compliance_percentage' scan-results.json)
if [ "$COMPLIANCE" -lt 90 ]; then
echo "Compliance below 90%: $COMPLIANCE%"
exit 1
fi
GitLab CI
compliance_scan:
stage: test
script:
- /grc-engineer:scan-iac ./terraform SOC2,PCI-DSS,NIST json > gl-sast-report.json
artifacts:
reports:
sast: gl-sast-report.json
Severity Levels
- š“ CRITICAL: Immediate compliance violation, blocks audit
- š” HIGH: Serious gap, should fix before audit
- š MEDIUM: Important improvement, fix when possible
- šµ LOW: Best practice recommendation
- ā¹ INFO: Informational, no action required
Supported Checks
Encryption
- S3 bucket encryption
- EBS volume encryption
- RDS encryption at rest
- KMS key rotation
- TLS/SSL enforcement
Access Control
- IAM policies (overly permissive)
- Security group rules
- S3 bucket policies
- Resource-based policies
Logging & Monitoring
- CloudTrail configuration
- VPC Flow Logs
- Log retention periods
- CloudWatch alarms
Network Security
- Security group egress/ingress
- Network ACLs
- VPC configuration
- Public exposure
Data Protection
- S3 versioning
- Backup configurations
- Deletion protection
- Public access blocks
Related Commands
/grc-engineer:generate-implementation- Generate compliant IaC/grc-engineer:map-controls-unified- Understand framework requirements/grc-engineer:find-conflicts- Identify conflicting requirements/grc-engineer:collect-evidence- Collect compliance evidence
Test Control
Run experimental checks for access_control_account_management on AWS. The checks are not a complete control assessment and must not be used as proof of framework compliance. Other controls and providers are not implemented.
Usage
/grc-engineer:test-control <control-id> [cloud-provider] [--output=json]
Use the user's arguments verbatim when invoking the script; do not substitute an example control or provider. For example, /grc-engineer:test-control access_control_account_management aws --output=json runs:
node "${CLAUDE_PLUGIN_ROOT}/scripts/test-control.js" access_control_account_management aws --output=json
For any other invocation, pass the requested control ID, optional provider, and options as separate shell-quoted arguments to the same script. Do not run the example unless the user requested those arguments.
The provider defaults to aws. JSON is written to stdout and progress and errors to stderr. A nonzero exit indicates a failure, warning, error, or unimplemented check. An INDETERMINATE status means the control or framework could not be assessed; it is not a finding of compliance or noncompliance. Unimplemented checks report NOT_IMPLEMENTED and do not produce evidence. The tool does not collect an evidence package or automatically remediate findings.
Summary pass_rate and framework score are fractions of assessed checks only: PASS divided by PASS + FAIL + WARNING. ERROR and NOT_IMPLEMENTED are excluded, and assessed gives the denominator. A score is null (shown as N/A in text) when no checks were assessed. A partial score is not an overall effectiveness or compliance determination; any unknown or error makes the relevant status INDETERMINATE.
The existing AWS checks inspect limited configuration indicators, not complete control effectiveness. Review their scope and independently validate any observations before relying on them.
Transform Risk
Converts unstructured risk assessments into structured Jira tickets.
Arguments
$1- Risk description (required, in quotes)$2- Jira project key (optional, defaults to SEC)
Instructions
-
Run the transform-risk script:
node plugins/grc-engineer/scripts/transform-risk.js "$ARGUMENTS" -
The script extracts likelihood, impact, and mitigation from the description.
-
Review the generated Jira ticket JSON.
-
Post to Jira using the API or import manually.
Example
/grc-engineer:transform-risk "Vulnerability in auth service. High likelihood, critical impact. Mitigation: Implement OAuth2 with PKCE." SEC
Sponsors
Details
- Marketplace
- GRCEngClub/claude-grc-engineering
- Source
- plugins/grc-engineer
- Category
- Community
More from GRCEngClub/claude-grc-engineering
All 70- grc-internalv0.1.0
- grc-loopv0.1.0
- grc-portfoliov0.1.0
- grc-reporterv0.1.0
- grc-tprmv0.1.0
- hitrustv0.1.0
- ind-dpdpav0.1.0
- irapv0.1.0
- ismapv0.1.0
- iso27001v0.1.0
- jp-appiv0.1.0
- nist-800-53v0.1.0
- nist-ai-600-1v0.1.0
- nist-ai-rmfv0.1.0
- nist-csf-20v0.1.0
- nydfsv0.1.0
- okta-inspectorv0.1.0
- onepassword-connectorv0.1.0
- oscalv0.1.0
- pbmmv0.1.0
- pci-dssv0.1.0
- poam-automationv0.1.0
- sg-mas-trmv0.1.0
- singapore-pdpav0.1.0