ci: add cppcheck + AddressSanitizer + CodeQL quality CI - #26
Merged
Conversation
Brings this module up to the quality bar set by ngx_nftset_access_module PR #1. Runner-direct (no Docker base image) because the existing build.yml already follows that pattern; less new infrastructure to maintain. - cppcheck via .github/workflows/static-analysis.yml `cppcheck` job: apt installs cppcheck, git clones the same NGINX_VERSION (release-1.27.2) the test base image targets, configures nginx so headers resolve under /tmp/nginx-src/objs, then lints src/ngx_http_security_headers_module.c at --check-level=exhaustive. .cppcheck-suppressions keeps the suppression list tight: only missingIncludeSystem, unusedFunction, unmatchedSuppression. - AddressSanitizer via a new `test-asan` job in build.yml: rebuilds nginx with --add-module (static) under -fsanitize=address, then runs the existing Test::Nginx suite. detect_leaks=0 avoids benign LSAN false positives at nginx shutdown; post-prove the step greps /tmp/asan/asan.* and fails on any AddressSanitizer/UBSan report (a sanitized worker can crash without failing every assertion). - CodeQL via .github/workflows/static-analysis.yml `codeql` job: c-cpp language, config-file scopes results to src/. This is a PUBLIC repo, so the upload-to-Security-tab path applies; permissions: security-events: write. analyze@v3 uploads SARIF normally — no SARIF fail-gate needed. Also tightens .gitignore for CLAUDE.md, .cursor/, test-error.log so the working tree stays clean across sessions. Verification (ad-hoc, via the sibling sorted_args base image which already has cppcheck + nginx headers + Test::Nginx): - cppcheck clean (zero findings). - ASAN suite: 108 tests pass across config.t + headers.t, exit 0, zero ASAN/UBSan reports. Part of the weekly GetPageSpeed nginx-module quality-CI rollout. First public repo in the rollout — validates the upload-enabled CodeQL config path.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
dvershinin
added a commit
that referenced
this pull request
Jun 13, 2026
Brings this module up to the quality bar set by ngx_nftset_access_module PR #1. Runner-direct (no Docker base image) because the existing build.yml already follows that pattern; less new infrastructure to maintain. - cppcheck via .github/workflows/static-analysis.yml `cppcheck` job: apt installs cppcheck, git clones the same NGINX_VERSION (release-1.27.2) the test base image targets, configures nginx so headers resolve under /tmp/nginx-src/objs, then lints src/ngx_http_security_headers_module.c at --check-level=exhaustive. .cppcheck-suppressions keeps the suppression list tight: only missingIncludeSystem, unusedFunction, unmatchedSuppression. - AddressSanitizer via a new `test-asan` job in build.yml: rebuilds nginx with --add-module (static) under -fsanitize=address, then runs the existing Test::Nginx suite. detect_leaks=0 avoids benign LSAN false positives at nginx shutdown; post-prove the step greps /tmp/asan/asan.* and fails on any AddressSanitizer/UBSan report (a sanitized worker can crash without failing every assertion). - CodeQL via .github/workflows/static-analysis.yml `codeql` job: c-cpp language, config-file scopes results to src/. This is a PUBLIC repo, so the upload-to-Security-tab path applies; permissions: security-events: write. analyze@v3 uploads SARIF normally — no SARIF fail-gate needed. Also tightens .gitignore for CLAUDE.md, .cursor/, test-error.log so the working tree stays clean across sessions. Verification (ad-hoc, via the sibling sorted_args base image which already has cppcheck + nginx headers + Test::Nginx): - cppcheck clean (zero findings). - ASAN suite: 108 tests pass across config.t + headers.t, exit 0, zero ASAN/UBSan reports. Part of the weekly GetPageSpeed nginx-module quality-CI rollout. First public repo in the rollout — validates the upload-enabled CodeQL config path.
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.
Summary
Brings this module up to the quality bar established by
ngx_nftset_access_modulePR #1. Runner-direct path (no Docker base image) — the existingbuild.ymlalready follows that pattern, so less new infrastructure to maintain.static-analysis.yml'scppcheckjob apt-installs cppcheck, git-clones the samerelease-1.27.2nginx tree the test workflow uses, configures it so headers resolve under/tmp/nginx-src/objs, then lintssrc/ngx_http_security_headers_module.cat--check-level=exhaustive..cppcheck-suppressionsonly mutes noise (missingIncludeSystem,unusedFunction,unmatchedSuppression).test-asanjob inbuild.yml. Rebuilds nginx with--add-module(static) under-fsanitize=address, runs the existing Test::Nginx suite.detect_leaks=0avoids benign LSAN false positives at shutdown; post-provethe step greps/tmp/asan/asan.*and fails on any report.static-analysis.yml'scodeqljob. This is a public repo, soanalyze@v3uploads SARIF normally to the Security tab;permissions: { security-events: write }— the regular path, not the private-repoupload: never+ SARIF gate. Important to validate this branch of the quality-CI pattern in week 1 of the rollout.Also tightens
.gitignoreforCLAUDE.md,.cursor/,test-error.logso the working tree stays clean across sessions.Test plan
config.t+headers.t, exit 0, zero ASAN/UBSan reports.buildmatrix (stable + mainline), newtest-asan,cppcheck,codeql(with upload to Security tab).Part of the weekly GetPageSpeed nginx-module quality-CI rollout. First public repo in the rollout.