Repository navigation
Implement the Spatial Radar for DB injection funnels (#105) - #359
Merged
Merged
Conversation
Landing order per the #102 epic (#344 -> #346 -> #105 -> #106): with #348's persisted, satellite-aware threat_locations ledger and its correlate_against_ledger() primitive now in place, #105 becomes a small, self-contained consumer of that infrastructure rather than a new correlation mechanism. - galaxyscope.py's Phase 5.5, right after the Active Hemorrhage block: correlates detector.py's "api" (public route) hits against security_lens.py's "sec_db_hooks" (raw DB sink) hits via correlate_against_ledger(), scoped to the SAME function -- a public API route directly invoking a DB query in its own body is deterministic proof of an injection funnel, not the flat probabilistic guess #105's original proposal described. Feeds a new "sec_amplified_sql_injection" signal, mirroring the amplified_leaks/ amplified_rce telemetry pattern already established for the other post-hoc correlations. max_distance=5 (lines) reuses the exact char->line conversion the Active Hemorrhage block just above it already established (150 chars -> 5 lines), applied here to #105's originally-proposed 100-char radius. Same-function scoping via correlate_against_ledger() does the real precision work; this just guards against sprawling functions where an unrelated DB call happens to share a function with an API route. - signal_processor.py's _calc_injection_surface(): sec_amplified_sql_injection is now treated as deterministic proof, exactly like sec_tainted_injection already is -- same +500 gravity spike, and it also exempts the score from the "unconfirmed guess" 90% dampener applied when no other explicit io/exec signal is present. Tests: a worker-level regression test in test_galaxyscope.py (a real detector.py "api" hit correlated against a mocked security_lens db_hooks position, through the full worker path) and a signal_processor.py unit test proving the signal alone (with no other io/exec signals) spikes injection_surface, matching sec_tainted_injection's existing behavior. Full suite: 834 passed, 1 pre-existing xfail. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
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
Closes #105. Landing order per the #102 epic (#344 -> #346 -> #105 -> #106): with #348's persisted, satellite-aware
threat_locationsledger and itscorrelate_against_ledger()primitive already in place, this is a small, self-contained consumer of that infrastructure rather than a new correlation mechanism.galaxyscope.py's Phase 5.5, right after the Active Hemorrhage block: correlates detector.py'sapi(public route) hits against security_lens.py'ssec_db_hooks(raw DB sink) hits viacorrelate_against_ledger(), scoped to the same function -- a public API route directly invoking a DB query in its own body is deterministic proof of an injection funnel, not the flat probabilistic guess # [FEATURE/SAST] Implement Spatial Radar for Database Injection Funnels #105's original proposal described. Feeds a newsec_amplified_sql_injectionsignal, mirroring theamplified_leaks/amplified_rcetelemetry pattern already established for the other post-hoc correlations.max_distance=5(lines) reuses the exact char->line conversion the Active Hemorrhage block just above it already established (150 chars -> 5 lines), applied here to # [FEATURE/SAST] Implement Spatial Radar for Database Injection Funnels #105's originally-proposed 100-char radius. Same-function scoping viacorrelate_against_ledger()does the real precision work; this just guards against sprawling functions where an unrelated DB call happens to share a function with an API route.signal_processor.py's_calc_injection_surface():sec_amplified_sql_injectionis now treated as deterministic proof, exactly likesec_tainted_injectionalready is -- same +500 gravity spike, and it also exempts the score from the "unconfirmed guess" 90% dampener applied when no other explicit io/exec signal is present.Test plan
test_galaxyscope.py:test_worker_amplifies_db_injection_funnel_post_hoc-- a real detector.pyapihit correlated against a mocked security_lensdb_hooksposition, driven through the full worker path.test_signal_processor.py:test_signal_processor_db_injection_funnel-- proves the signal alone (no other io/exec signals) spikesinjection_surface, matchingsec_tainted_injection's existing behavior.python -m pytest tests/ -q-- full suite, 834 passed, 1 pre-existing xfail.🤖 Generated with Claude Code