Report additional modern security headers (INFO)#3050
Merged
Conversation
Adds X-Permitted-Cross-Domain-Policies (already highlighted in emphasize_stuff_in_headers() but never reported), Origin-Agent-Cluster, Document-Policy, Clear-Site-Data, Reporting-Endpoints, Report-To and NEL to run_security_headers(), all presence-only/INFO, matching how COOP/COEP/CORP were added in testssl#2619.
Collaborator
|
Thanks! |
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.
testssl.sh already highlights
X-Permitted-Cross-Domain-Policiesinemphasize_stuff_in_headers()(testssl.sh:3285 / 3335) but never actually reports it inrun_security_headers()— this PR closes that inconsistency, and while there adds a few other modern security headers testssl currently misses.Headers added (all INFO, presence-only — no correctness logic), appended to the existing
header_and_svrtyarray:X-Permitted-Cross-Domain-Policies(already emphasized but not reported)Origin-Agent-ClusterDocument-PolicyClear-Site-DataReporting-EndpointsReport-ToNELThis follows the same approach as #2619 (COOP/COEP/CORP added as INFO) and slots into the generic loop — the existing
INFO)case handles output, so there are no other code changes, and nohelp()/man-page change is needed (individual headers aren't documented).The last three (
Reporting-Endpoints/Report-To/NEL) are reporting-oriented rather than hardening controls — happy to drop them if you consider them out of scope; the rest stand on their own.Tested against hosts that send these headers (e.g. Cloudflare-fronted sites send
Report-To/NEL) and hosts that don't — reported once each, no side effects. 5-space indent, no tabs;shellcheck --severity=errorclean.