Skip to content

Commit bcc1934

Browse files
authored
Doc on configure custom audit policy (#10297)
1 parent 4e91d0e commit bcc1934

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: "Configure Kubernetes Audit Policy"
3+
linkTitle: "Configure Audit Policy"
4+
weight: 25
5+
aliases:
6+
/docs/tasks/cluster/audit-policy/
7+
date: 2025-01-05
8+
description: >
9+
Configure Kubernetes audit policy for control plane nodes to enable comprehensive logging and monitoring
10+
---
11+
12+
## Kubernetes Audit Policy Support
13+
14+
EKS Anywhere configures a default audit policy for all clusters to provide basic logging and monitoring of API server requests. This default policy covers essential security events and resource access patterns.
15+
16+
{{% alert title="Note" color="primary" %}}
17+
All EKS Anywhere clusters include audit logging with a sensible default policy. The `auditPolicyContent` field is only needed if you want to customize the audit policy beyond the default configuration.
18+
{{% /alert %}}
19+
20+
## Customizing Audit Policy (Optional)
21+
22+
If you need to customize the audit policy beyond the default configuration, you can override it by adding the `auditPolicyContent` field to the `controlPlaneConfiguration` section of your cluster configuration:
23+
24+
```yaml
25+
apiVersion: anywhere.eks.amazonaws.com/v1alpha1
26+
kind: Cluster
27+
metadata:
28+
name: my-cluster
29+
spec:
30+
controlPlaneConfiguration:
31+
count: 1
32+
endpoint:
33+
host: "192.168.1.100"
34+
machineGroupRef:
35+
kind: VSphereMachineConfig
36+
name: my-cluster-control-plane
37+
auditPolicyContent: |
38+
apiVersion: audit.k8s.io/v1
39+
kind: Policy
40+
rules:
41+
- level: RequestResponse
42+
resources:
43+
- group: ""
44+
resources:
45+
- pods
46+
- services
47+
- secrets
48+
- configmaps
49+
```
50+
51+
## Updating Audit Policy
52+
53+
To modify the audit policy on an existing cluster:
54+
55+
1. Add/Update the `auditPolicyContent` in your cluster configuration file
56+
2. Run the cluster upgrade command:
57+
58+
```bash
59+
eksctl anywhere upgrade cluster -f my-cluster.yaml
60+
```
61+
62+
The upgrade process will rollout all control plane nodes with updated audit policy configuration.

0 commit comments

Comments
 (0)