Skip to content

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

Merged
rm3l merged 4 commits into
redhat-developer:mainfrom
Fortune-Ndlovu:RHIDP-12639-rhdh-must-gather-security-scans
Oct 12, 2026
Merged

rm3l merged 4 commits into
redhat-developer:mainfrom
Fortune-Ndlovu:RHIDP-12639-rhdh-must-gather-security-scans

Conversation

@Fortune-Ndlovu

Copy link
Copy Markdown
Member

Description

This PR adds all security requirements for rhdh-must-gather, for example:
--SonarCloud Configuration, (.sonarcloud.properties)
--Gosec Security Scanner (Makefile)
--PR Workflow Integration (.github/workflows/test.yaml)
--Enhanced Renovate Configuration (.github/renovate.json)

Which issue(s) does this PR fix or relate to

PR acceptance criteria

  • Tests
  • Documentation

How to test changes / Special notes to the reviewer

…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>
@openshift-ci
openshift-ci Bot requested review from gazarenkov and rm3l October 9, 2026 10:13
@rhdh-qodo-merge

Copy link
Copy Markdown

PR Summary by Qodo

Add Go security scanning and security-focused dependency policies

✨ Enhancement ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Add SonarCloud analysis scope and a local Gosec target for Go security scanning.
• Run Gosec during applicable PR checks and include an initial SARIF findings report.
• Expand Renovate policies for dependency updates and vulnerability alerts.
Diagram

