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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added gosec G103 #3568

Merged
merged 3 commits into from
Oct 27, 2022
Merged

feat: added gosec G103 #3568

merged 3 commits into from
Oct 27, 2022

Conversation

kadern0
Copy link
Contributor

@kadern0 kadern0 commented Oct 26, 2022

Signed-off-by: Pablo Caderno kaderno@gmail.com

Description

As described on #3545, added gosec G103

@openshift-ci
Copy link

openshift-ci bot commented Oct 26, 2022

Hi @kadern0. Thanks for your PR.

I'm waiting for a stackrox member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@github-actions github-actions bot added the external-contributor To put on issues and PRs from external contributors label Oct 26, 2022
@janisz janisz mentioned this pull request Oct 26, 2022
34 tasks
@janisz
Copy link
Contributor

janisz commented Oct 26, 2022

/ok-to-test

@roxbot
Copy link
Contributor

roxbot commented Oct 26, 2022

Images are ready for the commit at e7f892a.

To use with deploy scripts, first export MAIN_IMAGE_TAG=3.72.x-426-ge7f892a67c.

@0x656b694d
Copy link
Contributor

Hi @kadern0. Thank you for addressing this! Now, please help us to fix the G103 alerts:

pkg/concurrency/error_signal.go:117:51: G103: Use of unsafe calls should be audited (gosec)
	if !atomic.CompareAndSwapPointer(&s.errPtr, nil, unsafe.Pointer(&err)) {
	                                                 ^
pkg/concurrency/error_signal.go:132:12: G103: Use of unsafe calls should be audited (gosec)
		errPtr:  unsafe.Pointer(&[]error{nil}[0]),
		         ^
pkg/concurrency/error_signal.go:147:13: G103: Use of unsafe calls should be audited (gosec)
		statePtr: unsafe.Pointer(newErrorSignalState()),
		          ^

@janisz
Copy link
Contributor

janisz commented Oct 26, 2022

@kadern0 pkg/concurrency/error_signal.go has some issues

Copy link
Contributor

@janisz janisz left a comment

Choose a reason for hiding this comment

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

style checks are failing

Signed-off-by: Pablo Caderno <kaderno@gmail.com>
@kadern0 kadern0 force-pushed the issue-3545-03 branch 2 times, most recently from 6a6df2a to 9dd8f91 Compare October 26, 2022 23:47
@kadern0 kadern0 requested a review from a team as a code owner October 26, 2022 23:47
Signed-off-by: Pablo Caderno <kaderno@gmail.com>
@gitguardian
Copy link

gitguardian bot commented Oct 27, 2022

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id Secret Commit Filename
- Generic High Entropy Secret e7f892a central/metadata/service/service_impl_test.go View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@janisz janisz requested a review from misberner October 27, 2022 10:11
Copy link
Contributor

@misberner misberner left a comment

Choose a reason for hiding this comment

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

LGTM. Now that generics exists, it might be good to add a generic atomic (pointer) value to contain the use of unsafe.Pointers to low-level library code (not in this PR). Maybe Uber's atomic library already has something?

@janisz janisz merged commit abb390e into stackrox:master Oct 27, 2022
ivan-degtiarenko pushed a commit that referenced this pull request Nov 5, 2022
Signed-off-by: Pablo Caderno <kaderno@gmail.com>
Co-authored-by: Tomasz Janiszewski <tomek@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external-contributor To put on issues and PRs from external contributors ok-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants