Jon Chery
|
6e41f09c6e
|
verify(P43): code review — 1 P0 auto-fixed, 1 P1 auto-fixed, 3 P1 flagged
acdl-ci / Lint (push) Successful in 6s
acdl-ci / Test (push) Successful in 26s
acdl-ci / Platform check-only (offline) (push) Successful in 9s
---ci---
phase: 43
milestone: v1.9
status: verify
lessons:
- P0 fix: run_platform.sh HITL gate passed approver via string interpolation into Python (GITHUB_ACTOR injection vector) — fixed by passing env vars (ACDL_HITL_*) read via os.environ
- P1 fix: attestation_matrix._is_fresh accepted future-dated artifacts (negative age bypassed freshness) — fixed with negative-age guard + test
- P1 flagged: WizClient._post does not check GraphQL errors (silent empty-list mask)
- P1 flagged: WizClient._post no SSRF validation on WIZ_API_URL
- P1 flagged: contract_resolver._load_env duplicates environment_check.load (can drift)
---/ci---
Multi-persona review of the v1.9 diff (v1.8.0..HEAD). Review pass 2
(post-complete) caught issues the initial self-review missed:
P0-INJECT (auto-fixed): scripts/run_platform.sh Step 7b interpolated
$APPROVER (GITHUB_ACTOR/GITEA_ACTOR) directly into a Python string
literal — an attacker-controllable username containing shell/python
metacharacters would execute arbitrary Python. Fixed: approver, contract
id, and env are now passed as environment variables to the subprocess
and read via os.environ[...] (no string interpolation).
P1-FRESHNESS (auto-fixed): core/attestation_matrix.py _is_fresh
accepted future-dated artifacts (negative age.days <= window_days).
Fixed: added age.total_seconds() < 0 guard rejecting future timestamps.
Test added: test_freshness_rejects_future_dated_artifact.
3 P1 flagged for post-hoc:
- WizClient._post does not surface GraphQL errors (silent empty mask)
- WizClient._post no SSRF validation on WIZ_API_URL (operator-supplied, low risk)
- contract_resolver._load_env duplicates environment_check.load (drift risk)
REVIEW.md updated with the findings. 494 tests pass; run_ci.sh + run_platform.sh --check-only green.
|
2026-07-23 11:54:58 +00:00 |
|
Jon Chery
|
e74a8c2f5d
|
feat(P42): stub implementation — SoD, HITL gates, attestation matrix, Wiz, Kyverno
---ci---
project: acdl
phase: 42
milestone: v1.9
status: execute
---/ci---
Phase 42 — stub-implementation (REQ-107..111, D-084):
route_halt_artifact (REQ-107):
- core/separation_of_duties.py: real SNS publish (ACDL_SOD_HALT_TOPIC_ARN)
+ outbox fallback (SEPARATION_OF_DUTIES_VIOLATION event via
outbox_writer) + stderr emission. No silent print-only stub.
- terraform/platform/main.tf: aws_sns_topic.acdl-sod-halt + output.
HITL attestation gates (REQ-108):
- core/hitl_gates.py: attest(contract_id, env, approver, evidence,
outbox_client) records approver_qa/approver_prod/approver_dr to
outbox, runs SoD check on prod, invokes attestation matrix, returns
(ok, reason). Dev skips (autonomous). approver_from_env() reads
GITHUB_ACTOR/GITEA_ACTOR.
- scripts/run_platform.sh: Step 7b HITL gate before apply for qa/prod/dr.
8-concern attestation matrix (REQ-109, D-084):
- core/attestation_matrix.py: check(env, evidence) runs the 8 concerns
from hitl_matrix_design.md §10.4. Offline-testable (contract_nfrs,
schema_validity, policy_pass) run for real. Operator-supplied accept
signed artifacts validated for freshness (FRESHNESS_DAYS table) +
schema. Signature skip when ACDL_ATTESTATION_SIGNING_KEY_ID unset
(D-089). Fail loud if missing/expired for prod/dr.
Wiz real client (REQ-110):
- adapters/wiz/wiz_adapter.py: WizClient (GraphQL API, Bearer auth,
pagination via pageInfo.hasNextPage + endCursor). fetch_and_adapt
translates issues → PolicyCheckResult; graceful degrade when
WIZ_API_TOKEN/WIZ_API_URL unset.
Kyverno fleshed out (REQ-111):
- adapters/kyverno/kyverno_adapter.py: full PolicyReport →
PolicyCheckResult mapping (pass/fail/skip/warn + severity + skip-with-
reason + resource ref construction from kind/name/namespace).
adapt_inactive() emits KYVERNO_INACTIVE_TF_STACK guard. --kube-version
stub parsed for future GitOps.
Tests: +47 (test_route_halt_artifact.py, test_hitl_gates.py,
test_attestation_matrix.py, test_wiz_adapter_real_client.py, expanded
test_kyverno_adapter.py). Existing wiz_adapter tests updated for the
real client's control.name ruleId. 493 passed; run_ci.sh green;
run_platform.sh --check-only green.
|
2026-07-23 04:40:44 +00:00 |
|