Metadata-Version: 2.4
Name: azol
Version: 0.6.0
Summary: A python-based pentesting library for Azure and Entra ID
Author: Cody Burkard
Project-URL: Homepage, https://github.com/cdburkard/azol
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests==2.31.0
Requires-Dist: cryptography==50.0.0
Requires-Dist: pymsalruntime==0.20.6; platform_system == "Windows"
Requires-Dist: dataclasses==0.6
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.0; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.24; extra == "docs"
Provides-Extra: dev
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Dynamic: license-file

# Azure Offensive Library

A python-based pentesting library for Azure and Entra ID

## Installation

Install the library using Python3 pip:

```pip install azol```

For maintainers: see [`RELEASING.md`](RELEASING.md) for the tag-based PyPI release process.

API docs (GraphClient reference) can be built with:

```bash
pip install -e ".[docs]"
mkdocs serve
```

Offline GraphClient tests (from repo root, with the package importable):

```bash
pip install -e .
python -m unittest discover -s tests
python scripts/check_graph_docstrings.py
```

Live tenant tests are opt-in; see [`tests/graph/live/README.md`](tests/graph/live/README.md).

## Basic Usage

Log in as a user and get all subscriptions:

```
from azol.credentials import User
from azol.clients import ArmClient

cred = User(username="user@domain.com")
arm_client = ArmClient(tenant="tenant.com", cred=cred)

subscriptions=arm_client.get_subscriptions()

for sub_id in subscriptions:
  print(sub_id)
```

Log in as a Service Principal and get all groups, with owners

```
from pprint import pprint
from azol.credentials import ServicePrincipal
from azol.clients import GraphClient

cred = ServicePrincipal(client_id="00000000-0000-0000-0000-000000000000", client_secret="your secret" )

graph_client = GraphClient(tenant="tenant.com", cred=cred)

groups=graph_client.get_all_groups_and_owners()

for group in groups:
  pprint(group)

```

Log in as a user to their default tenant, but use an interactive signin. Get all tenants the user belongs to.

```
from azol import *

cred=User("user@domain.com")
arm_client=ArmClient(cred=cred, oauth_flow="authorization_code")

tenants=arm_client.get_tenants()

for tenant in tenants:
  print(tenant["defaultDomain"])

```
