Snyk Dockerfile Scan + slack v5f#407
Snyk Dockerfile Scan + slack v5f#407Wolfgang-Romanowski wants to merge 2 commits intoopendatahub-io:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| if: > | ||
| github.event_name != 'pull_request_target' || | ||
| github.event.label.name == 'safe-to-test' || | ||
| github.event.pull_request.head.repo.full_name == github.repository |
There was a problem hiding this comment.
When should this third condition be applied?
First condition applies for anything else apart from PRs from forks (I suppose), second covers pull_request_target with proper label.
There was a problem hiding this comment.
1: should be applied for all events except for pull request target, this includes events from forks which are safe since they run in the forks context.
2: applies for events with manual labeling
3: events from within the same repository
fork PRs run safely under condition 1 via regular pull request events, not pull request target.
sorry for not making that clearer
There was a problem hiding this comment.
Thanks, makes me think, why do you have there both pull_request and pull_request_target?
There was a problem hiding this comment.
No worries at all!
So the reason why is because pull_request automatically scans trusted PRs within the same reo and pull_request_target ends up allowing scanning fork PRs after manual approval via label.
Without the dual approach we'd either never scan fork PRs or always give fork PRs access to secrets
|
Ran the code in my fork, it seems that there are missing ${PYTHON_VERSION}:${IMAGE_TAG} placeholder values in Individual Dockerfile Analysis. Edit: I suppose it is taken from the Dockerfile itself, where we have placeholder, right? |
i can try updating the extraction logic to use build time values or read from a config files where values are defined but from what i gather the scan itself is fine and its just a confusing display |
ece56c1 to
cb47c38
Compare
5c5f99d to
171f8bb
Compare
171f8bb to
f539730
Compare
Description
Adds revamp to automated Snyk security scanning for training runtime Dockerfiles.
Scans differentiate between inherited base image vulnerabilities and new vulnerabilities introduced by Dockerfile changes.
Trigger Conditions:
will require:
SNYK_TOKENsecretSLACK_WEBHOOK_URLsecretTested
Tested on fork thoroughly