graph TD
  PR["PR checks"] --> Make["Make target"] --> Gosec["Gosec scanner"] --> Report[("SARIF report")]
  Scope["SonarCloud scope"] --> Sonar["SonarCloud analysis"]
  Renovate["Renovate policies"] --> Updates["Dependency PRs"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Upload SARIF from CI instead of committing a report
  • ➕ Keeps findings current for each PR
  • ➕ Makes Gosec results available to GitHub code scanning without a large generated file in the repository
  • ➖ Requires a SARIF upload step and appropriate code-scanning permissions
  • ➖ Requires an explicit policy for which findings should block a PR

Recommendation: Keep the Make-based scanner and separate SonarCloud and Renovate configuration, but publish the generated SARIF from CI rather than relying on the committed snapshot. Currently Gosec runs with -no-fail and the workflow neither uploads its report nor gates on findings, so scanner findings alone cannot fail the check.

Files changed (5) +5728 / -1

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

Expand dependency and vulnerability update policies

• Replaces the recommended preset with best-practices and signing, rebasing, and action-pinning presets. Adds Go version constraints, module tidying, update grouping and automerge rules, plus labeled vulnerability alerts.

.github/renovate.json

test.yamlRun Gosec in applicable PR checks +6/-0

Run Gosec in applicable PR checks

• Adds a Gosec step to the unit-test job when the existing changed-files condition is true. The step runs the Make target but does not upload its SARIF output.

.github/workflows/test.yaml

.sonarcloud.propertiesDefine SonarCloud source and test scope +14/-0

Define SonarCloud source and test scope

• Includes repository sources and Go tests in analysis while excluding tests from source scope. Excludes Dockerfiles to avoid a SonarCloud warning about digest-pinned images.

.sonarcloud.properties

MakefileAdd a pinned Gosec installation and scan target +42/-0

Add a pinned Gosec installation and scan target

• Adds a versioned local Gosec installer and a target that scans Go packages and writes SARIF. The scanner uses -no-fail, leaving findings to be handled outside the Make target.

Makefile

gosec.sarifCommit an initial Gosec findings report +5532/-0

Commit an initial Gosec findings report

• Adds a generated SARIF snapshot with 179 Go security findings, including path-traversal and file-permission warnings. It is a committed report, not an upload or remediation of those findings.

gosec.sarif

@rhdh-qodo-merge

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Base images miss automated digest fixes ✗ Dismissed
Description
The new Docker package rule disables digest updates as well as pin updates, although both
production Containerfiles already pin their base images by digest. When a base image is republished
with a new digest under its existing tag, the Docker minor-update rule does not cover that update
type, so Renovate will not propose it.
Code

.github/renovate.json[R51-59]

+      "enabled": false,
+      "matchDatasources": [
+        "docker"
+      ],
+      "matchUpdateTypes": [
+        "pin",
+        "pinDigest",
+        "digest"
+      ],
Relevance

●●● Strong

The team accepted a closely matching finding that Renovate blocked Docker digest refreshes.

PR-#214

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The disabled rule explicitly matches Docker digest updates. Both Containerfiles use digest-pinned
base images, and the separate enabled rule matches only minor versions.

.github/renovate.json[49-75]
Containerfile[3-17]
.rhdh/docker/Containerfile[5-24]

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

## Issue description
Disabling Docker digest updates prevents automated updates to the already digest-pinned build and runtime base images.
## Fix Focus Areas
- .github/renovate.json[49-61]
- Containerfile[3-17]
- .rhdh/docker/Containerfile[5-24]
## Recommended Fix
Remove `digest` from the disabled update types, or add an explicit enabled digest-update rule for the base images in both Containerfiles.

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


2. Security findings do not affect pull requests ✗ Dismissed
Description
make gosec uses -no-fail and writes findings to gosec.sarif, but the new workflow step neither
evaluates nor uploads that file. When the scanner detects an issue, the job can still pass and the
finding is not submitted to GitHub Code Scanning.
Code

Makefile[103]

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

●●● Strong

The workflow neither fails on gosec findings nor uploads its generated SARIF report.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The target suppresses finding-based failure and writes a SARIF file. The added workflow step ends
after invoking the target, while the committed report already contains error-level results.

Makefile[100-103]
.github/workflows/test.yaml[69-75]
gosec.sarif[4-29]

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 are written to SARIF while `-no-fail` lets the PR job pass, and no workflow step consumes the report.
## Fix Focus Areas
- Makefile[100-103]
- .github/workflows/test.yaml[69-75]
## Recommended Fix
Either remove `-no-fail` so findings fail the job, or upload the generated SARIF to code scanning with the required workflow permission and an explicit policy for acting on findings.

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



Remediation recommended

3. Go dependencies stop receiving minor updates ✗ Dismissed
Description
The wildcard minor-update rule sets enabled: false for every package, with no later rule
re-enabling minor updates for Go dependencies. When a dependency in go.mod has a minor release,
Renovate will not create its routine update PR, leaving those upgrades to manual intervention.
Code

.github/renovate.json[29]

+      "enabled": false,
Relevance

●●● Strong

Accepted precedent flags patch-only Renovate rules that block digest and other intended updates.

PR-#214

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new rule matches every package's minor updates and disables them. The subsequent Go rule enables
patches only, while go.mod declares the affected dependencies.

.github/renovate.json[28-38]
.github/renovate.json[91-113]
go.mod[5-19]

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 wildcard rule disables all minor dependency updates, including the repository's Go dependencies.
## Fix Focus Areas
- .github/renovate.json[28-38]
- .github/renovate.json[91-113]
## Recommended Fix
Remove the blanket minor-update disable or narrow it to the dependencies intentionally held back; retain an enabled rule for routine Go minor update PRs.

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


4. CI build-tool updates can merge unreviewed ✗ Dismissed
Description
The Docker patch rule enables automerge for the entire Docker datasource, which includes the
existing custom manager for the HERMETO_IMAGE Makefile variable rather than just Containerfiles. A
patch update to that image can therefore merge without review, and CI then runs the updated image
against the repository and dependency cache.
Code

.github/renovate.json[R86-89]

+      "additionalBranchPrefix": "dockerfile ",
+      "groupName": "All dockerfile images",
+      "automerge": true,
+      "pinDigests": false
Relevance

●● Moderate

Broad Renovate Docker automerge creates a credible security concern, but no closely matching
precedent exists.

PR-#218

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The added rule matches all Docker-datasource patches and enables automerge. The existing custom
manager registers the Makefile's Hermeto image as a Docker dependency, and the build action executes
that image.

.github/renovate.json[77-90]
.github/renovate.json[146-156]
Makefile[12-13]
.github/actions/docker-build/action.yaml[65-79]

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 Docker-wide patch automerge rule also covers the Hermeto image used to fetch dependencies during CI builds.
## Fix Focus Areas
- .github/renovate.json[77-90]
- .github/renovate.json[146-156]
- Makefile[12-13]
## Recommended Fix
Scope Docker patch automerge to the intended Containerfile images, or add a later rule disabling automerge for the Hermeto image.

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


Grey Divider

Context sources
⚠️ Tickets: not configured — ticket URL found in PR but could not be fetched — check ticket provider credentials
✅ Compliance rules (platform): 7 rules
✅ Cross-repo context — repo relationships
  Explored: repo: redhat-developer/rhdh-chart (sha: 1905a0af) — View relationship
  Explored: repo: redhat-developer/rhdh (sha: e51f3cf2) — View relationship
  Explored: repo: redhat-developer/rhdh-operator (sha: cb5e5689) — View relationship
  Explored: repo: redhat-developer/rhdh-plugins (sha: ba7839ed) — View relationship
Review mode: Auto: ⚖️ Balanced: Security configuration changes warrant careful review, but logic density remains moderate.

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 Makefile Resolved
Comment thread .github/renovate.json Resolved
Comment thread .github/renovate.json Resolved
Comment thread .github/renovate.json Resolved
…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>
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

PR images are available (for 1 week):

  1. quay.io/rhdh-community/rhdh-must-gather:pr-481
  2. quay.io/rhdh-community/rhdh-must-gather:pr-481-9649e59a4

Comment thread .github/workflows/test.yaml Resolved
Comment thread Makefile Resolved
Comment thread .sonarcloud.properties Resolved
@rm3l

rm3l commented Oct 12, 2026

Copy link
Copy Markdown
Member

/cherrypick release-2.1

@openshift-cherrypick-robot

Copy link
Copy Markdown

@rm3l: once the present PR merges, I will cherry-pick it on top of release-2.1 in a new PR and assign it to you.

Details

In response to this:

/cherrypick release-2.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

…onarCloud exclusions

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-481
  2. quay.io/rhdh-community/rhdh-must-gather:pr-481-87fac1059

Comment thread .sonarcloud.properties Resolved
@rm3l
rm3l enabled auto-merge (squash) October 12, 2026 15:01
Co-authored-by: Armel Soro <armel@rm3l.org>
@github-actions

Copy link
Copy Markdown
Contributor

PR images are available (for 1 week):

  1. quay.io/rhdh-community/rhdh-must-gather:pr-481
  2. quay.io/rhdh-community/rhdh-must-gather:pr-481-a4808fc70

@rm3l
rm3l merged commit a81ffa4 into redhat-developer:main Oct 12, 2026
@openshift-cherrypick-robot

Copy link
Copy Markdown

@rm3l: #481 failed to apply on top of branch "release-2.1":

Applying: Add 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)
Using index info to reconstruct a base tree...
M	.github/renovate.json
M	Makefile
Falling back to patching base and 3-way merge...
Auto-merging .github/renovate.json
CONFLICT (content): Merge conflict in .github/renovate.json
Auto-merging Makefile
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Add 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)

Details

In response to this:

/cherrypick release-2.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

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.

4 participants