-
Notifications
You must be signed in to change notification settings - Fork 197
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
docs(design): Scan Container Images with Trivy Filesystem Scanne #830
docs(design): Scan Container Images with Trivy Filesystem Scanne #830
Conversation
b79a6dd
to
613014f
Compare
``trivy.command: fs`` will change the trivy scan option to pick up vulnerability scans using trivy fs scan command This is the implementation of first approach suggested here aquasecurity#830
``trivy.command: fs`` will change the trivy scan option to pick up vulnerability scans using trivy fs scan command This is the implementation of first approach suggested here aquasecurity#830
613014f
to
b1326c6
Compare
``trivy.command: fs`` will change the trivy scan option to pick up vulnerability scans using trivy fs scan command This is the implementation of first approach suggested here aquasecurity#830
``trivy.command: fs`` will change the trivy scan option to pick up vulnerability scans using trivy fs scan command This is the implementation of first approach suggested here aquasecurity#830
``trivy.command: fs`` will change the trivy scan option to pick up vulnerability scans using trivy fs scan command This is the implementation of first approach suggested here aquasecurity#830
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @deven0t Overall LGTM. I left a few comments to clarify the proposal.
With this approach we have following problem: | ||
1. When image pulled from private registry without ImagePullSecret or service account | ||
(https://kubernetes.io/docs/concepts/containers/images/#configuring-nodes-to-authenticate-to-a-private-registry) | ||
2. When image pulled from managed registry of managed cluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to clarify that in this case typically a service account or cluster node is authorized to pull images from registries and users are not supposed to create imagePullSecrets.
b1326c6
to
ce04af3
Compare
425a646
to
8f5e702
Compare
Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>
8f5e702
to
3687cb5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @deven0t I just pushed a few edits to your branch to cleanup duplicates and some of the implementations details.
To scan a container image of a given K8s workload Starboard will create a corresponding container of a scan Job and | ||
override its entrypoint to invoke Trivy filesystem scanner. | ||
|
||
This approach requires Trivy executable to be downloaded and made available to the entrypoint. We'll do that by adding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could maybe be done with a csi driver as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that I understood this comment. Could you elaborate on how we can use csi driver in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just thinking, instead of copying the file from an init container to an emtpydir, a csi driver in ephemeral mode could mount the file into the container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May not be worth the effort. but could be like:
kind: Pod
apiVersion: v1
metadata:
name: my-csi-app-inline-volume
spec:
containers:
- name: my-frontend
image: busybox
command: [ "sleep", "100000" ]
volumeMounts:
- mountPath: "/trivy"
name: my-csi-volume
volumes:
- name: my-csi-volume
csi:
driver: trivy
the init container to the scan Job. Such init container will use the Trivy container image to copy Trivy executable out | ||
to the emptyDir volume, which will be shared with the other containers. | ||
|
||
Another init container is required to download Trivy vulnerability database and save it to the mounted shared volume. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
``trivy.command: fs`` will change the trivy scan option to pick up vulnerability scans using trivy fs scan command This is the implementation of approach suggested here aquasecurity#830
``trivy.command: fs`` will change the trivy scan option to pick up vulnerability scans using trivy fs scan command This is the implementation of approach suggested here aquasecurity#830
``trivy.command: fs`` will change the trivy scan option to pick up vulnerability scans using trivy fs scan command This is the implementation of approach suggested here aquasecurity#830
``trivy.command: fs`` will change the trivy scan option to pick up vulnerability scans using trivy fs scan command This is the implementation of approach suggested here aquasecurity#830
resolves: #818