forked from aquasecurity/starboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for Trivy client-server mode (aquasecurity#240)
Resolves: aquasecurity#213 Signed-off-by: Daniel Pacak <[email protected]>
- Loading branch information
1 parent
9be5bc8
commit 668f7a7
Showing
29 changed files
with
5,485 additions
and
683 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: trivy-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: trivy-server | ||
namespace: trivy-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: trivy-server | ||
name: trivy-server | ||
namespace: trivy-server | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: trivy-server | ||
template: | ||
metadata: | ||
labels: | ||
app: trivy-server | ||
spec: | ||
serviceAccountName: trivy-server | ||
automountServiceAccountToken: false | ||
volumes: | ||
- name: trivy-cache | ||
emptyDir: {} | ||
containers: | ||
- name: trivy-server | ||
image: docker.io/aquasec/trivy:0.12.0 | ||
command: | ||
- trivy | ||
- server | ||
- --debug | ||
- --listen | ||
- 0.0.0.0:4954 | ||
volumeMounts: | ||
- name: trivy-cache | ||
mountPath: /root/.cache/trivy | ||
ports: | ||
- containerPort: 4954 | ||
name: twirp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: trivy-server | ||
namespace: trivy-server | ||
labels: | ||
app: trivy-server | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
app: trivy-server | ||
ports: | ||
- protocol: TCP | ||
port: 4954 | ||
targetPort: 4954 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Trivy Server | ||
|
||
> **Note:** This is just for testing Trivy in client-server mode. We should move away the YAML Manifests from this repository. | ||
> Maybe even provide a Helm chart for Trivy server. | ||
## Deploy with Static YAML Manifests | ||
|
||
``` | ||
$ kubectl apply -f deploy/trivy-server | ||
``` | ||
|
||
``` | ||
$ kubectl run trivy-client -it --rm --image aquasec/trivy:0.12.0 --command -- sh | ||
/ # trivy client --format json --remote http://trivy-server.trivy-server:4954 wordpress:4.9 | ||
/ # trivy client --format json --remote http://trivy-server.trivy-server:4954 wordpress:5.5 | ||
``` |
Oops, something went wrong.