Skip to content

Cyfrin/audit-repo-cloner

Repository files navigation

Audit Repository Cloner

A Python package to clone a repo and automatically prepare it for Cyfrin audit report generation.

Features

  • Clone one or more source repositories into a target repository
  • Add issue templates for audit findings
  • Configure labels for severity and status
  • Add source repositories as git subtrees
  • Create tags for each source repository
  • Create branches for auditors and final report
  • Add report-generator-template
  • Set up GitHub project board
  • Remove GitHub Actions from source repositories for security

Quick Start

  1. Install requirements:
git clone https://github.com/Cyfrin/audit-repo-cloner
cd audit-repo-cloner
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
  1. Get a GitHub personal access token and add it to the .env file:
cp .env.example .env
  1. Create a config.json file:
cp config.json.example config.json
  1. Edit config.json with your repository details:
{
  "targetRepoName": "audit-2024-05-myproject",
  "projectTitle": "[Audit] My Project (2024-05)",
  "auditors": "auditor1 auditor2 auditor3",
  "repositories": [
    {
      "sourceUrl": "https://github.com/username/protocol-repo",
      "commitHash": "abcdef1234567890abcdef1234567890abcdef12",
      "subFolder": "protocol"
    }
  ]
}
  1. Run the tool:
# specifying github token and organization in the cmd
python -m audit_repo_cloner.create_audit_repo --config-file config.json --github-token YOUR_TOKEN --organization YOUR_ORG
# using .env file for github token and org
python -m audit_repo_cloner.create_audit_repo --config-file config.json
# if config file is not specified, config.json is used by default
python -m audit_repo_cloner.create_audit_repo

Development

  1. Set up development environment:
git clone https://github.com/Cyfrin/audit-repo-cloner
cd audit-repo-cloner
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
  1. Install pre-commit hooks:
pre-commit install
pre-commit run --all-files

About

A Python package to clone a repo and automatically prepare it for audit report generation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

Languages