Skip to main content

![NOTE] This repo is a wooorrkkkkk in progress.

cyaudit

A tool to help you setup a repo for audit.

usage: CyAudit CLI [-h] [-d] [-q] {setup,source,report,add-team,clone,init} ...

Setup, manage, and generate reports for smart contract audits.

positional arguments:
  {setup,source,report,add-team,clone,init}
    setup               Setup a new audit project
    source              Edit the source folder for report generation
    report              Generate the report.
    add-team            Add a team.
    clone               Clones an audit repo already setup.
    init                Create a cyaudit.toml config file.

options:
  -h, --help            show this help message and exit
  -d, --debug           Run in debug mode
  -q, --quiet           Suppress all output except errors

Quickstart - tutorial

  1. Install uv
  2. Install cyaudit
uv tool install cyaudit
  1. Create a new audit project
mkdir my-audit
cd my-audit
cyaudit init

This will create a cyaudit.toml file in your current directory. Fill out the form, (if you don't the CLI will prompt you in the next step). Here is an example cyaudit.toml file:

[cyaudit]
template_project_id = "5" # The template project id
source_url = "https://github.com/Cyfrin/4-puppy-raffle-audit"
target_repo_name = "audit-puppy-raffle"
target_organization = "cyfrin"
auditors = [
    "patrick",
]
commit_hash = "15c50ec22382bb1f3106aba660e7c590df18dcac"
project_title = "puppy raffle"
give_users_access = "" # This is the list of users that will be given access to the repo
give_teams_access = [
    "Auditors",
] # This is the list of teams that will be given access to the repo
  1. Setup your github access tokens

Ideally, you use two fine grained tokens. Set the CYAUDIT_PERSONAL_GITHUB_TOKEN and CYAUDIT_ORG_GITHUB_TOKEN environment variables. You may also wait for the CLI to prompt you in the next step.

  1. Run the setup command

This will:

  • Create a new repo at the target_organization with the target_repo_name
  • Add the issue template
  • Replace labels
  • Create branches for auditors
  • Create the report branch
  • Add report branch data
  • Setup CI
  • Add teams
cyaudit setup
  1. Clone the repo
cyaudit clone

This will keep your cyaudit.toml in tact.

  1. Do your audit

Go to the github, and make an issue!

  1. Generate the source files
cyaudit source
  1. Edit summary_information.toml
[summary]
project_name = "my project"
report_version = 1.0
team_name = "my_team"
team_website = "hi.com"
client_name = "asdfsa"
client_website = "asdfas"
private_github = "https://github.com/cyfrin/my-goose.git"
project_github = "https://github.com/Cyfrin/4-puppy-raffle-audit"
commit_hash = "15c50ec22382bb1f3106aba660e7c590df18dcac"
fix_commit_hash = ""
project_github_2 = ""
commit_hash_2 = ""
fix_commit_hash_2 = ""
project_github_3 = ""
commit_hash_3 = ""
fix_commit_hash_3 = ""
review_timeline = "01-01-2021 - 01-02-2021"
review_methods = ""
  1. Generate the report
cyaudit report

Global config

You can setup a file at:

~/.cyaudit/global_cyaudit.toml

And when you run cyaudit init it will use the global config as a default.

GitHub Token Permissions

Ideally, you use 2 fine grained tokens, one for your personal and one for the org.

Use CYAUDIT_PERSONAL_GITHUB_TOKEN and CYAUDIT_ORG_GITHUB_TOKEN environment variables to set your tokens. If you use a classic token, you can just use CYAUDIT_PERSONAL_GITHUB_TOKEN.

Personal Access Token

(I'm not 100% sure)

Permissions:

  • Actions
  • Administration
  • Commit statuses
  • Contents
  • Workflows

Org token

(I'm not 100% sure)

Permissions:

  • Actions
  • Administration
  • Contents
  • Workflows
  • Issue Types
  • Projects
  • Members

Classic Tokens

Classic tokens give too much power, so it's better to use the fine grained tokens.

Metadata

Release files for cyaudit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cyaudit 0.1.0
File Size Uploaded Provenance Actions
cyaudit-0.1.0.tar.gz 304.7 kB With provenance Details for cyaudit-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cyaudit 0.1.0
File Interpreter ABI Platform Actions
cyaudit-0.1.0-py3-none-any.whl Python 3 none any Details for cyaudit-0.1.0-py3-none-any.whl

Total release size: 556.8 kB

Release files / cyaudit-0.1.0.tar.gz

Download URL cyaudit-0.1.0.tar.gz
Size 304.7 kB
Tags Source
SHA-256 checksum
How to use checksums
418270bf30eb708be1db64d3ee4d546feb0c2fd11c510f661b8f11c531b00878
BLAKE2b-256 checksum
How to use checksums
a4cc37bbe4c352760ce34af9ab3887ff78c29cbd805cb89b00b370851266e728
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 24, 2025.

Transparency log

Release files / cyaudit-0.1.0-py3-none-any.whl

Download URL cyaudit-0.1.0-py3-none-any.whl
Size 252.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ef8b176535acd198650c6364ae4becdb10e6974a2cd512b1f1072b2bcbe50aa
BLAKE2b-256 checksum
How to use checksums
9f2a350187519187727a5f6f84853b5568b2373da4b168f62e67f1e19b0f55cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 24, 2025.

Transparency log

Security for cyaudit 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cyaudit-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 24, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page