PR: Honeytrap header injection fix and rules testable#41
Open
Divyateja2709 wants to merge 20 commits intoOWASP:masterfrom
Open
PR: Honeytrap header injection fix and rules testable#41Divyateja2709 wants to merge 20 commits intoOWASP:masterfrom
Divyateja2709 wants to merge 20 commits intoOWASP:masterfrom
Conversation
Added optional CRS update logic and improved logging for background processes.
Added initial README.md for CRS Auto Update script with planned features and assumptions.
Removed comment about Sidekick code generation.
Added logging and process management for Apache and Filebeat.
Updated the script to enforce SHA256 checksum format and added timeout options for curl and wget commands.
Updated filebeat configuration path to absolute path.
Updated Dockerfile to include TARGETARCH argument and modified file paths.
Added headers to prevent HTTP_PROXY leakage and set authentication headers.
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.
Hi @adrianwinckles,
This PR fixes the place response headers are set (Apache vs ModSecurity), removes rule-order conflicts, and provides deterministic honeytrap behaviour for reliable integration tests in future PRs.
What I changed
Moved Apache Header directives into httpd.conf (within ), ensuring Apache sets response headers.
Removed Apache Header ... Directives from ModSecurity configs (e.g. Modsecurity-extension.conf), and only define response headers as SecRule/SecAction directives for ModSecurity.
Made the target, /dbbackup.<10 digits> deterministic - all rules consolidated and will always yield 401 with basicauth without being short-circuited earlier through phase/order mechanics.
Scoped the bait cookie name by IP address instead of making it global, preventing clients overwriting other's state via ip.* directives.
Improved way we capture the Set-Cookie name from responses to correctly infer the bait cookie name.
Why I changed it
Apache headers should be processed by Apache itself. Define them in httpd.conf instead of ModSecurity config (they will cause startup errors, or simply be ignored silently if added elsewhere).
Consolidating the rules to a single rule preventing phase and order conflicts, allowing env-var handoff (setenv:basicauth, setenv:HONEYTRAPCOOKIE_NAME) to reliably instruct Apache to add the headers.
Using ip.* directives prevents state from being corrupted between multiple clients.
Tests (planned)
Integration test for /db_backup., which checks response status is 401 and includesWWW-Authenticate header (verifying Apache env-var injection is effective).
Integration test to verify that setting of bait cookie is followed by blocking a modified bait cookie on a subsequent request.
Regression test to demonstrate no interference between multiple client state (ip.* scoping).
Why I'm adding tests
The behavior of these honeypot requests are inherently vulnerable to rule-order and phase, env-var handoff, and scope issues. Making these aspects deterministic allow for stable automated testing of the flow.
I'm working on the tests and will be adding them in the next pr