Skip to content

[release-2.1] feat(security): Add all security scanning requirements rhdh-must-gather [RHDP-12639] - #511

Merged
rm3l merged 5 commits into
redhat-developer:release-2.1from
Fortune-Ndlovu:cherry-pick-481-to-release-2.1
Oct 12, 2026
Merged

rm3l merged 5 commits into
redhat-developer:release-2.1from
Fortune-Ndlovu:cherry-pick-481-to-release-2.1

Conversation

@Fortune-Ndlovu

Copy link
Copy Markdown
Member

Cherry-pick of #481 to release-2.1.

Adds all security scanning requirements for RHDP-12639 to make rhdh-must-gather GA ready:

  • SonarCloud Configuration (.sonarcloud.properties)
  • Gosec Security Scanner (Makefile)
  • PR Workflow Integration (.github/workflows/test.yaml)
  • Enhanced Renovate Configuration (.github/renovate.json)
  • Documentation (SECURITY_SCANNING.md)

Fortune-Ndlovu and others added 4 commits October 12, 2026 17:25
…st-gather GA ready. SonarCloud Configuration, (.sonarcloud.properties), Gosec Security Scanner (Makefile), PR Workflow Integration (.github/workflows/test.yaml), Enhanced Renovate Configuration (.github/renovate.json), Documentation (../SECURITY_SCANNING.md)

Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>
…if is a generated security scan report that should not be committed to the repository. Added it to .gitignore to prevent future accidental commits.

Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>
…onarCloud exclusions

Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>
Co-authored-by: Armel Soro <armel@rm3l.org>
@rhdh-qodo-merge

Copy link
Copy Markdown

PR Summary by Qodo

Add security scanning and dependency alert configuration

✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Add SonarCloud analysis settings and a versioned Gosec target for Go security scans.
• Run Gosec on relevant pull requests and keep its generated SARIF report untracked.
• Expand Renovate update policies and enable vulnerability alerts.
Diagram

