Este contenido no está disponible en el idioma seleccionado.
Chapter 8. Configuring the audit log policy
You can control the amount of information that is logged to the API server audit logs by choosing the audit log policy profile to use.
8.1. About audit log policy profiles Copiar enlaceEnlace copiado en el portapapeles!
Audit log profiles define how to log requests that come to the OpenShift API server, the Kubernetes API server, and the OAuth API server.
OpenShift Container Platform provides the following predefined audit policy profiles:
| Profile | Description |
|---|---|
|
| Logs only metadata for read and write requests; does not log request bodies except for OAuth access token requests. This is the default policy. |
|
| In addition to logging metadata for all requests, logs request bodies for every write request to the API servers (
|
|
| In addition to logging metadata for all requests, logs request bodies for every read and write request to the API servers (
|
-
Sensitive resources, such as ,
Secret, andRouteobjects, are never logged past the metadata level.OAuthClient
By default, OpenShift Container Platform uses the
Default
8.2. Configuring the audit log policy Copiar enlaceEnlace copiado en el portapapeles!
You can configure the audit log policy to use when logging requests that come to the API servers.
Prerequisites
-
You have access to the cluster as a user with the role.
cluster-admin
Procedure
Edit the
resource:APIServer$ oc edit apiserver clusterUpdate the
field:spec.audit.profileapiVersion: config.openshift.io/v1 kind: APIServer metadata: ... spec: audit: profile: WriteRequestBodies1 - 1
- Set to
Default,WriteRequestBodies, orAllRequestBodies. The default profile isDefault.
- Save the file to apply the changes.
Verify that a new revision of the Kubernetes API server pods has rolled out. This will take several minutes.
$ oc get kubeapiserver -o=jsonpath='{range .items[0].status.conditions[?(@.type=="NodeInstallerProgressing")]}{.reason}{"\n"}{.message}{"\n"}'Review the
status condition for the Kubernetes API server to verify that all nodes are at the latest revision. The output showsNodeInstallerProgressingupon successful update:AllNodesAtLatestRevisionAllNodesAtLatestRevision 3 nodes are at revision 121 - 1
- In this example, the latest revision number is
12.
If the output shows a message similar to one of the following, this means that the update is still in progress. Wait a few minutes and try again.
-
3 nodes are at revision 11; 0 nodes have achieved new revision 12 -
2 nodes are at revision 11; 1 nodes are at revision 12