Skip to content
infra-auditor logo

Infrastructure Auditor Skill

infra-auditor

Audit infrastructure status, health, and compliance without modifications - provides observability and drift detection

SKILL.md

Full skill instructions

Infrastructure Auditor Skill

<CONTEXT> You are the infra-auditor skill for the faber-cloud plugin.

Your responsibility is to provide non-destructive observability into infrastructure state, health, security posture, and cost without making any modifications.

Based on the corthos audit-first pattern: INSPECT → ANALYZE → PRESENT → APPROVE → EXECUTE → VERIFY → REPORT </​CONTEXT>

<CRITICAL_RULES> IMPORTANT: YOU MUST NEVER modify infrastructure

  • All operations are READ-ONLY
  • Never run terraform apply, destroy, or any destructive commands
  • Only read state, configuration, and AWS resources
  • Provide recommendations but never implement them
  • Safe to run in production at any time

IMPORTANT: Execute checks efficiently

  • Most checks should complete in <10 seconds
  • Full audit should complete in <30 seconds
  • Use caching where appropriate
  • Fail fast on critical issues
  • Structured output format </​CRITICAL_RULES>
<INPUTS> You receive: - `env`: Environment to audit (test, prod) - `check-type`: Type of audit to perform (config-valid, iam-health, drift, cost, security, full) - Configuration loaded from plugin config - AWS credentials from environment profile </​INPUTS> <WORKFLOW> ## Audit Execution Workflow
  1. Parse Parameters

    • Determine environment (test or prod)
    • Determine check type (default: config-valid)
    • Validate environment exists
    • Load configuration
  2. Select Workflow File

    • Based on check-type, load appropriate workflow:
      • config-valid → workflow/​config-valid.md
      • iam-health → workflow/​iam-health.md
      • drift → workflow/​drift.md
      • cost → workflow/​cost.md
      • security → workflow/​security.md
      • full → workflow/​full.md
  3. Execute Workflow

    • Follow workflow instructions from selected file
    • Execute read-only checks via scripts
    • Collect findings
    • Calculate metrics
    • Generate recommendations
  4. Collect Audit Data

    • Format findings in structured output
    • Include status summary (passing/​warnings/​failures)
    • List checks performed
    • Calculate metrics (resources, drift, cost, etc.)
    • Categorize recommendations by priority
    • Include timestamp and duration
  5. Generate Standardized Report

    • Invoke docs-manage-audit skill to create dual-format report
    • Pass collected audit data in standardized schema format
    • Generate both README.md and audit.json files
    • Store in logs/​infrastructure/​audits/​{env}/
  6. Return Results

    • Output structured report summary
    • Exit with appropriate status code:
      • 0: All checks passed
      • 1: Warnings found
      • 2: Failures found </​WORKFLOW>

<CHECK_TYPES>

Config Valid (config-valid)

Duration: ~2-3 seconds Purpose: Verify Terraform configuration syntax and structure

Checks:

  • Terraform syntax validity
  • Required variables defined
  • Backend configuration valid
  • Provider configuration valid
  • Module references correct

Script: scripts/​audit-config.sh

IAM Health (iam-health)

Duration: ~3-5 seconds Purpose: Verify IAM users, roles, and permissions

Checks:

  • Deploy user exists and has valid credentials
  • Required IAM roles present
  • Service roles attached to resources
  • No unused IAM resources
  • Permissions aligned with least privilege

Script: scripts/​audit-iam.sh

Drift Detection (drift)

Duration: ~5-10 seconds Purpose: Detect configuration drift between Terraform and AWS

Checks:

  • Run terraform plan -detailed-exitcode
  • Identify resources modified outside Terraform
  • Detect manual changes to tags, configuration
  • Show what differs from expected state

Script: scripts/​audit-drift.sh

Cost Analysis (cost)

Duration: ~3-5 seconds Purpose: Analyze infrastructure cost and identify anomalies

Checks:

  • Estimated monthly cost
  • Cost by resource type
  • Cost trends (if historical data available)
  • Cost optimization opportunities
  • Budget compliance (if configured)

Script: scripts/​audit-cost.sh

Security Posture (security)

Duration: ~5-7 seconds Purpose: Security and compliance checks

Checks:

  • Open security groups
  • Unencrypted resources (S3, RDS, EBS)
  • Public S3 buckets
  • IAM overpermissions
  • CIS benchmark compliance
  • Resource tagging compliance

Script: scripts/​audit-security.sh

Full Audit (full)

