T09 · Insecure Skill Coding Practices
- Location
scripts/compliance.py:226- Finding
Audit-Only Deployment Can Silently Enable Resource Modification
- Content
View full analysis
Vulnerability Details
File Location:
scripts/compliance.py, lines 226–227
Vulnerability Type: Unsafe fallback to a resource-modifying rule effect
Risk Level: HighVulnerable Code
python allowed = rt.get("AllowedEffects", []) or [] effect = "Audit" if "Audit" in allowed else (allowed[0] if allowed else "")Technical Analysis
The deployment plan prefers the non-modifying
Auditeffect, but ifAuditis unavailable, it silently selects the first value inAllowedEffects. If that value isModify, the resulting conformance-pack rule may automatically change cloud-resource configurations.This behavior contradicts the documented security boundary that deployment defaults to audit-only operation and does not trigger automatic remediation. It also violates fail-safe design: when the safe effect is unavailable, the operation should be rejected rather than downgraded to an effect with greater impact.
The dry-run response only reports the pack name, template ID, and rule count. It does not expose each selected effect, so the user may confirm deployment without knowing that one or more rules use
Modify.Attack Path
- A selected conformance-pack template contains a rule for which
AllowedEffectsdoes not includeAudit. - The rule permits
Modify, either as the first or only allowed effect. build_plan()silently assignsModifyto that rule.- The dry-run output presents only a pack summary and does not reveal the modifying effect.
- The user supplies
--confirm, believing the operation will only deploy compliance checks. CreateConformancePackreceives the generated rule overrides.- The platform may execute the modification behavior defined by the rule against resources in scope.
Impact Assessment
Successful exploitation or accidental triggering can cause unauthorized or unexpected changes to cloud resources covered by the deployed conformance pack. The exact scope depends on the selected rule tem ...[truncated 590 chars]
- A selected conformance-pack template contains a rule for which
- Remediation
View remediation
Remediation Suggestions
- Enforce audit-only behavior by rejecting any rule that does not explicitly support
Audit:
python allowed = rt.get("AllowedEffects", []) or [] if "Audit" not in allowed: raise RuntimeError( f"Rule template {rid} does not support the required Audit effect" ) effect = "Audit"-
Never automatically fall back to
Modifyor another higher-impact effect. -
Include every rule template ID and selected effect in the dry-run result so users can review the complete deployment plan.
-
If modification support is introduced later, implement it as a separate command or mode with:
- An explicit option such as
--allow-modify. - A second confirmation describing affected rules and resource scopes.
- Clear per-rule disclosure in dry-run output.
- Least-privilege permission requirements.
- Audit logging and rollback guidance.
- An explicit option such as
-
Add regression tests covering:
AllowedEffects=["Audit"].AllowedEffects=["Audit", "Modify"].AllowedEffects=["Modify"].- Missing or empty
AllowedEffects.
- Enforce audit-only behavior by rejecting any rule that does not explicitly support
