cyaudit


Namecyaudit JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryAdd your description here
upload_time2025-01-24 04:03:03
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords audit cyfrin github
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            > ![NOTE]
> This repo is a wooorrkkkkk in progress.

# cyaudit

A tool to help you setup a repo for audit. 

```console
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](https://docs.astral.sh/uv/getting-started/installation/)
2. Install `cyaudit`

```bash
uv tool install cyaudit
```

3. Create a new audit project

```bash
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:

```toml
[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
```

4. Setup your [github access tokens](#github-token-permissions)

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.

5. 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

```bash
cyaudit setup
```

6. Clone the repo

```bash
cyaudit clone
```

This will keep your `cyaudit.toml` in tact. 

7. Do your audit

Go to the github, and make an issue!

8. Generate the source files

```console
cyaudit source
```

9. Edit `summary_information.toml` 

```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 = ""
```

10. Generate the report

```console
cyaudit report
```

# Global config

You can setup a file at:

```console
~/.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.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cyaudit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "audit, cyfrin, github",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/a4/cc/37bbe4c352760ce34af9ab3887ff78c29cbd805cb89b00b370851266e728/cyaudit-0.1.0.tar.gz",
    "platform": null,
    "description": "> ![NOTE]\n> This repo is a wooorrkkkkk in progress.\n\n# cyaudit\n\nA tool to help you setup a repo for audit. \n\n```console\nusage: CyAudit CLI [-h] [-d] [-q] {setup,source,report,add-team,clone,init} ...\n\nSetup, manage, and generate reports for smart contract audits.\n\npositional arguments:\n  {setup,source,report,add-team,clone,init}\n    setup               Setup a new audit project\n    source              Edit the source folder for report generation\n    report              Generate the report.\n    add-team            Add a team.\n    clone               Clones an audit repo already setup.\n    init                Create a cyaudit.toml config file.\n\noptions:\n  -h, --help            show this help message and exit\n  -d, --debug           Run in debug mode\n  -q, --quiet           Suppress all output except errors\n```\n\n# Quickstart - tutorial\n\n1. Install [uv](https://docs.astral.sh/uv/getting-started/installation/)\n2. Install `cyaudit`\n\n```bash\nuv tool install cyaudit\n```\n\n3. Create a new audit project\n\n```bash\nmkdir my-audit\ncd my-audit\ncyaudit init\n```\n\nThis 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:\n\n```toml\n[cyaudit]\ntemplate_project_id = \"5\" # The template project id\nsource_url = \"https://github.com/Cyfrin/4-puppy-raffle-audit\"\ntarget_repo_name = \"audit-puppy-raffle\"\ntarget_organization = \"cyfrin\"\nauditors = [\n    \"patrick\",\n]\ncommit_hash = \"15c50ec22382bb1f3106aba660e7c590df18dcac\"\nproject_title = \"puppy raffle\"\ngive_users_access = \"\" # This is the list of users that will be given access to the repo\ngive_teams_access = [\n    \"Auditors\",\n] # This is the list of teams that will be given access to the repo\n```\n\n4. Setup your [github access tokens](#github-token-permissions)\n\nIdeally, 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.\n\n5. Run the setup command\n\nThis will:\n\n- Create a new repo at the `target_organization` with the `target_repo_name`\n- Add the issue template\n- Replace labels\n- Create branches for auditors\n- Create the report branch\n- Add report branch data\n- Setup CI\n- Add teams\n\n```bash\ncyaudit setup\n```\n\n6. Clone the repo\n\n```bash\ncyaudit clone\n```\n\nThis will keep your `cyaudit.toml` in tact. \n\n7. Do your audit\n\nGo to the github, and make an issue!\n\n8. Generate the source files\n\n```console\ncyaudit source\n```\n\n9. Edit `summary_information.toml` \n\n```toml\n[summary]\nproject_name = \"my project\"\nreport_version = 1.0\nteam_name = \"my_team\"\nteam_website = \"hi.com\"\nclient_name = \"asdfsa\"\nclient_website = \"asdfas\"\nprivate_github = \"https://github.com/cyfrin/my-goose.git\"\nproject_github = \"https://github.com/Cyfrin/4-puppy-raffle-audit\"\ncommit_hash = \"15c50ec22382bb1f3106aba660e7c590df18dcac\"\nfix_commit_hash = \"\"\nproject_github_2 = \"\"\ncommit_hash_2 = \"\"\nfix_commit_hash_2 = \"\"\nproject_github_3 = \"\"\ncommit_hash_3 = \"\"\nfix_commit_hash_3 = \"\"\nreview_timeline = \"01-01-2021 - 01-02-2021\"\nreview_methods = \"\"\n```\n\n10. Generate the report\n\n```console\ncyaudit report\n```\n\n# Global config\n\nYou can setup a file at:\n\n```console\n~/.cyaudit/global_cyaudit.toml\n```\n\nAnd when you run `cyaudit init` it will use the global config as a default.\n\n# GitHub Token Permissions\n\nIdeally, you use 2 fine grained tokens, one for your personal and one for the org.\n\nUse `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`.\n\n## Personal Access Token\n\n(I'm not 100% sure)\n\nPermissions:\n- Actions\n- Administration\n- Commit statuses\n- Contents\n- Workflows\n\n## Org token \n\n(I'm not 100% sure)\n\nPermissions:\n- Actions\n- Administration\n- Contents\n- Workflows\n- Issue Types\n- Projects\n- Members\n\n## Classic Tokens\n\nClassic tokens give too much power, so it's better to use the fine grained tokens.",
    "bugtrack_url": null,
    "license": null,
    "summary": "Add your description here",
    "version": "0.1.0",
    "project_urls": null,
    "split_keywords": [
        "audit",
        " cyfrin",
        " github"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9f2a350187519187727a5f6f84853b5568b2373da4b168f62e67f1e19b0f55cf",
                "md5": "7ae2581cf6b1761605fd0c625af96ce5",
                "sha256": "9ef8b176535acd198650c6364ae4becdb10e6974a2cd512b1f1072b2bcbe50aa"
            },
            "downloads": -1,
            "filename": "cyaudit-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7ae2581cf6b1761605fd0c625af96ce5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 252139,
            "upload_time": "2025-01-24T04:03:01",
            "upload_time_iso_8601": "2025-01-24T04:03:01.340210Z",
            "url": "https://files.pythonhosted.org/packages/9f/2a/350187519187727a5f6f84853b5568b2373da4b168f62e67f1e19b0f55cf/cyaudit-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a4cc37bbe4c352760ce34af9ab3887ff78c29cbd805cb89b00b370851266e728",
                "md5": "bf45091a6b33463f0a14dd8e724bb812",
                "sha256": "418270bf30eb708be1db64d3ee4d546feb0c2fd11c510f661b8f11c531b00878"
            },
            "downloads": -1,
            "filename": "cyaudit-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "bf45091a6b33463f0a14dd8e724bb812",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 304688,
            "upload_time": "2025-01-24T04:03:03",
            "upload_time_iso_8601": "2025-01-24T04:03:03.636396Z",
            "url": "https://files.pythonhosted.org/packages/a4/cc/37bbe4c352760ce34af9ab3887ff78c29cbd805cb89b00b370851266e728/cyaudit-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-24 04:03:03",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "cyaudit"
}
        
Elapsed time: 1.96185s