SkillsReviewed · mukul975

Auditing Terraform Infrastructure for Security

Auditing Terraform Infrastructure for Security provides instructions, command examples and a Python script for developers and cloud security teams checking Terraform files that describe cloud infrastructure for security problems. Its bundled script can hide scanner failures. It provides Checkov, tfsec, Terrascan and OPA examples, plus a Python wrapper that combines Checkov, tfsec and limited custom plan checks.

Researched 16 Nov 2026

In short.

Auditing Terraform Infrastructure for Security provides instructions, command examples and a Python script for developers and cloud security teams checking Terraform files that describe cloud infrastructure for security problems. Its bundled script can hide scanner failures and needs changes before its results can support a dependable deployment gate. The instructions cover several scanners, custom policies and CI integration; the Python implementation automates a narrower subset. Source inspection identifies missing failure handling, limited plan checks and inconsistent policy input assumptions. Nothing was executed, so detection accuracy, dependency compatibility and CI behavior remain unassessed.

Researched and written by an AI model and checked by a second AI model. How it works

Covers only skills/auditing-terraform-infrastructure-for-security at commit 54a798831d2266a3ca61ce68a7acb80b81160d57: SKILL.md, references/api-reference.md, scripts/agent.py and the local LICENSE, with the repository-level LICENSE as a related notice. Excludes other repository content, external tool documentation, live cloud configurations and later revisions. Findings derive from the supplied text and code; nothing was executed, and scanner accuracy, dependency compatibility, CI enforcement and deployment outcomes remain unassessed.

The overview

Identity

The resource is the auditing-terraform-infrastructure-for-security folder in mukul975/Anthropic-Cybersecurity-Skills. Its metadata names mahipal as author and declares version 1.0. It contains SKILL.md, an API reference, a Python script and a local license.

The original source location is [https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/auditing-terraform-infrastructure-for-security]. The supplied files are fixed to commit 54a798831d2266a3ca61ce68a7acb80b81160d57. The script invokes security scanners directly; it contains no model API integration.

Assessment

The skill offers a concrete starting point for adding security checks to Terraform development. Its useful material includes directory and plan scanning commands, custom policy examples, machine-readable outputs and a pull-request workflow.

The Python wrapper needs engineering review before operational use. It ignores scanner exit codes and can convert unparseable output into an empty findings list. A completed report with zero findings therefore does not establish that scanning succeeded. No execution evidence establishes reliability or security coverage.

Users

The clearest audience is DevOps, platform engineering and cloud security teams that maintain Terraform repositories and want checks before deployment. Policy authors may also use the examples to begin expressing organization-specific rules.

Beginners receive definitions of infrastructure as code, Terraform plans and policy as code, but practical use still requires command-line, Terraform and CI knowledge. The instructions explicitly exclude runtime monitoring, application security testing and post-deployment configuration drift detection.

Capabilities

The written workflow covers Checkov and tfsec scans, Terrascan commands, OPA/Rego policies, Conftest checks, JSON and SARIF output, GitHub Actions integration and state inspection. Examples focus heavily on AWS resources, including storage encryption, public SSH access and permissive IAM policies.

The Python script implements Checkov and tfsec directory scans, three custom AWS plan checks and a combined JSON report. It does not invoke Terrascan, OPA or Conftest, generate SARIF, or change infrastructure. Its totals count finding entries without deduplicating overlapping scanner results.

Using it

Requirements

The documented workflow requires Terraform code, Checkov, tfsec, Terrascan, Terraform 1.0 or later and OPA. Conftest is also needed for the commands that invoke it. The Python wrapper uses Python 3 standard-library modules and requires Checkov or tfsec on the executable path when those scanners are selected.

The custom plan-only path reads an existing JSON file without invoking Terraform or an external scanner. Generating that file requires the project's Terraform configuration and any applicable backend or provider access. Required credentials, tested dependency versions and assistant-host compatibility are not established.

Mechanism

The wrapper launches Checkov and tfsec as subprocesses, captures their output and allows each invocation up to 120 seconds. It parses JSON into findings, appends any custom plan findings, sorts entries by severity and writes a report containing a timestamp, total findings, critical and high counts, and finding details.

The --tool option controls directory scanning. Providing --plan-json separately triggers the handwritten plan checks, regardless of that option. Although a function for running Checkov on a plan exists, main never calls it. Supplying --plan-json therefore does not activate Checkov plan analysis.

Setup

SKILL.md provides installation commands for several scanners and shows generating tfplan.json through terraform init, terraform plan and terraform show -json. For the wrapper, prepare the selected scanner executables and provide a Terraform directory, an existing plan JSON file, or both. No assistant-specific installation procedure is supplied.

The GitHub Actions example needs completion for a reproducible environment: it invokes Conftest without showing an installation step and references the Checkov action through the moving master branch. It also generates a plan while configuring its Checkov step to scan the Terraform directory. Compatibility and intended coverage need verification.

