Skip to main content

CLI tool to identify cross project repo access in Azure DevOps.

Project description

cross-project-cluck

Helps identify cross-project repo access in Azure DevOps.

What does it do?

For each pipeline run harvested (API limited to latest 1000), it adds a row for each repository accessed. Determines if the access is cross-project. Sets the status to "REVIEW" for cross-project access or "OK" for same-project access.

It outputs a JSON file and matching CSV. It also outputs a list of projects it found. Use the --simulate-approve-all flag to output a list of instructions if you were to set granular permissions at repo level.

[
    {
        "home_project": "HOME PROJECT",
        "run": "Link to the Pipeline Run",
        "project": "HOME PROJECT",
        "repo": "Repo Accessed",
        "branch": "Branch reference",
        "cross_project": false,
        "status": "OK"
    },
    {
        "home_project": "HOME PROJECT",
        "run": "Link to the Pipeline Run",
        "project": "CROSS PROJECT",
        "repo": "Repo Accessed",
        "branch": "Branch reference",
        "cross_project": true,
        "status": "REVIEW"
    }
]

Installation

Install via pip:

pip install cross-project-cluck

Usage

Run the tool using the CLI:

  1. With arguments:

    cluck --simulate-approve-all --organization my_org --pat_token my_secret_token
    
  2. Without arguments (uses config.json or environment variables):

    cluck --simulate-approve-all
    

Configuration

You can provide organization and pat_token in the following ways:

  1. Command-line arguments:

    cluck --organization my_org --pat_token my_secret_token
    
  2. Environment variables:

    export ORGANIZATION=my_org
    export PAT_TOKEN=my_secret_token
    cluck
    
  3. config.json file:

    Create a config.json file:

    {
        "organization": "my_org",
        "pat_token": "my_secret_token"
    }
    

Priority

The tool checks for configuration in this order:

  1. Command-line arguments
  2. Environment variables
  3. config.json

If not using pip, use the python code directly:

python cross_project_cluck.py -h
python cross_project_cluck.py --organization my_org --pat_token my_secret_token
python cross_project_cluck.py --simulate-approve-all --organization my_org --pat_token my_secret_token

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

cross_project_cluck-1.0.6.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

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

cross_project_cluck-1.0.6-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file cross_project_cluck-1.0.6.tar.gz.

File metadata

  • Download URL: cross_project_cluck-1.0.6.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for cross_project_cluck-1.0.6.tar.gz
Algorithm Hash digest
SHA256 dd4d3bf8351d98c0478969905696dcd732e06f725af695009f3683dfb6897e7f
MD5 83d31e8ce53ff33fc8969b3cb2531913
BLAKE2b-256 fb6c396c762f8e51091300377ba3857fb27c06c766ae6a09e39a0228ab6d1f82

See more details on using hashes here.

File details

Details for the file cross_project_cluck-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for cross_project_cluck-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 be54314bf20517e4cfd68996550757e6451684e7d64eb7cae1ca2d26cd64267c
MD5 c585326cb849d048344fdb338624c929
BLAKE2b-256 c568928c45703115ec9512d89407bdca3040969c208e54e10b853f89f603c876

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