Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Azure DevOps Advanced Security Alert Downloader

This script pulls Advanced Security alerts (Code, Dependency, Secret) from Azure DevOps for a given repository and branch, and exports them to a CSV file.

A PAT Token will be required to run the application with the following permissions:

Advanced Security (READ)
Code (READ)

A .env file can be used to set environment variables for convenience.

ADO_ORG=<org>
ADO_PROJECT=<Project Name>
ADO_REPO=<Repo Name>
ADO_BRANCH=develop
MAPPED_ADO_PAT=<your_personal_access_token_here> # Needs read access to Adv Security
ADO_API_VERSION=7.2-preview.1

Usage

python AdvSecAlertDownloader.py --pat PAT --org ORG --project PROJECT --repo REPO [options]

Required

--pat           Azure DevOps Personal Access Token (or set env MAPPED_ADO_PAT)
--org           Azure DevOps organization name (or set env ADO_ORG)
--project       Azure DevOps project name (or set env ADO_PROJECT)
--repo          Azure DevOps repository name (or set env ADO_REPO)
--branch        Branch name (default: develop, or set env ADO_BRANCH)
--api-version   Azure DevOps API version (default: 7.2-preview.1)

Options

--pipeline      Pipeline name (optional, or set env ADO_PIPELINE)
-h, --help      Show this help message and exit

Examples

Command Line Example

python AdvSecAlertDownloader.py --org <myorg> --project <myproj> --repo Demo --pat <PAT> --api-version 7.2-preview.1

Command Line with All Repos

#  Using the --repo all parameter will attempt to download all results for each repository in a project. Requires the branch parameter to be set.
python advSecAlertDownloader.py --org <myorg> --project <myproj> --repo all --pat <PAT> --branch develop

Using .env Example

.env Contents
ADO_ORG=<org>
ADO_PROJECT=<Project Name>
ADO_REPO=<Repo Name>
ADO_BRANCH=develop
ADO_API_VERSION=7.2-preview.1
MAPPED_ADO_PAT=C4oyQ.....AZFO2eJQ
python AdvSecAlertDownloader.py --repo Demo --pipeline Gated_Scan

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages