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

PORT-8430 Update the trivy blueprints and mapping #103

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
24 changes: 12 additions & 12 deletions kubernetes/blueprints/trivy-blueprints.json
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,12 @@
"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 @@ -537,12 +537,12 @@
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"namespace": {
"title": "Namespace",
"target": "namespace",
"required": false,
"many": false
}
"kubernetes_resource": {
"title": "Kubernetes Resource",
"target": "workload",
"required": false,
"many": false
}
}
}
]
20 changes: 18 additions & 2 deletions kubernetes/templates/trivy-kubernetes_v1_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,15 @@ resources: # List of K8s resources to list, watch, and export to Port.
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
)

- kind: aquasecurity.github.io/v1alpha1/vulnerabilityreports
selector:
Expand Down Expand Up @@ -234,4 +242,12 @@ resources: # List of K8s resources to list, watch, and export to Port.
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
)