Skip to main content

KALT is a Kubernetes Audit Logs Toolkit. It alows analyzing Kubernetes audit.log files.

Project description

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"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pykalt-1.5.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pykalt-1.5-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file pykalt-1.5.tar.gz.

File metadata

  • Download URL: pykalt-1.5.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pykalt-1.5.tar.gz
Algorithm Hash digest
SHA256 efdaf44971dd6fc06f7ea478d6bff4a11690f49930d05b74e11eb658ac50685b
MD5 6262cb21d04795bdca358772bf86f73a
BLAKE2b-256 e4b86b61315736828f70fd0410a27d797b138d851be7bb64d9bfd56bd0527000

See more details on using hashes here.

File details

Details for the file pykalt-1.5-py3-none-any.whl.

File metadata

  • Download URL: pykalt-1.5-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pykalt-1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a1ba1e486491edd37e121d03db40fba4031b9717424135085f368e96ad12e695
MD5 c117d8610d5616040a1dc58a60a73f8d
BLAKE2b-256 fa50ed0dc6150827fe0a8a9c2668b35ac991456c6af5f207928d5ca517eb833b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page