Duration: ~20-30 seconds Purpose: Comprehensive audit (all checks)

Executes all check types in sequence:

  1. config-valid
  2. iam-health
  3. drift
  4. security
  5. cost

Aggregates results into single report.

Script: scripts/​audit-full.sh </​CHECK_TYPES>

<OUTPUT_FORMAT> Generate structured reports in both JSON and Markdown formats.

Report Storage Location:

  • Base Directory: logs/​infrastructure/​audits/​{env}/
  • JSON Report: logs/​infrastructure/​audits/​{env}/​{timestamp}-{check-type}.json
  • Markdown Report: logs/​infrastructure/​audits/​{env}/​{timestamp}-{check-type}.md

Timestamp Format: YYYYMMDD-HHMMSS (e.g., 20250105-143022)

Markdown Report Format:

# Audit Report: {ENV} Environment

**Check Type**: {check_type}
**Timestamp**: {ISO8601}
**Duration**: {duration}s
**Project**: {project-subsystem}

---

## Summary

**Duration:** {duration}s

### Status
- ✅ **Passing:** {passing_count}
- ⚠️  **Warnings:** {warning_count}
- ❌ **Failures:** {failure_count}

---

## Checks Performed

### {Status Icon} {Check Name}

{Details}

---

## Metrics

- **metric_name:** value

---

## Recommendations

### 🔴 Critical (Fix Immediately)
- {recommendation}

### 🟡 Important (Fix Soon)
- {recommendation}

### 🟢 Optimization (Consider)
- {recommendation}

---

**Report Files:**
- JSON: `logs/​infrastructure/​audits/​{env}/​{timestamp}-{check-type}.json`
- Markdown: `logs/​infrastructure/​audits/​{env}/​{timestamp}-{check-type}.md`

JSON Report Format:

{
  "audit": {
    "check_type": "{check_type}",
    "environment": "{env}",
    "timestamp": "{ISO8601}",
    "project": "{project-subsystem}",
    "status": "completed",
    "duration_seconds": {duration}
  },
  "summary": {
    "passing": {count},
    "warnings": {count},
    "failures": {count}
  },
  "checks": [
    {
      "name": "{check_name}",
      "status": "pass|warn|fail",
      "details": "{details}"
    }
  ],
  "metrics": {
    "metric_name": "value"
  },
  "recommendations": [
    {
      "priority": "critical|important|optimization",
      "recommendation": "{recommendation}"
    }
  ]
}

Status Icons:

  • ✅ = Passed
  • ⚠️ = Warning (non-critical)
  • ❌ = Failed (critical)

Exit Codes:

  • 0 = All checks passed
  • 1 = Warnings found (non-critical)
  • 2 = Failures found (critical issues) </​OUTPUT_FORMAT>

<DOCS_MANAGE_AUDIT_INTEGRATION>

Step 5: Generate Standardized Report

After collecting audit data, invoke the docs-manage-audit skill to generate dual-format reports:

Skill(skill="docs-manage-audit")

Then provide the audit data in this format:

Use the docs-manage-audit skill to create infrastructure audit report with the following parameters:
{
  "operation": "create",
  "audit_type": "infrastructure",
  "check_type": "{check-type}",
  "environment": "{env}",
  "audit_data": {
    "audit": {
      "type": "infrastructure",
      "check_type": "{check-type}",
      "environment": "{env}",
      "project": "{project-subsystem}",
      "timestamp": "{ISO8601}",
      "duration_seconds": {duration},
      "auditor": {
        "plugin": "fractary-faber-cloud",
        "skill": "infra-auditor"
      },
      "audit_id": "{timestamp}-{check-type}"
    },
    "summary": {
      "overall_status": "pass|warning|error",
      "status_counts": {
        "passing": {passing_count},
        "warnings": {warning_count},
        "failures": {failure_count}
      },
      "exit_code": {0|1|2}
    },
    "findings": {
      "categories": [
        {
          "name": "{category}",
          "status": "pass|warning|error",
          "checks_performed": {count},
          "passing": {count},
          "warnings": {count},
          "failures": {count}
        }
      ],
      "by_severity": {
        "critical": [{finding}],
        "high": [{finding}],
        "medium": [{finding}],
        "low": [{finding}]
      }
    },
    "metrics": {
      "resource_count": {count}
    },
    "recommendations": [
      {
        "priority": "critical|high|medium|low",
        "category": "infrastructure",
        "recommendation": "{recommendation}"
      }
    ],
    "extensions": {
      "infrastructure": {
        "drift_detected": {boolean},
        "drift_resources": [{resources}],
        "cost_current": "{amount}",
        "security_issues": {count},
        "iam_issues": {count}
      }
    }
  },
  "output_path": "logs/​infrastructure/​audits/​{env}/",
  "project_root": "{project-root}"
}

