Skip to content

Commit

Permalink
feat: Allow configuring GitHub token for Trivy scanner (aquasecurity#172
Browse files Browse the repository at this point in the history
)

Resolves: aquasecurity#43
  • Loading branch information
mozillazg authored Oct 5, 2020
1 parent 27be01e commit a72cf04
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ The following table lists available configuration parameters.
| CONFIGMAP KEY | DEFAULT | DESCRIPTION |
| --------------------- | ------------------------------------------------------ | ----------- |
| `trivy.httpProxy` | N/A | The HTTP proxy used by Trivy to download the vulnerabilities database from GitHub |
| `trivy.githubToken` | N/A | The GitHub personal access token used by Trivy to download the vulnerabilities database from GitHub |
| `trivy.severity` | `UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL` | A comma separated list of severity levels reported by Trivy |
| `trivy.imageRef` | `docker.io/aquasec/trivy:0.9.1` | Trivy image reference |
| `polaris.config.yaml` | [Check the default value here][default-polaris-config] | Polaris configuration file |
Expand Down
12 changes: 12 additions & 0 deletions pkg/find/vulnerabilities/trivy/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,18 @@ func (s *Scanner) PrepareScanJob(_ context.Context, workload kube.Object, spec c
},
},
},
{
Name: "GITHUB_TOKEN",
ValueFrom: &core.EnvVarSource{
ConfigMapKeyRef: &core.ConfigMapKeySelector{
LocalObjectReference: core.LocalObjectReference{
Name: kube.ConfigMapStarboard,
},
Key: "trivy.githubToken",
Optional: pointer.BoolPtr(true),
},
},
},
},
Command: []string{
"trivy",
Expand Down

0 comments on commit a72cf04

Please sign in to comment.