Move the code and terraform audits into the reviews plugin
Copy the standalone code-review and terraform-review skills into
plugins/reviews as audit-code and audit-terraform. The rename separates the
automated, linter-driven audits from the guided review-pr walkthrough that
already lived here.
Resolve bundled script paths through ${SKILL_DIR}, exported in a new step 0.
CLAUDE_PLUGIN_ROOT is not set in the Bash tool environment, so the obvious
substitution would have expanded to nothing and broken every collection
script invocation.
Replace the PLAN and DESIGN docs with READMEs written from the current
SKILL.md and scripts. The old docs had drifted badly: they named semgrep
where the code calls opengrep, scoped five review agents where there are
now eight, and predated Lua, PowerShell, and GitHub Actions support.
Add CONSISTENCY_NORMS to the audit-terraform agent inputs. The collection
script writes consistency_norms.json and the agent prompt declares it, but
SKILL.md never listed it, leaving the variable unsubstituted.
Drop the --ingest-verdicts instruction from both skills. review_stats.py
parses no arguments, so the ref-mode verdict template it told users to feed
back could never be read.
Point audit-terraform's smoke test at README.md and resolve its fixture
paths relative to the test file rather than an absolute home directory.
Tests: 197 passing (audit-code), 106 passing (audit-terraform).
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
from pathlib import Path
|
||||
|
||||
from scripts.scrape_cis import parse_cis_page
|
||||
|
||||
|
||||
_FIXTURES = Path(__file__).parent / "fixtures"
|
||||
|
||||
|
||||
def test_parses_cis_unified_controls():
|
||||
html = (_FIXTURES / "cis_sample.html").read_text()
|
||||
rows = parse_cis_page(html, source_url="https://docs.aws.amazon.com/.../cis.html")
|
||||
by_id = {r.control_id: r for r in rows}
|
||||
assert "CIS Account.1" in by_id
|
||||
a = by_id["CIS Account.1"]
|
||||
assert "Security contact" in a.title
|
||||
assert "v5.0.0 §1.2" in a.requirement
|
||||
assert "v1.2.0 §1.18" in a.requirement
|
||||
assert a.severity == "medium"
|
||||
|
||||
|
||||
def test_skips_empty_version_cells():
|
||||
html = (_FIXTURES / "cis_sample.html").read_text()
|
||||
rows = parse_cis_page(html, source_url="https://docs.aws.amazon.com/.../cis.html")
|
||||
by_id = {r.control_id: r for r in rows}
|
||||
iam5 = by_id["CIS IAM.5"]
|
||||
assert "v1.4.0" not in iam5.requirement
|
||||
assert "v5.0.0 §1.10" in iam5.requirement
|
||||
assert "v1.2.0 §1.2" in iam5.requirement
|
||||
|
||||
|
||||
def test_resource_types_via_prefix_map():
|
||||
html = (_FIXTURES / "cis_sample.html").read_text()
|
||||
rows = parse_cis_page(html, source_url="https://docs.aws.amazon.com/.../cis.html")
|
||||
by_id = {r.control_id: r for r in rows}
|
||||
assert "aws_s3_bucket" in by_id["CIS S3.5"].resource_types
|
||||
assert "aws_iam_user" in by_id["CIS IAM.5"].resource_types
|
||||
assert "aws_cloudtrail" in by_id["CIS CloudTrail.1"].resource_types
|
||||
Reference in New Issue
Block a user