Example

An illustrative invocation derived from the argument parser is: python3 scripts/agent.py --terraform-dir ./terraform --plan-json tfplan.json --tool both --output terraform_audit.json. This requests both directory scanners and the custom plan checks. It was not executed.

The implementation writes findings with their source and severity, plus summary counts. A problem reported by multiple scanners can appear more than once. The sample audit report in SKILL.md, including its named repository, date and numeric results, illustrates formatting and supplies no measured results for this resource.

Assessment & evidence

Limitations

Failure handling can produce misleading results. Non-JSON scanner output becomes a dictionary from which the parsers can extract no findings, while scanner return codes are ignored. Missing executables and timeouts are not caught. Running without either input argument writes a zero-findings report, and detected findings do not cause main to select a failing process exit status.

The direct plan checks are narrow. The IAM check only examines string-encoded policies and matches Action exactly equal to '*'. The SSH check does not verify that a rule is ingress. The S3 check only examines one encryption attribute on the bucket's after value. Deleted matching resources with after set to null can cause an exception.

The Rego examples read input.resource, while the Python plan parser reads resource_changes. No conversion between those input assumptions is supplied. Correct policy evaluation against the documented plan input is unestablished. These observations come from source inspection; their runtime effects were not tested.

Reasoning

The strongest supported use is adapting the instructions into a reviewed Terraform security workflow. They provide concrete commands and examples, while the implementation makes the aggregation logic visible enough to inspect and modify.

Confidence in a deployment decision requires evidence that each scanner ran successfully and each policy evaluated the intended data. The wrapper does not preserve that distinction reliably. Its source supports identifying implementation gaps, but does not establish detection accuracy, compliance coverage or readiness for unattended enforcement.

Alternatives

Teams needing directory or plan scanning can invoke Checkov directly using the supplied examples and retain its native output and exit status. The reference also provides direct tfsec commands. Organization-specific requirements can be implemented through the documented OPA/Conftest approach after validating policy syntax and input shape.

For adjacent needs, SKILL.md points to cloud security posture management for runtime monitoring and AWS Config or Azure Policy for configuration drift. Those products and the named scanners were not independently assessed here, so their current capabilities, maintenance and pricing are unknown.

Evidence

The available source includes the complete supplied skill folder: SKILL.md, references/api-reference.md, scripts/agent.py and its LICENSE, together with the repository-level LICENSE. It supports examining the instructions, implementation and licensing at the specified commit.

The fixed-revision instructions are available at [https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/54a798831d2266a3ca61ce68a7acb80b81160d57/skills/auditing-terraform-infrastructure-for-security/SKILL.md]. No test suite, execution logs, benchmark results or verified deployment outcomes are included. Other repository skills and external documentation are outside this assessment.

Access & freshness

Costs

The supplied Apache 2.0 licenses grant rights without a license charge. Total operating cost is unknown: the evidence provides no runner costs, cloud charges, support prices or measured resource consumption.

The instructions mention the commercial Bridgecrew platform and show a command using a Bridgecrew API key, but provide no pricing. The Python wrapper contains no model API call; any cost for an assistant that loads the skill is separate and unspecified.

Rights

Both the repository-level and skill-local license files contain Apache License 2.0 and a 2026 mukul975 copyright notice. SKILL.md also declares Apache-2.0. The license permits use, modification and redistribution, including commercial use, subject to its conditions.

Redistribution requires a license copy and retention of applicable notices; modified files must identify changes. Attribution from a NOTICE file must be retained if one accompanies the work. The license grants no general trademark permission and provides the work without warranty. No NOTICE file appears in the supplied scope.

Freshness

The supplied snapshot was captured on 2026-11-16 at 23:15:44.972 UTC from commit 54a798831d2266a3ca61ce68a7acb80b81160d57. Version 1.0 is declared in the skill metadata; a release date and subsequent changes are unknown. The example audit date is not evidence of a release or successful run.

The instructions specify Terraform 1.0 or later and several action references, but provide no tested dependency matrix. Current scanner options, check identifiers, Rego compatibility and GitHub Actions behavior have not been verified.

Actions

Before relying on the wrapper, require an input, preserve scanner exit codes and diagnostic output, distinguish scan failure from zero findings, and define which findings should fail CI. Handle missing executables, timeouts, malformed output and null plan values explicitly.

Validate the custom checks against representative plans, including deleted resources, egress rules, IAM action arrays and encryption represented outside the inspected attribute. Align the Rego policies with the actual input structure and selected OPA/Conftest versions.

For CI adoption, install all invoked tools, pin dependencies and actions, and verify both a passing case and a deliberately failing case. Retain native scanner results alongside the combined report so totals and scanner completion can be checked.

Evidence for this report

LICENSEnotice · checked 2026-11-16