Metadata-Version: 2.4
Name: saltext.aerleon
Version: 0.1.0
Summary: Salt Extension for generating network ACLs and firewall filters with Aerleon
Author-email: "Gary T. Giesen" <ggiesen@giesen.me>
License: Apache Software License
Project-URL: Homepage, https://gitlab.com/ggiesen/saltext-aerleon
Project-URL: Documentation, https://ggiesen.gitlab.io/saltext-aerleon/
Project-URL: Source, https://gitlab.com/ggiesen/saltext-aerleon
Project-URL: Tracker, https://gitlab.com/ggiesen/saltext-aerleon/-/work_items
Keywords: salt-extension
Platform: any
Classifier: Programming Language :: Python
Classifier: Programming Language :: Cython
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: salt>=3008
Requires-Dist: aerleon>=1.17.0
Provides-Extra: changelog
Requires-Dist: towncrier==25.8.0; extra == "changelog"
Provides-Extra: dev
Requires-Dist: nox[uv]!=2025.05.01,>=2024.3; extra == "dev"
Requires-Dist: pre-commit>=2.21.0; extra == "dev"
Provides-Extra: dev-extra
Requires-Dist: black==26.5.1; extra == "dev-extra"
Requires-Dist: isort==8.0.1; extra == "dev-extra"
Requires-Dist: coverage==7.14.3; extra == "dev-extra"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-prompt; extra == "docs"
Requires-Dist: sphinxcontrib-spelling; extra == "docs"
Requires-Dist: sphinx-copybutton; extra == "docs"
Requires-Dist: towncrier==25.8.0; extra == "docs"
Requires-Dist: sphinxcontrib-towncrier; extra == "docs"
Requires-Dist: myst_parser; extra == "docs"
Requires-Dist: furo; extra == "docs"
Requires-Dist: sphinx-inline-tabs; extra == "docs"
Provides-Extra: docsauto
Requires-Dist: sphinx-autobuild; extra == "docsauto"
Provides-Extra: lint
Requires-Dist: pylint==4.0.4; extra == "lint"
Provides-Extra: tests
Requires-Dist: pytest>=7.2.0; extra == "tests"
Requires-Dist: pytest-salt-factories>=1.0.0; extra == "tests"
Requires-Dist: pytest-instafail; extra == "tests"
Requires-Dist: aerleon>=1.17.0; extra == "tests"
Dynamic: license-file

# Salt Extension for Aerleon

Salt Extension for generating network ACLs and firewall filters with
[Aerleon][aerleon].

## Overview

[Aerleon][aerleon] is the maintained successor to Google's
[Capirca][capirca]: it renders platform-specific access-control lists from a
single set of platform-independent term and policy definitions.

This extension provides the `aerleon` execution module. It is a direct port of
the `capirca` execution module that used to ship with Salt core (removed in Salt
3008): the function names and arguments are unchanged, only the underlying
library moved from `capirca` to `aerleon`. Capirca has been effectively
unmaintained since early 2023 (its last PyPI release was 2.0.9 in February
2023), and its `capirca.*` namespace was renamed to `aerleon.*` with no
compatibility shim, so this port swaps the import and platform-generator lookup
accordingly.

The module generates configuration text only; it does not talk to devices. To
push generated ACLs onto network gear, use the `netacl` execution and state
modules in [saltext-napalm][saltext-napalm], which call this module's
`aerleon.*` functions.

## Requirements

- **Salt 3008 or newer.** The built-in `capirca` module was part of Salt core on
  3006/3007, so on those releases the extension is neither needed nor installable
  (`pip` enforces `salt>=3008`).
- **Aerleon 1.17.0 or newer** (installed automatically).

## Example

Generate a Cisco term:

```bash
salt '*' aerleon.get_term_config cisco example-filter example-term \
    source_address=10.0.0.0/8 protocol=tcp action=accept
```

Provided functions: `get_term_config`, `get_filter_config`, `get_policy_config`,
`get_filter_pillar` and `get_term_pillar`.

## Security

If you discover a security vulnerability, please refer
to [Salt's security guide][security].

## User Documentation

For setup and usage instructions, please refer to the
[User Documentation][docs].

## Contributing

The saltext-aerleon project welcomes contributions from anyone!

The [Salt Extensions guide][salt-extensions-guide] provides comprehensive instructions on all aspects
of Salt extension development, including [writing tests][writing-tests], [running tests][running-tests],
[writing documentation][writing-docs] and [rendering the docs][rendering-docs].

### Quickstart

To get started contributing, first clone this repository (or your fork):

```bash
# Clone the repo
git clone --origin upstream https://gitlab.com/ggiesen/saltext-aerleon.git

# Change to the repo dir
cd saltext-aerleon
```

#### Automatic
If you have installed [direnv][direnv], copying the included `.envrc.example` to `.envrc` and
allowing it to run ensures a proper development environment is present and the virtual environment is active.

Without `direnv`, you can still run the automation explicitly:

```bash
make dev  # or python3 tools/initialize.py
source .venv/bin/activate
```

#### Manual
Please follow the [first steps][first-steps], skipping the repository initialization and first commit.

### Ways to contribute

Contributions come in many forms, and they're all valuable! Here are some ways you can help
without writing code:

* **Documentation**: Especially examples showing how to use this project
  to solve specific problems.
* **Triaging issues**: Help manage [issues][issues].

Any of these things are super valuable to our community, and we sincerely
appreciate every contribution!

[aerleon]: https://aerleon.readthedocs.io/
[capirca]: https://github.com/google/capirca
[saltext-napalm]: https://gitlab.com/ggiesen/saltext-napalm
[security]: https://github.com/saltstack/salt/blob/master/SECURITY.md
[salt-extensions-guide]: https://salt-extensions.github.io/salt-extension-copier/
[writing-tests]: https://salt-extensions.github.io/salt-extension-copier/topics/testing/writing.html
[running-tests]: https://salt-extensions.github.io/salt-extension-copier/topics/testing/running.html
[writing-docs]: https://salt-extensions.github.io/salt-extension-copier/topics/documenting/writing.html
[rendering-docs]: https://salt-extensions.github.io/salt-extension-copier/topics/documenting/building.html
[first-steps]: https://salt-extensions.github.io/salt-extension-copier/topics/creation.html#initialize-the-python-virtual-environment
[direnv]: https://direnv.net
[issues]: https://gitlab.com/ggiesen/saltext-aerleon/-/work_items
[docs]: https://ggiesen.gitlab.io/saltext-aerleon/