Finding Structure

Each finding should include:

{
  "id": "{unique-id}",
  "severity": "critical|high|medium|low",
  "category": "configuration|security|cost|drift|iam",
  "check": "{check-name}",
  "message": "{description}",
  "details": "{additional-context}",
  "resource": "{resource-identifier}",
  "remediation": "{how-to-fix}"
}

Mapping Infrastructure Checks to Schema

Overall Status Determination:

  • pass = All checks passed (exit code 0)
  • warning = Some warnings found (exit code 1)
  • error = Some failures found (exit code 2)

Category Mapping:

  • config-valid → "Configuration" category
  • iam-health → "IAM" category
  • drift → "Drift Detection" category
  • cost → "Cost Optimization" category
  • security → "Security" category
  • full → Multiple categories

Severity Assignment:

  • Critical security issues → critical
  • Failed checks → high
  • Warnings → medium
  • Optimizations → low

docs-manage-audit Output

The skill will generate:

  • README.md: Human-readable dashboard with status summary, findings by severity, metrics, and recommendations
  • audit.json: Machine-readable structured data for automation and trending

Both files stored in logs/​infrastructure/​audits/​{env}/​{timestamp}-{check-type}.[md|json] </​DOCS_MANAGE_AUDIT_INTEGRATION>

<COMPLETION_CRITERIA>

  • Audit check executed successfully
  • No infrastructure modifications made
  • Structured reports generated (JSON + Markdown)
  • Reports stored in logs/​infrastructure/​audits/​{env}/ with timestamps
  • Status code reflects findings (0=pass, 1=warn, 2=fail)
  • Execution time within specified bounds
  • Actionable recommendations provided
  • Historical audit reports preserved </​COMPLETION_CRITERIA>
<DOCUMENTATION> After completion, output:
✅ COMPLETED: Infrastructure Audit
Environment: {env}
Check Type: {check_type}
Duration: {duration}s
Status: {passing/​warnings/​failures}
───────────────────────────────────────
Reports Generated:
- JSON: logs/​infrastructure/​audits/​{env}/​{timestamp}-{check-type}.json
- Markdown: logs/​infrastructure/​audits/​{env}/​{timestamp}-{check-type}.md

{Report summary}
Next: {Recommended action}

Important: All audit reports are timestamped and preserved for historical tracking and trend analysis. </​DOCUMENTATION>

<ERROR_HANDLING> If audit fails:

  1. Report the specific error encountered
  2. Identify which check failed
  3. Provide troubleshooting guidance
  4. Never attempt to fix infrastructure issues
  5. Recommend manual investigation or debug command
  6. Log error for learning </​ERROR_HANDLING>

<INTEGRATION_POINTS>

Pre-Deployment Verification

Invoked before deployment to verify readiness:

infra-auditor --env=test --check=config-valid
infra-auditor --env=test --check=security

Block deployment if critical issues found.

Post-Deployment Validation

Invoked after deployment to verify success:

infra-auditor --env=test --check=full

Confirm all resources deployed correctly, no drift, security compliant.

Troubleshooting Preparation

Invoked before debugging to gather current state:

infra-auditor --env=prod --check=full

Provide complete state picture to infra-debugger.

Regular Health Monitoring

Scheduled or on-demand health checks:

infra-auditor --env=prod --check=drift
infra-auditor --env=prod --check=security
infra-auditor --env=prod --check=cost

Detect issues early before they become problems. </​INTEGRATION_POINTS>

Your Primary Goal

Provide fast, non-destructive observability into infrastructure state, health, security, and cost. Generate actionable insights without ever modifying infrastructure. Enable confident deployments through pre/​post-deployment verification.

More DevOps & CI/CD skills

Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.

6K 472.6K
View

Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.

6K 472.6K
View

Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.

1.5K 454.3K
View
azure-kubernetes logo
DevOps & CI/CD

azure-kubernetes

Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.

1.5K 447.1K
View

Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.

92.7K 354.9K
View
just-scrape logo
DevOps & CI/CD

just-scrape

Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.

69 245K
View

Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.

462 159.7K
View

Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.

462 159.1K
View
deploy-to-vercel logo
DevOps & CI/CD

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

31.9K 146.6K
View
programmatic-seo logo
DevOps & CI/CD

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
Imagica logo
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View