Registry / auth-security / pycadf

pycadf

JSON →
library4.0.1pypypiunverified

The pycadf library provides an auditing data model based on the Cloud Auditing Data Federation (CADF) specification. It is primarily used within the OpenStack ecosystem to establish strict expectations for auditors regarding audit notifications and event structures. The library is actively maintained by the OpenStack project and is currently at version 4.0.1.

pip install pycadf
INSTALL
IMPORT
SIG · PYCADF
P
pycadf
auth-securitypythonv4.0.1
Install
4.3s avg
Import
—
Disk
47MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v4.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 42.8MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 4.3s · import 0.000s · 44MB
47MB installed
● package 47MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Event
✓ from pycadf import Event
✗ from pycadf import Event

This quickstart demonstrates how to create a basic CADF audit event by defining an initiator (user), a target (VM instance), and then constructing an Event object. The event is then serialized to a JSON string for auditing purposes.

import json from pycadf.events import Event from pycadf.resource import Resource from pycadf.cadftype import CADF_VERSION_1_0_0 # Define initiator resource initiator = Resource( typeURI=CADF_VERSION_1_0_0 + 'security/account/user', id='example-user-id', name='example_auditor', domainId='example-domain' ) # Define target resource target = Resource( typeURI=CADF_VERSION_1_0_0 + 'compute/instance', id='example-instance-id', name='my_vm', host=Resource( typeURI=CADF_VERSION_1_0_0 + 'compute/host', id='example-host-id', name='compute-host-1' ) ) # Create a CADF event event = Event( eventType='activity', outcome='success', action='create', initiator=initiator, target=target, eventTime='2026-04-16T15:00:00.000Z', # ISO 8601 format id='example-event-id' ) # Serialize the event to a dictionary and print as JSON print(json.dumps(event.as_dict(), indent=2))
Debug
Known issues
breakingPyCADF version 4.0.0 and later no longer support Python 3.8. Users on Python 3.8 will encounter installation or runtime errors.
fix
Upgrade your Python environment to version 3.9 or higher. The officially supported minimum is Python 3.9.
affects: >=4.0.0
gotchaAs an OpenStack project, pycadf relies on common OpenStack libraries (oslo.config, oslo.serialization). While these are installed as dependencies, be aware of their presence if integrating pycadf into non-OpenStack environments.
fix
Ensure that if you have specific versioning requirements for 'oslo' libraries in your project, they are compatible with the versions required by pycadf.
affects: All
Upgrade
Version history
4.0.1latest on PyPI · released Jan 29, 2025
Audit
Dependencies
oslo.configrequiredConfiguration management for OpenStack projects.
oslo.serializationrequiredSerialization utilities for OpenStack projects.
pbrrequiredPBR (Python Build Reasonableness) is an OpenStack project that provides a common build system.
Agent activity
31 hits · last 30 days
node
26
OpenAI (training)
2
Amazon
1
Resources
pycadf — pip install pycadf · libregistry