feat(policy-engine): implement organization security policy as code w… - #117
Open
drah9991 wants to merge 1 commit into
Open
feat(policy-engine): implement organization security policy as code w…#117drah9991 wants to merge 1 commit into
drah9991 wants to merge 1 commit into
Conversation
…ith layered enforcement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #96
Objective
Introduces a deterministic Organization Security Policy Engine with layered enforcement. The implementation provides a strongly typed architecture that isolates domain logic from transport layers, ensuring strict policy evaluation without external network dependencies during CI execution.
Architecture
packages/core): Integratedzodfor strict runtime validation (policy.schema.ts). Supports hierarchical scopes (organization,repository,branch,contract) and defined CI gates (maxFindings,preventNewRegressions).PolicyResolver): Implements deterministic policy inheritance and merging. Includes hard conflict detection, preventing child scopes (e.g., repository) from downgrading severity levels mandated by parent scopes (e.g., organization).exception-signer.ts): Exception payloads are structurally sorted and cryptographically signed (SHA-256). Modifications to immutable fields (e.g.,expiryTimestamp,justification) deterministically invalidate the signature, dropping the exception state.cli: Evaluates resolved policies against raw findings and enforces CI gates.vscode-extension: Translates filtered findings into nativeDiagnosticSeveritymappings.github-action: Generates sanitized Markdown reports for CI/PR feedback.Security Considerations
.strict()to reject malformed or injected configurations at the boundary.1), preventing open-failure bypasses.Test Coverage
VulnerableVault.sol,SecureVault.sol) for integration testing.build,lint,test).