Skip to content

shladyr/python.sec-ops.git-branch-protection-rules-audit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Audit of Git Branch Protection Rules

This script is used to view or set the master branch protection for supplied repos or all repos in an org.

Requirements

$ pip3 install PyGithub

Call graph diagram

call_graph.png

QA examples

$  python3 git_branch_protection.py --url https://github.company.com/api/v3 --org devops-team --username ACC --token *** --view --all
$  python3 git_branch_protection.py --url https://github.company.com/api/v3 --org devops-team --username ACC --token *** --view --repo app-microservice-abc

View chosen repos

python3 git_protection.py --url https://github.company.com/api/v3 --org <org> --username <username> --token <token> --view --repo microservice-123 --repo app-microservice-abc

View all repos

python3 git_protection.py --url https://github.company.com/api/v3 --org <org> --username <username> --token <token> --view --all

Protect chosen repos

python3 git_protection.py --url https://github.company.com/api/v3 --org <org> --username <username> --token <token> --protect --repo microservice-123 --repo app-microservice-abc

Protect all repos

python3 git_protection.py --url https://github.company.com/api/v3 --org <org> --username <username> --token <token> --protect --all

About

python.sec-ops.secrets-rotation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages