Skip to content

Commit 83b6b67

Browse files
authored
Merge pull request #38415 from mburke5678/GH#27862
GH#27862 Put must gather audit logs back
2 parents 95ad295 + 1100e1d commit 83b6b67

File tree

4 files changed

+101
-6
lines changed

4 files changed

+101
-6
lines changed

modules/about-must-gather.adoc

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,48 @@
1111
[id="about-must-gather_{context}"]
1212
= About the must-gather tool
1313

14-
The `oc adm must-gather` CLI command collects the information from your cluster that is most likely needed for debugging issues, such as:
14+
The `oc adm must-gather` CLI command collects the information from your cluster that is most likely needed for debugging issues, including:
1515

1616
* Resource definitions
17-
* Audit logs
1817
* Service logs
1918

20-
You can specify one or more images when you run the command by including the `--image` argument. When you specify an image, the tool collects data related to that feature or product.
19+
By default, the `oc adm must-gather` command uses the default plug-in image and writes into `./must-gather.local`.
2120

22-
When you run `oc adm must-gather`, a new pod is created on the cluster. The data is collected on that pod and saved in a new directory that starts with `must-gather.local`. This directory is created in the current working directory.
21+
Alternatively, you can collect specific information by running the command with the appropriate arguments as described in the following sections:
2322

23+
* To collect data related to one or more specific features, use the `--image` argument with an image, as listed in a following section.
24+
+
25+
For example:
26+
+
27+
[source,terminal]
28+
----
29+
$ oc adm must-gather --image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel8:v4.9.0
30+
----
31+
32+
* To collect the audit logs, use the `-- /usr/bin/gather_audit_logs` argument, as described in a following section.
33+
+
34+
For example:
35+
+
36+
[source,terminal]
37+
----
38+
$ oc adm must-gather -- /usr/bin/gather_audit_logs
39+
----
40+
+
41+
[NOTE]
42+
====
43+
Audit logs are not collected as part of the default set of information to reduce the size of the files.
44+
====
45+
46+
When you run `oc adm must-gather`, a new pod with a random name is created in a new project on the cluster. The data is collected on that pod and saved in a new directory that starts with `must-gather.local`. This directory is created in the current working directory.
47+
48+
For example:
49+
50+
[source,terminal]
51+
----
52+
NAMESPACE NAME READY STATUS RESTARTS AGE
53+
...
54+
openshift-must-gather-5drcj must-gather-bklx4 2/2 Running 0 72s
55+
openshift-must-gather-5drcj must-gather-s8sdh 2/2 Running 0 72s
56+
...
57+
----
2458
// todo: table or ref module listing available images?
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt/logging_events_monitoring/virt-collecting-virt-data.adoc
4+
// * support/gathering-cluster-data.adoc
5+
6+
ifeval::["{context}" == "gathering-cluster-data"]
7+
:support:
8+
endif::[]
9+
ifeval::["{context}" == "audit-log-view"]
10+
:viewing:
11+
endif::[]
12+
13+
[id="gathering-data-audit-logs_{context}"]
14+
= Gathering audit logs
15+
16+
ifdef::support[]
17+
You can gather audit logs, which are a security-relevant chronological set of records documenting the sequence of activities that have affected the system by individual users, administrators, or other components of the system. You can gather audit logs for:
18+
19+
* etcd server
20+
* Kubernetes API server
21+
* OpenShift OAuth API server
22+
* OpenShift API server
23+
24+
endif::support[]
25+
ifdef::viewing[]
26+
You can use the must-gather tool to collect the audit logs for debugging your cluster, which you can review or send to Red Hat Support.
27+
endif::viewing[]
28+
29+
.Procedure
30+
31+
. Run the `oc adm must-gather` command with the `-- /usr/bin/gather_audit_logs` flag:
32+
+
33+
[source,terminal]
34+
----
35+
$ oc adm must-gather -- /usr/bin/gather_audit_logs
36+
----
37+
38+
. Create a compressed file from the `must-gather` directory that was just created in your working directory. For example, on a computer that uses a Linux operating system, run the following command:
39+
+
40+
[source,terminal]
41+
----
42+
$ tar cvaf must-gather.tar.gz must-gather.local.472290403699006248 <1>
43+
----
44+
<1> Replace `must-gather-local.472290403699006248` with the actual directory name.
45+
46+
. Attach the compressed file to your support case on the link:https://access.redhat.com[Red Hat Customer Portal].
47+
48+
49+
ifeval::["{context}" == "gathering-cluster-data"]
50+
:!support:
51+
endif::[]
52+
ifeval::["{context}" == "audit-log-view"]
53+
:!viewing:
54+
endif::[]

security/audit-log-view.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ include::modules/nodes-nodes-audit-log-basic-viewing.adoc[leveloffset=+1]
1616
// Filtering audit logs
1717
include::modules/security-audit-log-filtering.adoc[leveloffset=+1]
1818

19+
// Gathering audit logs
20+
include::modules/gathering-data-audit-logs.adoc[leveloffset=+1]
21+
1922
[id="viewing-audit-logs-additional-resources"]
2023
== Additional resources
2124

25+
* xref:../support/gathering-cluster-data.adoc#about-must-gather_gathering-cluster-data[Must-gather tool]
2226
* link:https://github.com/kubernetes/apiserver/blob/master/pkg/apis/audit/v1/types.go#L72[API audit log event structure]
2327
* xref:../security/audit-log-policy-config.adoc#audit-log-policy-config[Configuring the audit log policy]
2428
* xref:../logging/cluster-logging-external.adoc#cluster-logging-external[Forwarding logs to third party systems]

support/gathering-cluster-data.adoc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ It is recommended to provide:
2121
include::modules/about-must-gather.adoc[leveloffset=+1]
2222

2323
// Gathering data about your cluster for Red Hat Support
24-
include::modules/support-gather-data.adoc[leveloffset=+1]
24+
include::modules/support-gather-data.adoc[leveloffset=+2]
2525

2626
// Gathering data about specific features
27-
include::modules/gathering-data-specific-features.adoc[leveloffset=+1]
27+
include::modules/gathering-data-specific-features.adoc[leveloffset=+2]
28+
29+
// Gathering audit logs
30+
include::modules/gathering-data-audit-logs.adoc[leveloffset=+2]
2831

2932
// Obtain your cluster identifier
3033
include::modules/support-get-cluster-id.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)