-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mod_policy: Add a new testing module to help server administrators
enforce a configurable level of protocol compliance on their servers and application servers behind theirs. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1221668 13f79535-47bb-0310-9956-ffa450edef68
- Loading branch information
Showing
8 changed files
with
1,407 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 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 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 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,61 @@ | ||
|
||
# | ||
# Load the module if not already present | ||
<IfModule !mod_policy.c> | ||
LoadModule policy_module modules/mod_policy.so | ||
</IfModule> | ||
|
||
# | ||
# Typical policy for static content. | ||
# Swap "enforce" for "log" to complain about violations rather | ||
# than failing. | ||
<Location /> | ||
SetOutputFilter POLICY_TYPE;POLICY_LENGTH;POLICY_KEEPALIVE;POLICY_VARY;POLICY_VALIDATION;POLICY_CONDITIONAL;POLICY_NOCACHE;POLICY_MAXAGE | ||
|
||
# content type must be present and valid, but can be anything<br /> | ||
PolicyType enforce */*<br /> | ||
|
||
# reject if no explicitly declared content length<br /> | ||
PolicyLength enforce<br /> | ||
|
||
# covered by the policy length filter<br /> | ||
PolicyKeepalive ignore<br /> | ||
|
||
# reject if User-Agent appears within Vary headers<br /> | ||
PolicyVary enforce User-Agent<br /> | ||
|
||
# we want to enforce validation<br /> | ||
PolicyValidation enforce<br /> | ||
|
||
# non-functional conditional responses should be rejected<br /> | ||
PolicyConditional enforce<br /> | ||
|
||
# no-cache responses should be rejected<br /> | ||
PolicyNocache enforce<br /> | ||
|
||
# maxage must be at least a day<br /> | ||
PolicyMaxage enforce 86400<br /> | ||
|
||
# request version can be anything<br /> | ||
PolicyVersion ignore HTTP/1.1<br /> | ||
|
||
# define documentation links | ||
PolicyConditionalURL http://httpd.apache.org/docs/trunk/compliance.html#policyconditional | ||
PolicyLengthURL http://httpd.apache.org/docs/trunk/compliance.html#policylength | ||
PolicyTypeURL http://httpd.apache.org/docs/trunk/compliance.html#policytype | ||
PolicyKeepaliveURL http://httpd.apache.org/docs/trunk/compliance.html#policykeepalive | ||
PolicyMaxageURL http://httpd.apache.org/docs/trunk/compliance.html#policymaxage | ||
PolicyNocacheURL http://httpd.apache.org/docs/trunk/compliance.html#policynocache | ||
PolicyValidationURL http://httpd.apache.org/docs/trunk/compliance.html#policyvalidation | ||
PolicyVaryURL http://httpd.apache.org/docs/trunk/compliance.html#policyvary | ||
PolicyVersionURL http://httpd.apache.org/docs/trunk/compliance.html#policyversion | ||
|
||
</Location> | ||
|
||
# | ||
# Server status can be bypassed | ||
<Location /server-status> | ||
PolicyFilter off | ||
</Location> | ||
|
||
|
This file contains 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 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
Oops, something went wrong.