graph TD
  CI["PR tests"] --> MK["Make gosec"] --> GS["Gosec scanner"] --> SR["Local SARIF"]
  SRC["Repository files"] --> GS
  SRC --> SON["SonarCloud analysis"]
  SRC --> REN["Renovate policy"] --> VUL["Vulnerability alerts"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Publish Gosec SARIF to GitHub code scanning
  • ➕ Makes Gosec findings available for native alert triage rather than only in a local report
  • ➖ Requires an upload step, appropriate workflow permissions, and an explicit alert policy

Recommendation: Keep the versioned Make target for reproducible local and CI scans, but consider uploading its SARIF report if Gosec findings must be visible or enforceable for GA. The current -no-fail scan writes a report without publishing it; SonarCloud integration does not publish Gosec findings.

Files changed (5) +199 / -1

Enhancement (2) +48 / -0
test.yamlRun Gosec in pull-request tests +6/-0

Run Gosec in pull-request tests

• Adds a Gosec step to the unit-test job when its changed-files check succeeds. The step does not upload the generated SARIF report.

.github/workflows/test.yaml

MakefileAdd a versioned Gosec scan target +42/-0

Add a versioned Gosec scan target

• Installs Gosec v2.29.0 locally when needed and adds a non-failing scan that writes SARIF output. Scanner format and report path are configurable.

Makefile

Other (3) +151 / -1
renovate.jsonExpand dependency update and vulnerability policies +134/-1

Expand dependency update and vulnerability policies

• Adds best-practice presets, Go constraints, update grouping, and targeted Docker, Go, and workflow update rules. Enables labeled vulnerability alerts while retaining release-branch rules.

.github/renovate.json

.gitignoreIgnore generated Gosec reports +3/-0

Ignore generated Gosec reports

• Prevents the local gosec.sarif scan output from being accidentally committed.

.gitignore

.sonarcloud.propertiesDefine SonarCloud analysis scope +14/-0

Define SonarCloud analysis scope

• Adds source and test scopes and excludes test files from source analysis. Also excludes two Containerfiles from SonarCloud analysis.

.sonarcloud.properties

@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Release branches receive minor image updates ✓ Resolved
Description
The new Docker-minor package rule sets enabled: true for release branches after the release policy
disables non-patch updates. For release branches matching its pattern, this re-enables minor image
updates that the existing release rules do not allow.
Code

.github/renovate.json[R83-86]

+      "matchBaseBranches": [
+        "main",
+        "/^release-\\d+\\..*/"
+      ],
Relevance

●●● Strong

PR #214 accepted enforcing patch-only release branches; this rule re-enables minor Docker updates.

PR-#214

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The earlier rules disable release updates and re-enable only patches and Docker digests. The later
new rule enables Docker minor updates on both main and matching release branches.

.github/renovate.json[18-38]
.github/renovate.json[75-87]
.github/workflows/container-build.yaml[4-8]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new Docker-minor rule overrides the existing release-branch restriction.
## Fix Focus Areas
- .github/renovate.json[75-87]
## Recommended Fix
Remove release branches from this rule's `matchBaseBranches`, or explicitly adopt and document a changed release policy if minor image updates are intended.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Workflow actions are not auto-merged 🐞 Bug ≡ Correctness
Description
The rule described as automerging workflow actions matches github-runners rather than the
datasource for uses: action dependencies. The repository’s SHA-pinned workflow actions therefore
do not receive this rule’s minor- and patch-update automerge setting.
Code

.github/renovate.json[R140-142]

+      "matchDatasources": [
+        "github-runners"
+      ],
Relevance

●●● Strong

This is a deterministic datasource mismatch: workflow actions do not use the github-runners
datasource.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new rule matches only github-runners, while the cited workflow dependencies are action
references in uses: entries, not runner-image references.

.github/renovate.json[138-148]
.github/workflows/test.yaml[22-29]
.github/workflows/test.yaml[38-41]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The workflow-action automerge rule matches runner images instead of action dependencies.
## Fix Focus Areas
- .github/renovate.json[138-148]
## Recommended Fix
Change the rule to match the GitHub Actions datasource used for workflow `uses:` references. Keep a separate `github-runners` rule only if runner-image updates also need this behavior.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗



Informational

3. Release image digest updates stop 🐞 Bug ≡ Correctness
Description
The new Docker datasource rule disables digest updates after the existing release-branch rule
enables Dockerfile digest updates. Digest-pinned images on release branches match both rules, so the
later disable suppresses their update proposals.
Code

.github/renovate.json[R67-71]

+      "matchUpdateTypes": [
+        "pin",
+        "pinDigest",
+        "digest"
+      ],
Relevance

● Weak

The same Docker digest-rule conflict was explicitly rejected in PR #481.

PR-#481

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The release Dockerfile rule enables digest updates, but the later Docker datasource rule disables
the same update type without a branch restriction. The repository has digest-pinned Dockerfile
images to which both rules apply.

.github/renovate.json[29-38]
.github/renovate.json[62-73]
.rhdh/docker/Containerfile[1-6]
.rhdh/docker/Containerfile[20-23]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A new global Docker digest disable overrides the existing release-branch Dockerfile digest exception.
## Fix Focus Areas
- .github/renovate.json[29-38]
- .github/renovate.json[62-73]
## Recommended Fix
Scope the digest-disable rule to branches where it is wanted, or place a matching release-branch digest exception after it so digest updates remain enabled on releases.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


4. Security findings disappear after CI 🐞 Bug ⛨ Security
Description
make gosec passes -no-fail and writes its findings only to gosec.sarif, which the PR workflow
neither uploads nor reads. When a scan detects a vulnerability, the step succeeds and the report is
lost with the runner, so neither the PR check nor GitHub code scanning exposes the finding.
Code

Makefile[103]

+	$(GOSEC) -no-fail -exclude-generated -fmt $(GOSEC_FMT) -out $(GOSEC_OUTPUT_FILE) ./...
Relevance

● Weak

The identical gosec SARIF-loss finding was explicitly rejected in PR #481.

PR-#481

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The target suppresses finding-based failures and writes SARIF to a file. The new workflow step only
invokes that target; the workflow has no step to consume or upload the file, and its permissions do
not include security-events write.

Makefile[31-33]
Makefile[100-103]
.github/workflows/test.yaml[13-15]
.github/workflows/test.yaml[69-74]
.github/workflows/test.yaml[128-142]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Gosec findings cannot fail the PR check and its SARIF report is discarded after the job.
## Fix Focus Areas
- Makefile[100-103]
- .github/workflows/test.yaml[69-73]
## Recommended Fix
Either remove `-no-fail` so findings fail CI, or upload the generated SARIF to code scanning with the necessary workflow permissions. If findings must not fail CI, ensure the report is still published or retained.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


Grey Divider

Context sources
✅ Compliance rules (platform): 7 rules
✅ Cross-repo context — repo relationships
Review mode: Auto: ⚖️ Balanced: Downgraded extended -> standard: change is below the extended eligibility bar (hunks 8/18, lines 200/200; both must reach the floor). Router rationale: Multiple independent CI, scanner, SonarCloud, and Renovate behaviors require redundant review.

Grey Divider

Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread .github/renovate.json Resolved
Comment thread .github/renovate.json Resolved
@rm3l
rm3l enabled auto-merge (squash) October 12, 2026 16:29
rm3l
rm3l previously approved these changes Oct 12, 2026
Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR images are available (for 1 week):

  1. quay.io/rhdh-community/rhdh-must-gather:pr-511
  2. quay.io/rhdh-community/rhdh-must-gather:pr-511-5440b9717

@rm3l
rm3l merged commit 8901b73 into redhat-developer:release-2.1 Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants