Skip to main content

A tool written in to automate Azure attack paths.

Project description

Glibby

Glibby is a Python library designed to automate Azure attack paths. It simplifies and enhances interactions with Azure APIs, making it a powerful tool for developers and security professionals working with Azure environments.


💡 How Does It Work?

Glibby communicates with the Azure Graph API and Azure Resource Manager (RM) API over HTTPS. It is not a CLI tool; instead, it is intended to be imported and used as a Python library within your projects.

The tool draws inspiration from the "BARK" CLI tool by Andy Robbins, offering similar functionality but tailored for Python integration.


📖 Usage

While comprehensive documentation is in progress, here’s an overview of the core components:

  • UserAuthHandler:

    • A class for managing authentication for Azure Active Directory (AAD) user accounts.
    • Handles access tokens, refresh tokens, and related operations.
  • SpnAuthHandler:

    • A class for managing authentication for Service Principal Names (SPNs) in AAD.
    • Obtains and refreshes access tokens for SPNs.
  • GraphOperations:

    • A class that interacts with the Azure Graph API.
    • Requires a valid Graph API access token to perform operations like managing users and groups.
  • RMOperations:

    • A class that interacts with the Azure Resource Manager (RM) API.
    • Requires a valid RM API access token to perform operations like managing Azure resources.

🔧 Example Usage

Here’s a quick example to authenticate to Azure with our user and assign ourselves the "Global Administrator" role

from glibby import UserAuthHandler
from glibby import GraphOperations


def main():
    # Creds
    username = "USERNAME"
    password = "PASSWORD"
    tenant_id = "TENANT_ID"

    # Get Access Token
    weak_user_auth = UserAuthHandler(username=username, password=password)
    access_token = weak_user_auth.get_access_token(tenant_id=tenant_id, resource='graph')
    if not access_token:
        return
    
    # Assign the global administrator role to ourselves (if we have enough permissions to do it)
    graph = GraphOperations(access_token=access_token)
    global_admin = graph.get_role_definition('Global Administrator')
    if not global_admin:
        return
    
    user_id = graph.user.id_from_name(username)['object_id']
    if not user_id:
        return
    
    graph.assign_role_to_object(user_id, global_admin)


if __name__ == '__main__':
    main()
    

⚠️ Notes

  • After performing certain operations (e.g., assigning a role to a user or adding a user to a group), include a delay using time.sleep() for a few seconds.
    • Why? Azure requires some time to process changes, even if it reports success immediately. Adding a short delay ensures your subsequent operations reflect these updates correctly.

🙌 Credits


🌟 Stay Tuned

Detailed documentation and examples will be released soon! For now, dive in and explore the capabilities of Glibby. Feedback and contributions are always welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glibby-1.0.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glibby-1.0.0-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file glibby-1.0.0.tar.gz.

File metadata

  • Download URL: glibby-1.0.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for glibby-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cf76227023ec23f489b8e92438bf6f3d563000e5eb12aaf85e3be81e5bb33c5c
MD5 c2a6011510094241907d2f05fe68ba4f
BLAKE2b-256 437aea33541cd9c0d3f15f6c4bd0d80a878755f5613328da896e846d08641fe2

See more details on using hashes here.

File details

Details for the file glibby-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: glibby-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for glibby-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d300a816ea59684181fd39b82f7c261e37b9876cd7238591d6f78cd991e32154
MD5 2cb18582e3ca5cf1b5d5ce5b7bdd4cc3
BLAKE2b-256 0ee2a088e3e5ed29cbaef61d2b5ca0d428334573bc69858b9dea2cb73b8b6bd2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page