Skip to content

Commit

Permalink
add starboard-exporter-0.7.11-969c674c8f0121b89cbf4ccbdd743b9071bd921…
Browse files Browse the repository at this point in the history
…3.tgz

starboard-exporter-0.7.11-969c674c8f0121b89cbf4ccbdd743b9071bd9213.tgz-meta/README.md
starboard-exporter-0.7.11-969c674c8f0121b89cbf4ccbdd743b9071bd9213.tgz-meta/main.yaml
starboard-exporter-0.7.11-969c674c8f0121b89cbf4ccbdd743b9071bd9213.tgz-meta/values.schema.json
  • Loading branch information
catalogbot committed Aug 29, 2024
1 parent 88c904b commit 7bfddce
Show file tree
Hide file tree
Showing 5 changed files with 491 additions and 1 deletion.
20 changes: 19 additions & 1 deletion index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44481,6 +44481,24 @@ entries:
urls:
- https://giantswarm.github.io/giantswarm-test-catalog/starboard-exporter-0.7.11-97d36c68fbcfbee6fa7acf6fe3addaf524122740.tgz
version: 0.7.11-97d36c68fbcfbee6fa7acf6fe3addaf524122740
- annotations:
application.giantswarm.io/metadata: https://giantswarm.github.io/giantswarm-test-catalog/starboard-exporter-0.7.11-969c674c8f0121b89cbf4ccbdd743b9071bd9213.tgz-meta/main.yaml
application.giantswarm.io/readme: https://giantswarm.github.io/giantswarm-test-catalog/starboard-exporter-0.7.11-969c674c8f0121b89cbf4ccbdd743b9071bd9213.tgz-meta/README.md
application.giantswarm.io/team: shield
application.giantswarm.io/values-schema: https://giantswarm.github.io/giantswarm-test-catalog/starboard-exporter-0.7.11-969c674c8f0121b89cbf4ccbdd743b9071bd9213.tgz-meta/values.schema.json
config.giantswarm.io/version: 1.x.x
apiVersion: v1
appVersion: 0.7.11-969c674c8f0121b89cbf4ccbdd743b9071bd9213
created: "2024-08-29T14:18:40.70766305Z"
description: A Helm chart for starboard-exporter, which exposes Prometheus metrics
from Aqua VulnerabilityReport and other custom resources.
digest: 6ccf05279deae7c59d35b864fee0149629b0f4805650ba797ffe14c6daadf25a
home: https://github.com/giantswarm/starboard-exporter
icon: https://s.giantswarm.io/app-icons/prometheus/1/light.svg
name: starboard-exporter
urls:
- https://giantswarm.github.io/giantswarm-test-catalog/starboard-exporter-0.7.11-969c674c8f0121b89cbf4ccbdd743b9071bd9213.tgz
version: 0.7.11-969c674c8f0121b89cbf4ccbdd743b9071bd9213
- annotations:
application.giantswarm.io/metadata: https://giantswarm.github.io/giantswarm-test-catalog/starboard-exporter-0.7.11-8cec403800475cb62ba871da2481a431ccd527fa.tgz-meta/main.yaml
application.giantswarm.io/readme: https://giantswarm.github.io/giantswarm-test-catalog/starboard-exporter-0.7.11-8cec403800475cb62ba871da2481a431ccd527fa.tgz-meta/README.md
Expand Down Expand Up @@ -50385,4 +50403,4 @@ entries:
urls:
- https://giantswarm.github.io/giantswarm-test-catalog/zot-1.0.0-21b0af457fca705f0e3ab09f836213c46a310043.tgz
version: 1.0.0-21b0af457fca705f0e3ab09f836213c46a310043
generated: "2024-08-29T14:15:17.106315758Z"
generated: "2024-08-29T14:18:40.706318012Z"
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
[![CircleCI](https://circleci.com/gh/giantswarm/starboard-exporter.svg?style=shield)](https://circleci.com/gh/giantswarm/starboard-exporter)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/giantswarm/starboard-exporter/badge)](https://securityscorecards.dev/viewer/?uri=github.com/giantswarm/starboard-exporter)

# starboard-exporter

Exposes Prometheus metrics from [Trivy Operator][trivy-operator-upstream]'s `VulnerabilityReport`, `ConfigAuditReport`, and other custom resources (CRs).

## Metrics

This exporter exposes several types of metrics:

### CIS Benchmarks

#### Report Summary

A report summary series exposes the count of checks of each status reported in a given `CISKubeBenchReport`. For example:

```shell
starboard_exporter_ciskubebenchreport_report_summary_count{
node_name="bj56o-master-bj56o-000000"
status="FAIL"
} 31
```

#### Section Summary

For slightly more granular reporting, a section summary series exposes the count of checks of each status reported in a given `CISKubeBenchSection`. For example:

```shell
starboard_exporter_ciskubebenchreport_section_summary_count{
node_name="bj56o-master-bj56o-000000"
node_type="controlplane"
section_name="Control Plane Configuration"
status="WARN"
} 4
```

#### Result Detail

A CIS benchmark result info series exposes fields from each instance of an Aqua `CISKubeBenchResult`. For example:

```shell
starboard_exporter_ciskubebenchreport_result_info{
node_name="bj56o-master-bj56o-000000"
node_type="controlplane"
pod="starboard-exporter-859955f485-cwkj6"
section_name="Control Plane Configuration"
test_desc="Client certificate authentication should not be used for users (Manual)"
test_number="3.1.1"
test_status="WARN"
} 1
```

### Vulnerability Reports

#### Report Summary

A summary series exposes the count of CVEs of each severity reported in a given `VulnerabilityReport`. For example:

```shell
starboard_exporter_vulnerabilityreport_image_vulnerability_severity_count{
image_digest="",
image_namespace="demo",
image_registry="quay.io",
image_repository="giantswarm/starboard-operator",
image_tag="0.11.0",
report_name="replicaset-starboard-app-6894945788-starboard-app",
severity="MEDIUM"
} 4
```

This indicates that the `giantswarm/starboard-operator` image in the `demo` namespace contains 4 medium-severity vulnerabilities.

#### Vulnerability Details

A "detail" or "vulnerability" series exposes fields from each instance of an Aqua `Vulnerability`. The value of the metric is the `Score` for the vulnerability. For example:

```shell
starboard_exporter_vulnerabilityreport_image_vulnerability{
fixed_resource_version="1.1.1l-r0",
image_digest="",
image_namespace="demo",
image_registry="quay.io",
image_repository="giantswarm/starboard-operator",
image_tag="0.11.0",
installed_resource_version="1.1.1k-r0",
report_name="replicaset-starboard-app-6894945788-starboard-app",
severity="HIGH",
vulnerability_id="CVE-2021-3712",
vulnerability_link="https://avd.aquasec.com/nvd/cve-2021-3712",
vulnerability_title="openssl: Read buffer overruns processing ASN.1 strings",
vulnerable_resource_name="libssl1.1"
} 7.4
```

This indicates that the vulnerability with the id `CVE-2021-3712` was found in the `giantswarm/starboard-operator` image in the `demo` namespace, and it has a CVSS 3.x score of 7.4.

An additional series would be exposed for every combination of those labels.

### Config Audit Reports

#### Report Summary

A summary series exposes the count of checks of each severity reported in a given `ConfigAuditReport`. For example:

```shell
starboard_exporter_configauditreport_resource_checks_summary_count{
resource_name="replicaset-chart-operator-748f756847",
resource_namespace="giantswarm",
severity="LOW"
} 7
```

#### A Note on Cardinality

For some use cases, it is helpful to export additional fields from `VulnerabilityReport` CRs. However, because many fields contain unbounded arbitrary data, including them in Prometheus metrics can lead to extremely high cardinality. This can drastically impact Prometheus performance. For this reason, we only expose summary data by default and allow users to opt-in to higher-cardinality fields.

### Sharding Reports

In large clusters or environments with many reports and/or vulnerabilities, a single exporter can consume a large amount of memory, and Prometheus may need a long time to scrape the exporter, leading to scrape timeouts. To help spread resource consumption and scrape effort, `starboard-exporter` watches its own service endpoints and will shard metrics for all report types across the available endpoints. In other words, if there are 3 exporter instances, each instance will serve roughly 1/3 of the metrics. This behavior is enabled by default and does not require any additional configuration. To use it, simply change the number of replicas in the Deployment. However, you should read the section on cardinality and be aware that consuming large amounts of high-cardinality data can have performance impacts on Prometheus.

## Customization

Summary metrics of the format described above are always enabled.

To enable an additional detail series *per Vulnerability*, use the `--target-labels` flag to specify which labels should be exposed. For example:

```shell
# Expose only select image and CVE fields.
--target-labels=image_namespace,image_repository,image_tag,vulnerability_id

# Run with (almost) all fields exposed as labels, if you're feeling really wild.
--target-labels=all
```

Target labels can also be set via Helm values:

```yaml
exporter:
vulnerabilityReports:
targetLabels:
- image_namespace
- image_repository
- image_tag
- vulnerability_id
- ...
```
The same can be done for CIS Benchmark Results. To enable an additional detail series *per CIS Benchmark Result*, use the `--cis-detail-report-labels` flag to specify which labels should be exposed. For example:

```shell
# Expose only section_name, test_name and test_status
--cis-detail-report-labels=section_name,test_name,test_status
# Run with (almost) all fields exposed as labels.
--cis-detail-report-labels=all
```

CIS detail target labels can also be set via Helm values:

```yaml
exporter:
CISKubeBenchReports:
targetLabels:
- node_name
- node_type
- section_name
- test_name
- test_status
- ...
```

## Helm

How to install the starboard-exporter using helm:

```shell
helm repo add giantswarm https://giantswarm.github.io/giantswarm-catalog
helm repo update
helm upgrade -i starboard-exporter --namespace <trivy operator namespace> giantswarm/starboard-exporter
```

## Scaling for Prometheus scrape timeouts

When exporting a large volume of metrics, Prometheus might time out before retrieving them all from a single exporter instance. It is possible to automatically scale the number of exporters to keep the scrape time below the configured timeout. To enable HPA scaling based on Prometheus metrics, [here](./docs/custom_metrics_hpa.md)


[trivy-operator-upstream]: https://github.com/aquasecurity/trivy-operator
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
annotations:
application.giantswarm.io/metadata: https://giantswarm.github.io/giantswarm-test-catalog/starboard-exporter-0.7.11-969c674c8f0121b89cbf4ccbdd743b9071bd9213.tgz-meta/main.yaml
application.giantswarm.io/readme: https://giantswarm.github.io/giantswarm-test-catalog/starboard-exporter-0.7.11-969c674c8f0121b89cbf4ccbdd743b9071bd9213.tgz-meta/README.md
application.giantswarm.io/team: shield
application.giantswarm.io/values-schema: https://giantswarm.github.io/giantswarm-test-catalog/starboard-exporter-0.7.11-969c674c8f0121b89cbf4ccbdd743b9071bd9213.tgz-meta/values.schema.json
config.giantswarm.io/version: 1.x.x
chartApiVersion: v1
chartFile: starboard-exporter-0.7.11-969c674c8f0121b89cbf4ccbdd743b9071bd9213.tgz
dateCreated: '2024-08-29T14:18:30.648092'
digest: 6ccf05279deae7c59d35b864fee0149629b0f4805650ba797ffe14c6daadf25a
home: https://github.com/giantswarm/starboard-exporter
icon: https://s.giantswarm.io/app-icons/prometheus/1/light.svg
Loading

0 comments on commit 7bfddce

Please sign in to comment.