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 G101 #3566

Merged
merged 2 commits into from
Oct 27, 2022
Merged

feat: added gosec G101 #3566

merged 2 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 G101

@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

@0x656b694d
Copy link
Contributor

Hi @kadern0. Thank you for addressing this. Now, please help us to fix the false positive G101 alerts:

pkg/satoken/paths.go:6:2: G101: Potential hardcoded credentials (gosec)
	ServiceAccountTokenDir = `/run/secrets/kubernetes.io/serviceaccount`
	^
pkg/auth/htpasswd/reader_test.go:16:8: G101: Potential hardcoded credentials (gosec)
	const htpasswd = `user:$2y$05$zOuqmZyoE82NGG4iitj91OrOQBoCrn0d/LiyHL833EvBzm0Wyy85.
other:$2y$05$b9mSdCSh6OnHhRDG/DAXee8USMpWYMK5XZcBZwFjQnCD5xQOu.F8y
admin:$2y$05$l.sGXGtYVWaoywFO06gDZeIHME8BFKWRuNv5PG4RLGUk0Yq/M4c86`
operator/pkg/proxy/status_condition.go:11:2: G101: Potential hardcoded credentials (gosec)
	SecretReconcileErrorReason = `ProxyConfigSecretReconcileError`
	^

@roxbot
Copy link
Contributor

roxbot commented Oct 26, 2022

Images are ready for the commit at 06d6b71.

To use with deploy scripts, first export MAIN_IMAGE_TAG=3.72.x-421-g06d6b71bb8.

@janisz
Copy link
Contributor

janisz commented Oct 26, 2022

@kadern0 Two files are not passing gosec check

@janisz
Copy link
Contributor

janisz commented Oct 26, 2022

I think we can issue //nolint:gosec:G101 and they are false positives

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>
@gitguardian
Copy link

gitguardian bot commented Oct 26, 2022

⚠️ GitGuardian has uncovered 2 secrets 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 secrets in your pull request
GitGuardian id Secret Commit Filename
- Generic High Entropy Secret 06d6b71 central/metadata/service/service_impl_test.go View secret
- Generic High Entropy Secret 06d6b71 sensor/common/centralclient/client_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 secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  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!

@kadern0 kadern0 force-pushed the issue-3545-01 branch 4 times, most recently from 440d4d1 to 06d6b71 Compare October 27, 2022 00:51
Signed-off-by: Pablo Caderno <kaderno@gmail.com>
@janisz janisz merged commit 0704c5e 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>
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

4 participants