No project description provided
Project description
Audit Repository Cloner
This repository contains a Python package to clone a repo and automatically prepare it for Cyfrin audit report generation.
What it does
It will take the following steps:
- Take the
source
repository you want to setup for audit - Add an
issue_template
to the repo, so issues can be formatted as audit findings, like:
**Description:**
**Impact:**
**Proof of Concept:**
**Recommended Mitigation:**
**[Project]:**
**Cyfrin:**
- Update labels to label issues based on severity and status
- Create an audit tag at the given commit hash (full SHA)
- Create branches for each of the auditors participating
- Create a branch for the final report
- Add the report-generator-template to the repo to make it easier to compile the report, and add a button in GitHub actions to re-generate the report on-demand
- Attempt to set up a GitHub project board
Note: Changes to report-generator-template
can be pulled into the generated repo by running:
git subtree pull --prefix cyfrin-report/report-generator-template https://github.com/Cyfrin/report-generator-template main --squash
Getting Started
Requirements
- git
- You'll know you did it right if you can run
git --version
and you see a response likegit version x.x.x
- You'll know you did it right if you can run
- Python
- You'll know you've installed python right if you can run:
python --version
orpython3 --version
and get an ouput like:Python x.x.x
- You'll know you've installed python right if you can run:
- pip
- You'll know you did it right if you can run
pip --version
orpip3 --version
and get an output likepip x.x from /some/path/here (python x.x)
- You'll know you did it right if you can run
Installation
To install from source:
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
To install from pipx:
pipx install audit_repo_cloner
And if installing from source with pipx package already installed, install in editable mode:
pip install -e .
You'll know you've installed it correctly if you can run:
audit_repo_cloner --version
And get an output like:
audit_repo_cloner, version 0.2.0
Getting a GitHub token
To use this, you'll need a github personal access token. Please view the docs to set one up.
You can then set it as an environment variable or input it via the CLI:
export ACCESS_TOKEN=xxxxxx
Note: this access token is encypted and added to the generated repo as a GitHub secret. It is only used to create the repo initially and allow the GitHub Action to run the report generator (fetching issues) in CI. Be sure to update the GitHub secret if you change your access token or it expires.
Usage
Note: $ denotes a command to run in the terminal
Help
audit_repo_cloner --help
As a single command
From source:
python ./create_audit_repo.py`
Otherwise (pipx):
audit_repo_cloner --source-url https://github.com/PatrickAlphaC/hardhat-smartcontract-lottery-fcc --commit-hash 5e4872358cd2bda1936c29f460ece2308af4def6 --auditors "81k-ltd blue-frog-man giiioooooooo" --organization cyfrin --github-token <YOUR_ACCESS_TOKEN>
$ audit_repo_cloner
Hello! This script will clone target repository and prepare it for a Cyfrin audit. Please enter the following details:
1) Source repo url:
Enter: https://github.com/code-423n4/2023-04-eigenlayer
2) Audit commit hash:
Enter: 5e4872358cd2bda1936c29f460ece2308af4def6
3) Enter the names of the auditors (separated by spaces):
Enter: "81k-ltd blue-frog-man giiioooooooo"
4) Enter the name of the organization to create the audit repository in:
Enter: <YOUR_ORG_NAME>
And you'll get a loooong output, but hopefully you'll have a repo ready for audit!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file audit_repo_cloner-0.2.0.tar.gz
.
File metadata
- Download URL: audit_repo_cloner-0.2.0.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c7128d46d90a5cca4bb8978c4a627098b37ee755446ad7f302b8eb0b994ffaa |
|
MD5 | 98b8dafade37bcc6fca128690b804969 |
|
BLAKE2b-256 | a25b5c9aeb9b33d58e37fc475e63a0392d42f49d4262fd5c7c5cf2a18b8e6e00 |
File details
Details for the file audit_repo_cloner-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: audit_repo_cloner-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aef8024bb19488b7627ebc37e3139f42a13b7b8134a46f4024bf6e9883d8daf2 |
|
MD5 | f78cde5c3d2e508e5d8710edd06dd6a5 |
|
BLAKE2b-256 | ab14b94e7f82496e1ffb445f5c8e27b428d9db363c752abd969b435cca4b307a |