8000 #2324 Adapt 'location' attribute in Trivy parser to match a URL format by BorisShek · Pull Request #2725 · secureCodeBox/secureCodeBox · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private void setFindingLocation(SecureCodeBoxFinding secureCodeBoxFinding, Defec
URI.create(secureCodeBoxFinding.getLocation());
result.setEndpoints(Collections.singletonList(secureCodeBoxFinding.getLocation()));
} catch (IllegalArgumentException e) {
log.warn("Couldn't parse the secureCodeBox location, because it: {} is not a vailid uri: {}", e, secureCodeBoxFinding.getLocation());
log.warn("Couldn't parse the secureCodeBox location, because it: {} is not a valid uri: {}", e, secureCodeBoxFinding.getLocation());
}
}
}
Expand Down
19 changes: 19 additions & 0 deletions scanners/trivy/.helm-docs.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,25 @@ One way to avoid that is to [preemptively download](https://aquasecurity.github.
:::

In case only a single scan or very few are run, and you want to avoid the small performance overhead, client/server mode can be disabled by setting `--set="trivyDatabaseCache.enabled=false"` during helm install.

## Parser specifics
Our parser customizes the format of Trivy scan results by using a unique `location` attribute that employs a custom URL format (`scb://trivy/`) with URL parameters. These parameters are extracted from the corresponding scan result file attributes and vary depending on the type of scan performed — either a Kubernetes (K8S) resource scan or a container image scan.

### URL Format Patterns
#### For Kubernetes (K8S) Resource Scans:
`scb://trivy/?ClusterName=<ClusterName>&Namespace=<Namespace>&Kind=<Kind>&Name=<Name>`

##### Parameters:
- ClusterName: The name of the Kubernetes cluster (optional).
- Namespace: The namespace within the cluster (optional).
- Kind: The type of Kubernetes resource (e.g., Deployment, Service, Pod).
- Name: The name of the resource.

#### For Container Image Scans:
`scb://trivy/?ArtifactName=<ArtifactName>`

##### Parameter:
- ArtifactName: The name (and optionally the tag) of the container image.
{{- end }}

{{- define "extra.chartConfigurationSection" -}}
Expand Down
Loading
0