-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Apply gosec checks to the codebase, except tests. #9489
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply gosec checks to the codebase, except tests. #9489
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markusthoemmes: 0 warnings.
In response to this:
Proposed Changes
I found the findings somewhat interesting and worth enabling the check if only to force us to think through decisions (like the TLS version for example) and document why we've chosen to disable security features.
Release Note
NONE
/assign @julz @vagababov @mattmoor
/hold
Especially for the TLS Version bump on the image digest resolution. That needs some eyes for sure.
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/test-infra repository.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: markusthoemmes 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 |
The following jobs failed:
Failed non-flaky tests preventing automatic retry of pull-knative-serving-unit-tests:
and 19 more. |
3745fc2
to
9256e45
Compare
The following is the coverage report on the affected files.
|
Codecov Report
@@ Coverage Diff @@
## master #9489 +/- ##
==========================================
- Coverage 88.61% 88.60% -0.02%
==========================================
Files 209 209
Lines 9374 9378 +4
==========================================
+ Hits 8307 8309 +2
Misses 814 814
- Partials 253 255 +2
Continue to review full report at Codecov.
|
@@ -250,7 +250,8 @@ func validateEnv(ctx context.Context, envVars []corev1.EnvVar) *apis.FieldError | |||
|
|||
func validateEnvFrom(envFromList []corev1.EnvFromSource) *apis.FieldError { | |||
var errs *apis.FieldError | |||
for i, envFrom := range envFromList { | |||
for i := range envFromList { | |||
envFrom := envFromList[i] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's wrong with the iterator style?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to understand how we had so few, but I'm guessing this is limited to things where &
is taken or it'd be everywhere. This is pleasantly small, and finally a check to keep us from making this common mistake 🤩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this matters if the function stores the object somehow, but definitely no need to have a possible bug anyway :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably do this in PKG too.
You bet I'm on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
can we put a release note on this re: the TLS version? I think IIUC that means we now require remote registries to have at least TLS 1.2 (which is probably fine, but worth making sure to call out in release notes). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apart from that,
/lgtm
Done @julz /hold cancel |
Proposed Changes
I found the findings somewhat interesting and worth enabling the check if only to force us to think through decisions (like the TLS version for example) and document why we've chosen to disable security features.
Release Note
/assign @julz @vagababov @mattmoor
/hold
Especially for the TLS Version bump on the image digest resolution. That needs some eyes for sure.