Skip to content

Commit 40dd234

Browse files
committed
docs: [#251] document Security tab viewing behavior
- Add comment in workflow explaining filter behavior - Add section in ADR explaining how to view results by branch/PR - Add PR comment with direct links to view scan results The default Security tab filters by 'is:open branch:main' which hides PR branch results. Users must use specific PR/branch filters to see results before merging to main.
1 parent 098add2 commit 40dd234

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

.github/workflows/docker-security-scan.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ jobs:
162162
# Upload each SARIF file with CodeQL Action using unique categories.
163163
# The category parameter enables proper alert tracking per image.
164164
# Must use CodeQL Action (not gh API) - API doesn't support category field.
165+
#
166+
# VIEWING RESULTS:
167+
# - For pull requests: /security/code-scanning?query=pr:NUMBER+is:open
168+
# - For branches: /security/code-scanning?query=is:open+branch:BRANCH-NAME
169+
# - For main branch: /security/code-scanning?query=is:open+branch:main (default view)
170+
# The default Security tab filters by "is:open branch:main" which only shows
171+
# alerts from the main branch, not from PR branches.
165172
- name: Upload project provisioned-instance SARIF
166173
if: always()
167174
uses: github/codeql-action/upload-sarif@v4

docs/decisions/docker-security-scan-exit-code-zero.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@ This philosophy is summarized as: **"Trivy detects, GitHub Security decides, CI
113113
- Results in "multiple SARIF runs with same category" error
114114
- Cannot distinguish alerts between different images
115115

116+
## Viewing Security Results
117+
118+
Security scan results are uploaded to GitHub's Security tab, but the default view filters by `is:open branch:main`. This means:
119+
120+
- **Pull Request Results**: Must use filter `pr:NUMBER is:open` (e.g., `/security/code-scanning?query=pr:256+is:open`)
121+
- **Branch Results**: Must use filter `is:open branch:BRANCH-NAME` for non-main branches
122+
- **Main Branch Results**: Visible in default view after merging to main
123+
124+
Results uploaded from PR branches are not visible in the default Security tab view because the default filter excludes them. This is GitHub's standard behavior for code scanning across all analysis tools.
125+
116126
## Related Decisions
117127

118128
- [GitHub Actions Workflow Structure](https://github.com/torrust/torrust-tracker-deployer/pull/256) - How the three-job structure enables this philosophy

0 commit comments

Comments
 (0)