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

snyker fails to update policy file ignore rules #5

Closed
jlp-craigmorten opened this issue Mar 19, 2024 · 1 comment · Fixed by #7
Closed

snyker fails to update policy file ignore rules #5

jlp-craigmorten opened this issue Mar 19, 2024 · 1 comment · Fixed by #7

Comments

@jlp-craigmorten
Copy link
Contributor

Issue

Details

There are setups with snyk that prevent CLI based ignores, see below:

$ npx snyk ignore --id=123
Only administrators can ignore issues. Please contact an administrator to ignore this issue.

When this is the case @asos/snyker will fail to add the ignores to the .snyk policy file.

Given the ignores have a known format:

ignore:
  <VULNERABILITY_ID>:
    - '*':
        reason: <REASON_OF_CHOICE>
        expires: <EXPIRY_OF_CHOICE>

@asos/snyker could feasibly still update the .snyk policy file by manually crafting the required yaml instead of relying directly on snyk ignore --id=<VULNERABILITY_ID> to handle it.

This could either be in place of using the Snyk CLI or as a fallback when such errors occur.

Pertinent code: https://github.com/ASOS/snyker/blob/main/src/index.js#L405-L407

@jlp-craigmorten
Copy link
Contributor Author

I've resolved this in my fork, see https://github.com/jlp-craigmorten/snyker/releases/tag/5.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant