Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃尡 Gosec: Run submodules separately #1362

Merged
merged 1 commit into from Sep 22, 2023

Conversation

lentzi90
Copy link
Member

What this PR does / why we need it:

Run gosec for each submodule separately.
Gosec is otherwise using the root go.mod instead of what is in the submodule.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Gosec is otherwise using the root go.mod instead of what is in the
submodule.
@metal3-io-bot metal3-io-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 21, 2023
Copy link
Member

@Rozzii Rozzii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Good catch!

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2023
# It seems like gosec does not handle submodules well. Therefore we skip them and run separately.
gosec -severity medium --confidence medium -quiet -exclude-dir=apis -exclude-dir=hack/tools ./...
(cd apis && gosec -severity medium --confidence medium -quiet ./...)
(cd hack/tools && gosec -severity medium --confidence medium -quiet ./...)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we remove the quite flag to see what files are being tested? Doesn't change anything but better for logging, currently its difficult to see what actually got tested.

Not聽a blocker for this to merge though and good finding
/approve
/hold

Feel free to unhold if quiet is preferable.

@metal3-io-bot metal3-io-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 21, 2023
@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kashifest, Rozzii

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 21, 2023
@lentzi90
Copy link
Member Author

/test-ubuntu-integration-main
/test-centos-e2e-integration-main

Let's discuss the -quiet flag and change it across all repos if we want to remove it
/hold cancel

@metal3-io-bot metal3-io-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 22, 2023
@metal3-io-bot metal3-io-bot merged commit 38a82c9 into metal3-io:main Sep 22, 2023
11 checks passed
@lentzi90 lentzi90 deleted the lentzi90/gosec-submodules branch September 22, 2023 06:53
tuminoid added a commit to Nordix/baremetal-operator that referenced this pull request Dec 1, 2023
Manual cherry-pick of metal3-io#1474.

It also backports metal3-io#1362 that makes gosec.sh actually do something
for non-root modules.

Signed-off-by: Tuomo Tanskanen <tuomo.tanskanen@est.tech>
tuminoid added a commit to Nordix/baremetal-operator that referenced this pull request Dec 1, 2023
Manual cherry-pick of metal3-io#1474.

It also backports metal3-io#1362 that makes gosec.sh actually do something for
non-root modules.

Signed-off-by: Tuomo Tanskanen <tuomo.tanskanen@est.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants