Skip to content

fix/issue--promote-bundle-tamper-to-blocking - #322

Open
Naajih09 wants to merge 4 commits into
Vero-protocol:mainfrom
Naajih09:main
Open

fix/issue--promote-bundle-tamper-to-blocking#322
Naajih09 wants to merge 4 commits into
Vero-protocol:mainfrom
Naajih09:main

Conversation

@Naajih09

Copy link
Copy Markdown

This PR promotes confirmed policy-bundle tampering signals from observational (WARNING) to blocking (NON_COMPLIANT).
Previously, per VAG-003, bundle integrity checks were observational to prevent false positives. Now that the detection logic has matured, this PR enforces security by blocking the build if the Rego policy bundle has been tampered with, has an invalid signature, or is signed by an untrusted entity.
Related Issue
Closes #311
Changes
src/audit-guard/src/policy-engine.ts:
Updated applyPolicyBundleVerification logic to differentiate between critical integrity failures and general warnings.
Promoted BundleTampered, SignatureInvalid, and UntrustedSigner error codes to the violations array.
Forced the overall evaluation status to NON_COMPLIANT when these critical errors are detected.
Updated the result summary to explicitly state when tampering is the cause of a failed build.
src/audit-guard/test/policy-engine.test.ts:
Added/Updated test cases to assert that a BundleTampered result from the verifier correctly triggers a NON_COMPLIANT status instead of a WARNING.
Technical Implementation Details
The check now iterates through verification errors:
Critical Errors: Pushed to result.violations, triggering a build failure.
Non-Critical Errors: Pushed to result.warnings, remaining observational.
The result.status is explicitly set to NON_COMPLIANT if hasTampering is true, ensuring the CI runner exits with a non-zero code.
Checklist

Confirmed policy-bundle tampering blocks the build (NON_COMPLIANT).

Added/Updated test asserting the blocking behavior.

Verified that non-critical verification errors still result in WARNING if the build is otherwise compliant.

Branch named fix/issue--promote-bundle-tamper-to-blocking.
Screenshots / Output (Optional)
Before:
⚠️ Policy bundle signature verification failed: BundleTampered (Status: WARNING)
After:
❌ CRITICAL: Policy bundle integrity check failed: BundleTampered (Status: NON_COMPLIANT)
❌ Policy bundle tampering detected — blocking build

Updated policy bundle verification to promote tampering to NON_COMPLIANT status, blocking builds. Enhanced warning handling for non-critical issues.
Added a test case to check for NON_COMPLIANT status when bundle tampering is detected.
@Naajih09
Naajih09 requested a review from N-thnI as a code owner August 20, 2026 21:23
This workflow runs performance regression tests on pull requests to the main branch using k6.
@N-thnI N-thnI mentioned this pull request Aug 21, 2026
@N-thnI

N-thnI commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

please ensure all checks pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confirmed policy-bundle tampering only ever warns, never blocks the build

2 participants