Skip to main content

mfpandas-racfhound

Transforms a parsed mfpandas IRRDBU00 object into BloodHound OpenGraph JSON for RACF attack path analysis.

Installation

pip install mfpandas-racfhound

Requires Python 3.10+ and mfpandas.

Usage

Parse your IRRDBU00 unload with mfpandas, then pass it to to_bloodhound:

import time
from mfpandas import IRRDBU00
from mfpandas_racfhound import to_bloodhound

racf = IRRDBU00(irrdbu00="/path/to/irrdbu00.dump")
racf.parse()
while racf._state < IRRDBU00.STATE_READY:
    time.sleep(0.1)

graph = to_bloodhound(
    racf,
    apf_libs={"SYS1.LINKLIB", "SYS1.SVCLIB"},
    parmlib_datasets={"SYS1.PARMLIB"},
    proclib_datasets={"SYS1.PROCLIB"},
)

to_bloodhound returns a dict ready for upload to the BloodHound API:

{
    "graph": {
        "nodes": [...],
        "edges": [...]
    }
}

Parameters

Parameter Type Description
racf mfpandas.IRRDBU00 Parsed IRRDBU00 instance
apf_libs set[str] APF library DSNs (uppercase). Used to resolve generic dataset profiles to concrete APF libraries.
parmlib_datasets set[str] PARMLIB dataset DSNs
proclib_datasets set[str] PROCLIB dataset DSNs

All DSN sets are optional and default to empty. Without them, generic profile resolution against APF/PARMLIB/PROCLIB libraries is skipped.

Writing output to a file

import json

with open("racf_opengraph.json", "w") as f:
    json.dump(graph, f)

Uploading to BloodHound

import httpx

resp = httpx.post(
    "https://<bloodhound-host>/api/v2/graphs/upload",
    headers={"Authorization": f"Bearer {token}"},
    json=graph,
)
resp.raise_for_status()

mfpandas integration

mfpandas-racfhound can be wired into the mfpandas.IRRDBU00 class as an optional plugin, exposing racf.to_bloodhound() directly without making it a hard dependency:

# In mfpandas IRRDBU00 class:
def to_bloodhound(self, **kwargs):
    try:
        from mfpandas_racfhound import to_bloodhound
        return to_bloodhound(self, **kwargs)
    except ImportError:
        raise ImportError("Install mfpandas-racfhound for BloodHound export support")

Once wired up, users can call:

graph = racf.to_bloodhound(apf_libs={"SYS1.LINKLIB"})

Running tests

pip install pytest
pytest

The test suite uses a self-contained fixture dump built from raw IRRDBU00 records — no external files or mainframe access required.

To run a specific test file:

pytest tests/test_generics.py    # wildcard matching and specificity unit tests
pytest tests/test_integration.py # end-to-end graph output tests

Metadata

Release files for mfpandas-racfhound 0.1.1

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

Source distribution (sdist)

Source distribution for mfpandas-racfhound 0.1.1
File Size Uploaded
mfpandas_racfhound-0.1.1.tar.gz 16.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mfpandas-racfhound 0.1.1
File Interpreter ABI Platform
mfpandas_racfhound-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 28.3 kB

Release files / mfpandas_racfhound-0.1.1.tar.gz

Download URL mfpandas_racfhound-0.1.1.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5acd8dfe1b25e8972ec53d99b632587869e967ed08ac886e315cf62d1f56caad
BLAKE2b-256 checksum
How to use checksums
7e7d3e491bb5f696151608099e8531815f339bc77b45072effbb5d9e09e8824a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release files / mfpandas_racfhound-0.1.1-py3-none-any.whl

Download URL mfpandas_racfhound-0.1.1-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36d90af1e511aa047da61203694cc7b75a90bd45f983461d75241d49ce07b582
BLAKE2b-256 checksum
How to use checksums
fb7317d4592fae54bab80b894f2d9406494610479a5291be30c6ba4b648fc3e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.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