Skip to main content

fwintegrity

Compare policy audit exports (tabular) with change tickets (CSV or dict rows). Normalize addresses, services, and change kinds, then match rows bidirectionally or build atomic triple indexes for coverage checks.

Install

pip install fwintegrity

Quick use

from fwintegrity import (
    AUDIT_EXPORT_DEFAULT_MAPPING,
    TICKET_CSV_DEFAULT_MAPPING,
    build_ticket_triple_index,
    from_csv_text,
    link_audit_to_ticket_requests,
    load_change_rows,
)

audit_rows = load_change_rows(from_csv_text(audit_csv), AUDIT_EXPORT_DEFAULT_MAPPING)
ticket_rows = load_change_rows(from_csv_text(ticket_csv), TICKET_CSV_DEFAULT_MAPPING)
links = link_audit_to_ticket_requests(audit_rows, ticket_rows)
idx = build_ticket_triple_index(ticket_rows)

Legacy string audit CSV (wide _CANON headers) still works: link_audit_to_ticket_requests(audit_csv_text, ticket_csv_text).

See scripts/sample_demo.py for a minimal example.

在线演示(GitHub Pages):在仓库 Settings → Pages 选择 Deploy from branch、目录 /docs(或由 Actions 部署 github-pages 环境)。访问 https://<user>.github.io/fwintegrity/ 粘贴 CSV 在线比对(浏览器内 Pyodide 加载 PyPI 包)。

Documentation

  • Customization guide — how to adapt parsers, column maps, ignore lists, and matching rules to your organization’s formats (vendor-neutral extension points).

Features (summary)

  • Endpoints: IPv4 literals/CIDR, prefixed audit-export tokens (IP_, Host_, net_, Range_, …), optional object/group names; mixed cells become AddrCompound.
  • Services: TCP_443-style audit tokens, loose ticket strings (TCP 80 UDP 53), optional service object names → ServiceCompound.
  • Matching: bidirectional containment on source, destination, and service (change_match, compare_changes).
  • Triples: TicketTripleIndex / audit_triples_all_in_index for (src_atom, dst_atom, svc_atom) style checks.
  • Loading: declare columns with ChangeRowMapping, then from_csv_text / from_csv_path / from_excel_path / from_dict_rows / from_package_resource + load_change_rows (see table_load.py).

Requirements

Python 3.10+

Development

pip install -e ".[dev]"
pytest
ruff check src tests

Build and publish to PyPI

  1. Create a PyPI account and API token.
  2. Bump version in pyproject.toml and src/fwintegrity/__init__.py (__version__).
  3. Build and upload:
pip install build twine
python -m build
twine check dist/*
twine upload dist/*

Use TestPyPI first if you prefer: twine upload --repository testpypi dist/*

Customization (PyPI / offline)

The wheel ships the Python package only. Vendor-specific behavior is adjusted by editing or wrapping:

Area Location
Column mapping + unified load table_load.ChangeRowMapping, load_change_rows, from_* sources; optional mapping= on load_audit_table / load_ticket_table
Audit CSV header → keys (legacy wide export) audit_report._CANON
Ticket id columns ticket._TICKET_NUMBER_KEYS
Address & service parsing normalize.parse_*, expand_audit_network_token, _iter_loose_tcp_udp_segments
Change-kind compatibility (audit vs ticket) compare.DEFAULT_AUDIT_TO_TICKET_KINDS or pass matrix=
Ignored services (ICMP, etc.) ignore_lists.DEFAULT_IGNORED_SERVICE_NAMES, merged_ignored_service_names
Triple key strings triple_index.endpoint_atom_keys, service_atom_keys

Clone the repository for the full walkthrough: docs/CUSTOMIZATION.md (Chinese, file paths and hooks).

License

MIT — see LICENSE.

Metadata

Release files for fwintegrity 0.4.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 fwintegrity 0.4.1
File Size Uploaded Provenance Actions
fwintegrity-0.4.1.tar.gz 28.8 kB With provenance Details for fwintegrity-0.4.1.tar.gz

Built distribution (wheel)

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

Total release size: 50.5 kB

Release files / fwintegrity-0.4.1.tar.gz

Download URL fwintegrity-0.4.1.tar.gz
Size 28.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b5ecc6ba71d9a573017ddd86745e1354ef3bb27509b104e1550b89a2d1b479e7
BLAKE2b-256 checksum
How to use checksums
bd74422bf17017295fb648264a00299311819d2e2795896568df75566ac06aa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 21, 2026.

Transparency log

Release files / fwintegrity-0.4.1-py3-none-any.whl

Download URL fwintegrity-0.4.1-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9c8e4874f6912eb73561db3cebf9293b91bffce26ff0aa91b73edff2fd5829f
BLAKE2b-256 checksum
How to use checksums
27dd771b28c19f3c11ee2c2fc05ef433e8cd66f7b4e2421814b7698299e8a10d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 21, 2026.

Transparency log

Security for fwintegrity 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fwintegrity-0.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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