forked from aquasecurity/starboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow scanning only current revision of deployment (aquasecurit…
…y#870) Adds the OPERATOR_VULNERABILITY_SCANNER_SCAN_ONLY_CURRENT_REVISIONS environment variable to allow scanning only the current revision of a Deployment. If a ReplicaSet is owned by a Deployment the code will check if it's the current revision and scan it for vulnerabilities. Inactive ReplicaSets will be ignored. To check the owner of a ReplicaSet additional permissions to get, list, and watch Deployments is required. Resolves: aquasecurity#858 Resolves: aquasecurity#668 Signed-off-by: Edvin Norling <edvin.norling@xenit.se> Co-authored-by: Zach Stone <z.stone91@gmail.com> Co-authored-by: Daniel Pacak <pacak.daniel@gmail.com>
- Loading branch information
1 parent
5ab3973
commit 53b6ca8
Showing
12 changed files
with
269 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,7 @@ rules: | |
- replicasets | ||
- statefulsets | ||
- daemonsets | ||
- deployments | ||
verbs: | ||
- get | ||
- list | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,7 @@ rules: | |
- replicasets | ||
- statefulsets | ||
- daemonsets | ||
- deployments | ||
verbs: | ||
- get | ||
- list | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
Configuration of the operator's Pod is done via environment variables at startup. | ||
|
||
| NAME | DEFAULT | DESCRIPTION | | ||
| ------------------------------------------- | ---------------------- | ----------- | | ||
| `OPERATOR_NAMESPACE` | N/A | See [Install modes](#install-modes) | | ||
| `OPERATOR_TARGET_NAMESPACES` | N/A | See [Install modes](#install-modes) | | ||
| `OPERATOR_SERVICE_ACCOUNT` | `starboard-operator` | The name of the service account assigned to the operator's pod | | ||
| `OPERATOR_LOG_DEV_MODE` | `false` | The flag to use (or not use) development mode (more human-readable output, extra stack traces and logging information, etc). | | ||
| `OPERATOR_SCAN_JOB_TIMEOUT` | `5m` | The length of time to wait before giving up on a scan job | | ||
| `OPERATOR_CONCURRENT_SCAN_JOBS_LIMIT` | `10` | The maximum number of scan jobs create by the operator | | ||
| `OPERATOR_SCAN_JOB_RETRY_AFTER` | `30s` | The duration to wait before retrying a failed scan job | | ||
| `OPERATOR_BATCH_DELETE_LIMIT` | `10` | The maximum number of config audit reports deleted by the operator when the plugin's config has changed. | | ||
| `OPERATOR_BATCH_DELETE_DELAY` | `10s` | The duration to wait before deleting another batch of config audit reports. | | ||
| `OPERATOR_METRICS_BIND_ADDRESS` | `:8080` | The TCP address to bind to for serving [Prometheus][prometheus] metrics. It can be set to `0` to disable the metrics serving. | | ||
| `OPERATOR_HEALTH_PROBE_BIND_ADDRESS` | `:9090` | The TCP address to bind to for serving health probes, i.e. `/healthz/` and `/readyz/` endpoints. | | ||
| `OPERATOR_CIS_KUBERNETES_BENCHMARK_ENABLED` | `true` | The flag to enable CIS Kubernetes Benchmark scanner | | ||
| `OPERATOR_VULNERABILITY_SCANNER_ENABLED` | `true` | The flag to enable vulnerability scanner | | ||
| `OPERATOR_CONFIG_AUDIT_SCANNER_ENABLED` | `true` | The flag to enable configuration audit scanner | | ||
| `OPERATOR_LEADER_ELECTION_ENABLED` | `false` | The flag to enable operator replica leader election | | ||
| `OPERATOR_LEADER_ELECTION_ID` | `starboard-lock` | The name of the resource lock for leader election | | ||
| NAME | DEFAULT | DESCRIPTION | | ||
| ------------------------------------------------------------ | -------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | ||
| `OPERATOR_NAMESPACE` | N/A | See [Install modes](#install-modes) | | ||
| `OPERATOR_TARGET_NAMESPACES` | N/A | See [Install modes](#install-modes) | | ||
| `OPERATOR_SERVICE_ACCOUNT` | `starboard-operator` | The name of the service account assigned to the operator's pod | | ||
| `OPERATOR_LOG_DEV_MODE` | `false` | The flag to use (or not use) development mode (more human-readable output, extra stack traces and logging information, etc). | | ||
| `OPERATOR_SCAN_JOB_TIMEOUT` | `5m` | The length of time to wait before giving up on a scan job | | ||
| `OPERATOR_CONCURRENT_SCAN_JOBS_LIMIT` | `10` | The maximum number of scan jobs create by the operator | | ||
| `OPERATOR_SCAN_JOB_RETRY_AFTER` | `30s` | The duration to wait before retrying a failed scan job | | ||
| `OPERATOR_BATCH_DELETE_LIMIT` | `10` | The maximum number of config audit reports deleted by the operator when the plugin's config has changed. | | ||
| `OPERATOR_BATCH_DELETE_DELAY` | `10s` | The duration to wait before deleting another batch of config audit reports. | | ||
| `OPERATOR_METRICS_BIND_ADDRESS` | `:8080` | The TCP address to bind to for serving [Prometheus][prometheus] metrics. It can be set to `0` to disable the metrics serving. | | ||
| `OPERATOR_HEALTH_PROBE_BIND_ADDRESS` | `:9090` | The TCP address to bind to for serving health probes, i.e. `/healthz/` and `/readyz/` endpoints. | | ||
| `OPERATOR_CIS_KUBERNETES_BENCHMARK_ENABLED` | `true` | The flag to enable CIS Kubernetes Benchmark scanner | | ||
| `OPERATOR_VULNERABILITY_SCANNER_ENABLED` | `true` | The flag to enable vulnerability scanner | | ||
| `OPERATOR_CONFIG_AUDIT_SCANNER_ENABLED` | `true` | The flag to enable configuration audit scanner | | ||
| `OPERATOR_VULNERABILITY_SCANNER_SCAN_ONLY_CURRENT_REVISIONS` | `false` | The flag to enable vulnerability scanner to only scan the current revision of a deployment | | ||
| `OPERATOR_LEADER_ELECTION_ENABLED` | `false` | The flag to enable operator replica leader election | | ||
| `OPERATOR_LEADER_ELECTION_ID` | `starboard-lock` | The name of the resource lock for leader election | | ||
|
||
## Install Modes | ||
|
||
The values of the `OPERATOR_NAMESPACE` and `OPERATOR_TARGET_NAMESPACES` determine | ||
the install mode, which in turn determines the multitenancy support of the operator. | ||
|
||
| MODE | OPERATOR_NAMESPACE | OPERATOR_TARGET_NAMESPACES | DESCRIPTION | | ||
| --------------- | ------------------ | -------------------------- | ----------- | | ||
| OwnNamespace | `operators` | `operators` | The operator can be configured to watch events in the namespace it is deployed in. | | ||
| MODE | OPERATOR_NAMESPACE | OPERATOR_TARGET_NAMESPACES | DESCRIPTION | | ||
| --------------- | ------------------ | -------------------------- | -------------------------------------------------------------------------------------------------------------- | | ||
| OwnNamespace | `operators` | `operators` | The operator can be configured to watch events in the namespace it is deployed in. | | ||
| SingleNamespace | `operators` | `foo` | The operator can be configured to watch for events in a single namespace that the operator is not deployed in. | | ||
| MultiNamespace | `operators` | `foo,bar,baz` | The operator can be configured to watch for events in more than one namespace. | | ||
| AllNamespaces | `operators` | (blank string) | The operator can be configured to watch for events in all namespaces. | | ||
| MultiNamespace | `operators` | `foo,bar,baz` | The operator can be configured to watch for events in more than one namespace. | | ||
| AllNamespaces | `operators` | (blank string) | The operator can be configured to watch for events in all namespaces. | | ||
|
||
[prometheus]: https://github.com/prometheus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.