You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+65-23Lines changed: 65 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -11,45 +11,87 @@ audit2rbac is in the nascent stages of development, and will change internal and
11
11
12
12
## User Instructions
13
13
14
-
1. Obtain a Kubernetes audit log containing all the API requests you expect your user to perform
15
-
* The log must be in JSON format (requires running an API server with `--feature-gates=AdvancedAudit=true` and a`--audit-policy-file` defined... see[documentation](https://kubernetes.io/docs/tasks/debug-application-cluster/audit/#advanced-audit) for more details)
16
-
*`v1alpha1` or `v1beta1` audit events are supported
17
-
* The `Metadata` log level works best to minimize log size
14
+
1. Obtain a Kubernetes audit log containing all the API requests you expect your user to perform:
15
+
* The log must be in JSON format. This requires running an API server with `--feature-gates=AdvancedAudit=true` and an`--audit-policy-file` defined. See[documentation](https://kubernetes.io/docs/tasks/debug-application-cluster/audit/#advanced-audit) for more details.
16
+
*`v1alpha1` or `v1beta1` audit events are supported.
17
+
* The `Metadata` log level works best to minimize log size.
18
18
* To exercise all API calls, it is sometimes necessary to grant broad access to a user or application to avoid short-circuiting code paths on failed API requests. This should be done cautiously, ideally in a development environment.
19
-
2. Identify a specific user you want to generate roles for. This can be a normal user with a username like `bob` or a service account with a username like `system:serviceaccount:my-namespace:my-service-account`.
20
-
3. Run `audit2rbac`, capturing the output
19
+
* A ([sample log](testdata/demo.log)) containing requests from `alice`, `bob`, and the service account `ns1:sa1` is available.
20
+
2. Identify a specific user you want to scan for audit events for and generate roles and role bindings for:
21
+
* Specify a normal user with `--user <username>`
22
+
* Specify a service account with `--serviceaccount <namespace>:<name>`
0 commit comments