-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use audit policy and splunk secret from resource references. (#5)
- Loading branch information
Showing
11 changed files
with
155 additions
and
304 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,26 @@ | ||
# gardener-extension-audit | ||
|
||
Provides a Gardener extension for sending audit traces to a backend and forwarding them into the shoot cluster. | ||
Provides a Gardener extension for managing kube-apiserver audit logs for a shoot cluster. | ||
|
||
The extension spins up a fluentbit-based audit sink in the seed's shoot namespace prior to starting the shoot's API server. Therefore, it is required to run this extension with the reconcile lifecycle policy `BeforeKubeAPIServer`. | ||
|
||
This sink has the ability to buffer audit logs to a persistent volume and send them to the supported backends. | ||
|
||
## Specifying An Audit Policy | ||
|
||
A custom audit policy can be natively configured by Gardener in the shoot spec's API server configuration under `.spec.kubernetes.kubeAPIServer.auditConfig.auditPolicy.configMapRef.name`. | ||
|
||
## Supported Backends | ||
|
||
- Log (just logs to the container, only for devel-purposes) | ||
- Cluster Forwarding (forwards audit logs into a pod in the shoot cluster, should not be used for production purposes) | ||
- Splunk | ||
|
||
## Development | ||
|
||
This extension can be developed in the gardener-local devel environment. | ||
|
||
1. Start up the local devel environment | ||
1. The extension's docker image can be pushed into Kind using `make push-to-gardener-local` | ||
1. Install the extension `kubectl apply -k example/` | ||
1. Parametrize the `example/shoot.yaml` and apply with `kubectl -f example/shoot.yaml` |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: custom-audit-policy | ||
namespace: garden-local | ||
data: | ||
policy: | | ||
apiVersion: audit.k8s.io/v1 | ||
kind: Policy | ||
omitStages: | ||
- "RequestReceived" | ||
rules: | ||
- level: RequestResponse | ||
resources: | ||
- group: "" | ||
resources: ["pods"] | ||
- level: Metadata | ||
resources: | ||
- group: "" | ||
resources: ["pods/log", "pods/status"] |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: splunk-secret | ||
namespace: garden-local | ||
stringData: | ||
token: <hec token> | ||
ca: | | ||
-----BEGIN CERTIFICATE----- | ||
<cert> | ||
-----END CERTIFICATE----- | ||
-----BEGIN CERTIFICATE----- | ||
<cert> | ||
-----END CERTIFICATE----- |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.