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

Update Snyk configuration file to exclude vendor directory with a prefix #1329

Merged

Conversation

kwilczynski
Copy link
Member

What type of PR is this?

/kind other
/assign kwilczynski

What this PR does / why we need it:

Some security scanners, such as the csmock, wrap the Snyk scanner and often hand paths directly to it that are fully qualified. This seems to make Snyk not apply the exclude configuration correctly, since the vendor directory can have a prefix (of some other top-level directory), for example:

"file_name": "cri-tools-3c91ebf539bd2035d60813386f5b1f023937423f/vendor/k8s.io/apimachinery/pkg/util/managedfields/pod.yaml"

The above would result in Snyk not respecting directory exclusion and scanning the content of the vendor directory, which is undesirable.

Thus, we add a wildcard to accept any prefix in front of the vendor directory, should any be provided.

Related to:

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

None

Signed-off-by: Krzysztof Wilczyński <kwilczynski@redhat.com>
@k8s-ci-robot
Copy link
Contributor

@kwilczynski: The label(s) kind/other cannot be applied, because the repository doesn't have them.

In response to this:

What type of PR is this?

/kind other
/assign kwilczynski

What this PR does / why we need it:

Some security scanners, such as the csmock, wrap the Snyk scanner and often hand paths directly to it that are fully qualified. This seems to make Snyk not apply the exclude configuration correctly, since the vendor directory can have a prefix (of some other top-level directory), for example:

"file_name": "cri-tools-3c91ebf539bd2035d60813386f5b1f023937423f/vendor/k8s.io/apimachinery/pkg/util/managedfields/pod.yaml"

The above would result in Snyk not respecting directory exclusion and scanning the content of the vendor directory, which is undesirable.

Thus, we add a wildcard to accept any prefix in front of the vendor directory, should any be provided.

Related to:

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

None

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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 12, 2024
@@ -5,4 +5,5 @@
exclude:
global:
- 'vendor/**'
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need both?

Copy link
Contributor

Choose a reason for hiding this comment

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

We followed up offline. I think this is fine as is.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 16, 2024
Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

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

LGTM

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feiskyer, kwilczynski

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 16, 2024
@k8s-ci-robot k8s-ci-robot merged commit 1b3cb48 into kubernetes-sigs:master Jan 16, 2024
23 checks passed
@kwilczynski kwilczynski deleted the feature/update-snyk-file branch January 17, 2024 19:05
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", 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.

4 participants