aquasecurity / starboard

Moved to https://github.com/aquasecurity/trivy-operator

Home Page:https://aquasecurity.github.io/starboard/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[CLI] Modify starboard get vulnerabilityreports command to be compatible with kubectl get vulnerabilityreports

danielpacak opened this issue · comments

Currently the starboard get vulnerabilityreports command is not super compatible with kubectl get vulnerabilityreports command. For example, it returns a list of VulnerabilityReport items in YAML, whereas it should just list instances with additional printer columns:

$ starboard get vulnerabilityreports
apiVersion: aquasecurity.github.io/v1alpha1
kind: List
items:
- apiVersion: aquasecurity.github.io/v1alpha1
  kind: VulnerabilityReport
  metadata:
    creationTimestamp: "2021-10-07T10:02:56Z
[...]

vs

$ kubectl get vulnerabilityreports -o wide
NAME                                REPOSITORY      TAG    SCANNER   AGE   CRITICAL   HIGH   MEDIUM   LOW   UNKNOWN
replicaset-nginx-6d4cf56db6-nginx   library/nginx   1.16   Trivy     21h   25         85     87       15    0

Examples

List vulnerability reports for each container of the specified workload.

$ starboard get vulnerabilityreports deploy/nginx
NAME                                REPOSITORY      TAG    SCANNER   AGE
replicaset-nginx-6d4cf56db6-nginx   library/nginx   1.16   Trivy     22h
$ starboard get vulnerabilityreports deploy/nginx --output wide
NAME                                REPOSITORY      TAG    SCANNER   AGE   CRITICAL   HIGH   MEDIUM   LOW   UNKNOWN
replicaset-nginx-6d4cf56db6-nginx   library/nginx   1.16   Trivy     21h   25         85     87       15    0

List the vulnerability report for the specified container of the specified workload

$ starboard get vulnerabilityreports deploy/nginx --container nginx --output wide
NAME                                REPOSITORY      TAG    SCANNER   AGE   CRITICAL   HIGH   MEDIUM   LOW   UNKNOWN
replicaset-nginx-6d4cf56db6-nginx   library/nginx   1.16   Trivy     21h   25         85     87       15    0

Retrieve vulnerability report for the specified container of the specified workload as YAML

$ starboard get vulnerabilityreports deploy/nginx --container nginx --output yaml