Skip to content
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

Update the Trivy configuration #1263

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 @@ -46,7 +46,7 @@ This `blueprints.json` file defines the following blueprints:
- Namespace
- Workload
- Trivy Config Audit Report
- Trivy Vulnerability Report
- Trivy Vulnerability

:::note

Expand All @@ -61,7 +61,7 @@ This `blueprints.json` file defines the following blueprints:

- `Trivy Config Audit Report` represents checks performed by Trivy against a Kubernetes object's configuration

- `Trivy Vulnerability Report` represents the latest vulnerabilities found in a container image of a given Kubernetes workload
- `Trivy Vulnerability` represents the latest vulnerabilities found in a container image of a given Kubernetes workload
:::

Below are the Trivy blueprint schemas used in the exporter:
Expand Down Expand Up @@ -139,24 +139,24 @@ Below are the Trivy blueprint schemas used in the exporter:
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"namespace": {
"title": "Namespace",
"target": "namespace",
"required": false,
"many": false
"kubernetes_resource": {
"title": "Kubernetes Resource",
"target": "workload",
"required": false,
"many": false
}
}
}
```
</details>

<details>
<summary> <b>Trivy vulnerability report blueprint (click to expand)</b> </summary>
<summary> <b>Trivy vulnerability blueprint (click to expand)</b> </summary>

```json showLineNumbers
{
"identifier": "trivyVulnerabilityReport",
"title": "Trivy Vulnerability Report",
"title": "Trivy Vulnerability",
"icon": "Trivy",
"schema": {
"properties": {
Expand Down Expand Up @@ -242,11 +242,11 @@ Below are the Trivy blueprint schemas used in the exporter:
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"namespace": {
"title": "Namespace",
"target": "namespace",
"required": false,
"many": false
"kubernetes_resource": {
"title": "Kubernetes Resource",
"target": "workload",
"required": false,
"many": false
}
}
}
Expand Down Expand Up @@ -290,12 +290,20 @@ Below are the mappings for the Trivy resources:
createdAt: .metadata.creationTimestamp
updatedAt: .report.updateTimestamp
relations:
namespace: .metadata.namespace + "-" + env.CLUSTER_NAME
kubernetes_resource: (
if (.metadata.ownerReferences | length > 0) then
(.metadata.ownerReferences[] | select(.controller == true) |
.name + "-" + .kind + "-" + .metadata.namespace + "-" + env.CLUSTER_NAME
)
else
empty
end
)
```
</details>

<details>
<summary> <b>Trivy vulnerability report mapping (click to expand)</b> </summary>
<summary> <b>Trivy vulnerability mapping (click to expand)</b> </summary>

```yaml showLineNumbers
- kind: aquasecurity.github.io/v1alpha1/vulnerabilityreports
Expand Down Expand Up @@ -324,7 +332,15 @@ Below are the mappings for the Trivy resources:
scannerVersion: .report.scanner.version
createdAt: .metadata.creationTimestamp
relations:
namespace: .metadata.namespace + "-" + env.CLUSTER_NAME
kubernetes_resource: (
if (.metadata.ownerReferences | length > 0) then
(.metadata.ownerReferences[] | select(.controller == true) |
.name + "-" + .kind + "-" + .metadata.namespace + "-" + env.CLUSTER_NAME
)
else
empty
end
)
```
</details>

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.