-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: record real response status for IIS audit log F part #3613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
A13501350
wants to merge
7
commits into
owasp-modsecurity:v2/master
Choose a base branch
from
A13501350:pr/iis-audit-log-fpart-status
base: v2/master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
54fe0b0
fix: record real response status for IIS audit log F part
A13501350 7492907
fix: suppress bogus audit log F-part 500 for IIS internal redirects
A13501350 166ed5e
ci: run CRS regression smoke tests against the IIS connector
A13501350 cdaf71a
ci: assert no bogus 500 in audit log F parts and drop FTW artifact up…
A13501350 559d5d9
ci: match marker against request header (B part) when locating F part
A13501350 b327db1
fix: use nullptr instead of NULL in iis/mymodule.cpp
A13501350 6753f1b
fix: add X-Content-Type-Options: nosniff header in web.config
A13501350 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # File-based audit log for go-ftw standard mode + its log-marker rule. | ||
| # Absolute Windows path avoids Apache server_root-relative resolution; | ||
| # c:\inetpub\logs is granted to the IIS worker process by the workflow. | ||
| SecAuditEngine RelevantOnly | ||
| SecAuditLogRelevantStatus "^(?:5|4(?!04))" | ||
| SecAuditLogParts ABIJDEFHZ | ||
| SecAuditLogType Serial | ||
| SecAuditLog c:\inetpub\logs\modsec_audit.log | ||
|
|
||
| # With SecAuditEngine RelevantOnly a plain 'log' action is not enough to | ||
| # force the (200 status) marker transaction into the audit log. | ||
| SecRule REQUEST_HEADERS:X-CRS-Test "@rx ^.*$" "id:999999,pass,phase:1,auditlog,msg:'X-CRS-Test %{MATCHED_VAR}',ctl:ruleRemoveById=1-999999" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # CRS regression-suite config (rule 900005). Loaded before the rule files: | ||
| # it is a phase-1 SecAction whose tx vars the rules read. DetectionOnly | ||
| # engine (rules fire + log, never block) - how the CRS regression suite | ||
| # is meant to run. | ||
| SecAction "id:900005,phase:1,nolog,pass,ctl:ruleEngine=DetectionOnly,ctl:ruleRemoveById=910000,setvar:tx.blocking_paranoia_level=4,setvar:tx.crs_validate_utf8_encoding=1,setvar:tx.arg_name_length=100,setvar:tx.arg_length=400,setvar:tx.total_arg_length=64000,setvar:tx.max_num_args=255,setvar:tx.max_file_size=64100,setvar:tx.combined_file_sizes=65535" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| logfile: c:\inetpub\logs\modsec_audit.log | ||
| logmarkerheadername: X-CRS-Test | ||
| mode: "default" | ||
| testoverride: | ||
| input: | ||
| dest_addr: "localhost" | ||
| port: 80 | ||
| protocol: "http" | ||
| # IIS/HTTP.SYS behavior differs from the Apache CRS baseline. | ||
| # go-ftw's include wins over exclude, so these use the ignore map. | ||
| ignore: | ||
| "^920100-(2|8|12)$": "HTTP.SYS accepts request lines Apache rejects with 400" | ||
| "^920100-(10|14)$": "unknown verb becomes method INVALID; rebuilt request line matches 920100 whitelist regex" | ||
| "^920100-4$": "HTTP.SYS rejects CONNECT with 400" | ||
| "^920180-(1|3)$": "HTTP.SYS rejects CL-less POST with 411 before the module runs" | ||
| "^920181-1$": "ARR returns 502 on CL+TE and 920181 fires (Apache strips CL)" | ||
| "^920200-4$": "HTTP.SYS rejects malformed Range with 400" | ||
| "^920290-1$": "HTTP.SYS accepts empty Host (200) that Apache rejects with 400" | ||
| "^920350-(1|3)$": "HTTP.SYS rejects IP Host header with 400" | ||
| "^920430-8$": "HTTP.SYS returns 505 for HTTP/4.0" | ||
| "^920520-7$": "HTTP.SYS rejects malformed Accept-Encoding with 400" | ||
| "^920620-1$": "HTTP.SYS rejects duplicate Content-Type with 400" | ||
| "^941101-2$": "URI contains double quotes; HTTP.SYS rejects it before the module runs" | ||
|
|
||
| include: "^(913|920|930|941)" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <configuration> | ||
| <system.webServer> | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| <httpProtocol> | ||
| <customHeaders> | ||
| <add name="X-Content-Type-Options" value="nosniff" /> | ||
| </customHeaders> | ||
| </httpProtocol> | ||
| <rewrite> | ||
| <rules> | ||
| <rule name="ReverseProxyToAlbedo" stopProcessing="true"> | ||
| <match url="(.*)" /> | ||
| <action type="Rewrite" url="http://localhost:8080/{R:1}" /> | ||
| </rule> | ||
| </rules> | ||
| </rewrite> | ||
| </system.webServer> | ||
| </configuration> | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like I said before, legacy code is usually not convenient to refactor.