Repository navigation
fix(config): pass excluded_semantic_detection_headers and detection_max_scan_seconds through from_security_config - #83
Merged
Conversation
…ax_scan_seconds through from_security_config Both detection fields were dropped by from_security_config. They now reach the engine through DetectionExclusionConfig, with tests that show each value installed and a spent scan time budget blocking.
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 #82
from_security_confignow passes the two detection fields it dropped into the engine'sDetectionExclusionConfig:excluded_semantic_detection_headers, available on the engine since guard-core-rs #137. Listing it alone now installs the exclusion block, which previously only the four exclusion lists and the category set did.detection_max_scan_seconds, mapped toDetectionExclusionConfig::max_scan_seconds. A value other than the engine default of 10.0 installs the block on its own. A config with the default value and an explicitly empty category set still installs nothing, as before.With these two, every detection field of
SecurityConfigreaches the engine.Tests
Three tests per adapter failed before the change and pass now: the semantic header set reaches the installed engine config, a custom cap alone installs the block with that value, and a spent budget (cap 0.0) makes the engine answer a threat for a benign request (HTTP 400), while the default config forwards it.
I ran everything
ci.ymlruns: check, fmt, clippy with-D warnings, the pattern-probe build,cargo test,cargo doc, the 100% line coverage gate, and the MSRV 1.92 check and test, all against my checkout of the engine branch.Merge order
This needs Guard-Core/guard-core-rs #139 merged first: the
max_scan_secondsfield andscan_budgetmodule exist only there, and this repo's CI checks out the engine's master as its sibling. I did not touchCargo.lock.