feat: implement scheduled update for OWASP secure headers (issue #275)#281
Open
alegarciadelrio wants to merge 1 commit into
Open
feat: implement scheduled update for OWASP secure headers (issue #275)#281alegarciadelrio wants to merge 1 commit into
alegarciadelrio wants to merge 1 commit into
Conversation
…rce tracking (issue JaredCE#275)
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.
Scheduled updates for OWASP secure headers + source provenance
From #275
Summary
Previously the plugin fetched the OWASP Secure Headers data from a live GitHub raw URL at document-generation time, falling back to a bundled copy only when the request failed. This made doc generation non-deterministic and dependent on a third-party service being reachable.
This PR moves that fetch out of band: the bundled
json/owasp.jsonis now the single source of truth at runtime, and a script + scheduled GitHub Action keep it fresh by opening a PR whenever upstream changes.Changes
src/owasp.jsgetLatest()no longer performs an HTTPS request; it populates defaults directly from the bundledjson/owasp.json. Removed thehttpsdependency from the module.scripts/update-owasp-headers.jsfetches the latest upstreamci/headers_add.json, validates it parses and has aheadersarray before overwriting, and re-serializes with stable formatting so CI diffs stay meaningful. Runnable vianpm run update:owasp.json/owasp.source.jsonrecords the upstream URL, repo, path, branch, resolved commit SHA, and last-update timestamp for the bundled data..github/workflows/update-owasp.ymlruns weekly (Mondays 06:00 UTC) and on manual dispatch, fetching the latest data and opening achore/update-owasp-headersPR for review.test/unit/owasp.spec.jsdroppednockHTTP mocking; tests now exercisegetLatest()against the bundled data andpopulateDefaults()directly for new-release scenarios.Notes for reviewers
contents: writeandpull-requests: writepermissions (already declared in the workflow).last_update_utcbumped to2026-07-19).