Skip to content

8.3. Audit logs

Querying and analysing Kubernetes and operating system audit events.

The audit logs screen

Overview

The audit log screen lets you query the audit events produced by the Kubernetes API server and by the servers' operating systems. Because it records who did what to which resource and when, it serves security auditing and change history alike.

Audit logs come in two kinds.

  • k8s: events recorded by the Kubernetes API server. These cover the creation, modification and deletion of Kubernetes resources such as pods, Deployments and ConfigMaps, along with access records.
  • OS: events recorded by a server's operating system. These cover system calls, user authentication, command execution and other activity at OS level.

Reach this screen from the Audit logs menu in the left sidebar.

Screen layout

The audit log screen has a filter panel on the left and a main content area on the right.

The filter panel

The filter panel

Set detailed filters for k8s events and OS events separately. Each filter section is an accordion you can expand and collapse, and the close button at the top of the panel hides it altogether to give the event list more room.

k8s filters

FilterDescription
Subject typeThe kind of subject that raised the event: user, service account or system
NamespaceThe Kubernetes namespace the event occurred in. Several can be selected
ResourceThe kind of resource affected. Several of pods, deployments, services, secrets, configmaps, nodes, namespaces, persistentvolumeclaims, roles, rolebindings and clusterroles can be selected
ActionThe operation performed. Several of get, list, watch, create, update, patch, delete and deletecollection can be selected
Status codeThe HTTP response code range: 2xx (success), 4xx (client error) or 5xx (server error)
RBAC decisionThe result of the permission check: all, allow or deny

Note: selecting a value in the k8s filters switches the type to k8s automatically.

OS filters

FilterDescription
ActionThe kind of OS event. Several of SYSCALL, EXECVE, USER_AUTH, USER_LOGIN, USER_CMD, SERVICE_START, SERVICE_STOP, NETFILTER_CFG and AVC can be selected
HostThe hostname of the server the event occurred on. Several can be selected
UserThe OS user that raised the event
ExecutableThe path of the executable involved. Partial text matches (/usr or docker, for instance)

Note: selecting a value in the OS filters switches the type to OS automatically.

Note: a badge beside each filter section's title gives the number of filters currently applied.

The main content area

To the right of the filter panel sit the search bar, the query options bar, the event trend chart and the event list, in that order.

Main features

Searching and querying events

The audit event list
  1. Type your search term into the Message filter field at the top of the screen.
  2. Click Query, or press Enter, to run the search.

Filtering by type and result

The filter panel

Combine the following conditions in the query bar to narrow which events are shown.

  • Type: all, k8s or OS. Choosing k8s or OS expands only that section's detailed filters in the left panel.
  • Result: the Success, Failure, Info and Unknown checkboxes choose which results to show. Several can be selected at once.
  • Main events only: when ticked, OS audit events are shown without their related records, leaving only the main events. This is on by default.

Tip: to look for permission denials, set the type to k8s and the RBAC decision to deny. This gets you to unauthorised access attempts quickly.

Sorting and how many to show

The audit log query controls — sorting and the display limit
  • Sort: newest first or oldest first.
  • Limit: the maximum number of events to show at once — 50, 100, 200, 500 or 1000.

Switching view mode

Switching view mode — the table/raw toggle
  • Table: shows the events as a table with time, type, action, user and target columns. A colour marker at the left of each row follows the result (success: green, failure: red, info: blue).
  • Raw: shows the events' original data as text.

The audit event trend chart

The audit event trend chart

A chart above the event list shows how audit events trended over the selected time range. k8s and OS events are distinguished by colour (k8s: blue, OS: orange), so you can see at a glance where events concentrate.

Drag on the chart to zoom into a particular period.

The event list header gives the total number of events found, along with the k8s/OS split and the success/failure counts.

Looking at an event in detail

The audit event detail dialog

Click a row in the event list to open its detail dialog.

k8s event details:

ItemDescription
TimestampWhen the event occurred
UserThe user or service account that performed the operation
Subject typeUser, service account or system
ActionThe operation performed (get, create, delete and so on)
NamespaceThe target resource's namespace
ResourceThe kind of resource affected
Resource nameThe name of the resource affected
Status codeThe HTTP response code
RBAC decisionAllow or deny
Source IPThe IP address the request came from

OS event details:

ItemDescription
TimestampWhen the event occurred
HostThe server the event occurred on
UserThe OS user that raised the event
UID / AUIDThe user ID and the audit user ID
ActionThe kind of event (SYSCALL, USER_AUTH and so on)
ExecutableThe path of the executable involved
CommandThe command involved
PID / PPIDThe process ID and the parent process ID

The bottom of the detail dialog shows the raw data as JSON, so you can see the event in full.

The audit event list

An OS event row may carry an expand button. Click it and the related records belonging to that event unfold as a tree, letting you see the several system call records that make up one OS audit event together.

Note: clear the Main events only option to see the full OS event list with the related records included.

CogentAI analysis

The CogentAI analysis button on an audit event row

Where CogentAI is enabled, you can analyse audit events with AI for security insight.

Requesting analysis from the event list:

  1. Click the CogentAI icon in the Actions column of the event row you want analysed.
  2. The CogentAI widget opens and that audit event's structured information and raw data are passed to the AI.
  3. Read the AI's analysis of the audit event from a security point of view.

Requesting analysis from the detail dialog:

  1. Click an event row to open the detail dialog.
  2. Click the CogentAI Insight button below the summary.
  3. Read the AI's analysis.

What each kind of analysis looks at:

  • k8s audit logs: identifies RBAC (role-based access control) policy issues, abnormal access patterns and privilege escalation attempts, and recommends how to tighten security.
  • OS audit logs: analyses from an OS security point of view, detecting suspicious system calls, unauthorised process execution and file system access, and advising on how to respond.

Tip: type a follow-up question into the CogentAI widget to ask for deeper analysis of a particular security issue.

Copying an event

The copy button on an audit event row

Click the copy button on an event row to copy that event's content to the clipboard, ready to paste into another tool for further analysis.

Showing and hiding the filter panel

The audit logs screen
  • Click Hide filters at the top of the filter panel to collapse it.
  • Click the filter icon at the left edge of the screen to expand it again.
  • Where filters are active, the collapsed filter bar carries a visual marker.

Note: whether the filter panel is shown is saved in the browser and persists into your next visit.

Adjusting the time range

Change the range in the time range picker at the top of the screen and the audit events from that period are shown. This is useful for narrowing your analysis to the events either side of an incident.

  • Risks - detecting and managing Kubernetes security risks
  • Log viewer - searching and analysing application logs together
  • Nodes - node state and resource monitoring
  • Settings - managing user permissions and system settings