feat(audit): persist no-match + unknown-method denials (audit #31, P4)#35
Merged
Merged
Conversation
…audit #31, P4) Two denial paths were previously logged via Logger but NOT persisted to the VeriSimDB audit ledger: 1. no-match (PolicyCompiler.lookup returns {:error, :no_match}) 2. unknown HTTP method (safe_verb/1 returns nil; PROPFIND/MKCOL/garbage) Both are the most security-relevant paths — probes for undeclared routes or unsupported verbs are exactly the events a forensic reader most wants to replay — yet were the ones missing from the audit stream. Adds VeriSimDB.audit_deny/4 calls on both paths with a "policy_ref" discriminator ("no_match" or "unknown_method:<METHOD>") so an audit reader can distinguish these from explicit-rule denials. Test coverage: * /api/totally-undeclared DELETE -> 403 + a no_match audit entry * PROPFIND /api/known -> 405 + an unknown_method:PROPFIND audit entry * Both tests drain the VeriSimDB ETS buffer and assert on the cast having landed (sys.get_state used to flush the cast queue). Refs: #31 (self-audit, priority 4)
🔍 Hypatia Security ScanFindings: 65 issues detected
View findings[
{
"reason": "Issue in boj-build.yml",
"type": "missing_timeout_minutes",
"file": "boj-build.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in casket-pages.yml",
"type": "missing_timeout_minutes",
"file": "casket-pages.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in casket-pages.yml",
"type": "missing_timeout_minutes",
"file": "casket-pages.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in codeql.yml",
"type": "missing_timeout_minutes",
"file": "codeql.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in dogfood-gate.yml",
"type": "missing_timeout_minutes",
"file": "dogfood-gate.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in dogfood-gate.yml",
"type": "missing_timeout_minutes",
"file": "dogfood-gate.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in dogfood-gate.yml",
"type": "missing_timeout_minutes",
"file": "dogfood-gate.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in dogfood-gate.yml",
"type": "missing_timeout_minutes",
"file": "dogfood-gate.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in dogfood-gate.yml",
"type": "missing_timeout_minutes",
"file": "dogfood-gate.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in governance.yml",
"type": "missing_timeout_minutes",
"file": "governance.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
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.
Summary
Audit issue: #31 (priority 4 — provenance/audit logging coverage).
Two denial paths were previously logged via
Loggerbut NOT persisted tothe VeriSimDB audit ledger:
PolicyCompiler.lookup/3returns{:error, :no_match})safe_verb/1returnsnil; PROPFIND, MKCOL,REPORT, arbitrary garbage strings)
Both are the most security-relevant paths — probes for undeclared routes
or unsupported verbs are exactly the events a forensic reader most wants
to replay — yet were the ones missing from the audit stream.
Scope
lib/http_capability_gateway/gateway.ex:VeriSimDB.audit_deny/4callson both paths, with a
policy_refdiscriminator(
\"no_match\"or\"unknown_method:<METHOD>\") so audit readers candistinguish these from explicit-rule denials
test/gateway_audit_paths_test.exs: 128 LoC of regression tests thatdrain the VeriSimDB ETS buffer and assert on the cast having landed
(
sys.get_stateused to flush the cast queue)Diff: 2 files, +146 LoC.
Test plan
mix test test/gateway_audit_paths_test.exsmix test— confirm no existing tests broke/api/undeclared-routeandPROPFIND /produce ledger rowsEcho-types audit
record-as-not-relevant. Audit-ledger persistence is a side-effect, nota typed protocol; no L3 obligation in scope.
Refs: #31