Skip to main content

KALT stands for Kubernetes Audit Logs Toolkit

A tool to analyse existing audit.log files, possibly helping to write meaningful audit_policy.yml.

Install

$ pip install pykalt

Usage

$ kalt --help
Usage: kalt [OPTIONS] FILENAMES...

  Processes and displays statistics about FILENAMES audit log files.

Options:
  -k, --keys TEXT      List of keys to count against. Can be used multiple
                       times. Defaults to ["verb"].
  -f, --filters TEXT   List of key=value used to select a subset of audit
                       logs. Can be used multiple times. Example: --filter
                       "objectRef.resource=secrets" --filter "verb=get", the
                       operator must be in ['=','!=','>=','<=','+=','-='].
                       Defaults to [].
  -l, --limit INTEGER  Limit the output to the nth biggest results. Example:
                       --limit 10. Defaults to 0, meaning no limit.
  -d, --dump           Dump events rather than displaying statistics.
  -g, --groups         Group by user.groups.
  --help               Show this message and exit.

Filters

Possible filters:

  • key=value : keeps events for which the event[key] is equal to value
  • key!=value : keeps events for which the event[key] is different than value
  • key>=value : keeps events for which the event[key] is greater or equal than value (i.e for datetimes)
  • key<=value : keeps events for which the event[key] is lesser or equal than value
  • key+=value : keeps events for which the event[key] is a list and value is in it
  • key-=value : keeps events for which the event[key] is a list and value is not in it

Example

$ kalt -f 'user.groups+=system:serviceaccounts' -k user.username -k verb -k objectRef.resource -l 10 audit.log
user.username                                                       verb    objectRef.resource       count    percent
------------------------------------------------------------------  ------  ---------------------  -------  ---------
system:serviceaccount:kube-system:resourcequota-controller          get                                370      35.92
system:serviceaccount:kube-system:generic-garbage-collector         get                                370      35.92
system:serviceaccount:kube-system:snapshot-webhook                  watch   volumesnapshotclasses       48       4.66
system:serviceaccount:default:e5383c71-a248-4790-b6f2-18ccda0a024f  create  pods                        32       3.11
system:serviceaccount:vmware-system-csi:vsphere-csi-webhook         watch   configmaps                  28       2.72
system:serviceaccount:default:e5383c71-a248-4790-b6f2-18ccda0a024f  get                                 27       2.62
system:serviceaccount:kube-system:coredns                           watch   endpointslices              26       2.52
system:serviceaccount:kube-system:coredns                           watch   namespaces                  26       2.52
system:serviceaccount:kube-system:coredns                           watch   services                    26       2.52
system:serviceaccount:pks-system:fluent-bit                         get     pods                        25       2.43

Events count: 1030 (1.81% of 56915 events)
Period: 0 days, 2 hours and 32 mins; from "2025-06-03 11:33:07" to "2025-06-03 13:05:32"

Release files for pykalt 1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pykalt 1.5
File Size Uploaded
pykalt-1.5.tar.gz 16.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pykalt 1.5
File Interpreter ABI Platform
pykalt-1.5-py3-none-any.whl Python 3 none any Details

Total release size: 33.7 kB

Release files / pykalt-1.5.tar.gz

Download URL pykalt-1.5.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
efdaf44971dd6fc06f7ea478d6bff4a11690f49930d05b74e11eb658ac50685b
BLAKE2b-256 checksum
How to use checksums
e4b86b61315736828f70fd0410a27d797b138d851be7bb64d9bfd56bd0527000
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / pykalt-1.5-py3-none-any.whl

Download URL pykalt-1.5-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1ba1e486491edd37e121d03db40fba4031b9717424135085f368e96ad12e695
BLAKE2b-256 checksum
How to use checksums
fa50ed0dc6150827fe0a8a9c2668b35ac991456c6af5f207928d5ca517eb833b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

1.5 This release

2 release files

1.4

2 release files

1.3

2 release files

1.2

2 release files

1.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page