-
Notifications
You must be signed in to change notification settings - Fork 1
Install latest fuzzer #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
6e96e63
ed71922
dda1487
7a97b0c
35e8616
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| enable=all | ||
| disable=SC2154 # Disabled because it's disabled by trunk | ||
| disable=SC2154 # Disabled because it's disabled in trunk by default | ||
| disable=SC2312 # Disabled because we often don't need return values | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| description = "CloudExec VPS provisioning helper"; | ||
|
|
||
| inputs = { | ||
| nixpkgs.url = "github:nixos/nixpkgs/4ecab3273592f27479a583fb6d975d4aba3486fe"; # v23.05 | ||
| nixpkgs.url = "github:nixos/nixpkgs/11cd405226b6663b1ba2073dc7d8b0d7a78175d9"; # 240209 | ||
bohendo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| utils.url = "github:numtide/flake-utils/04c1b180862888302ddfb2e3ad9eaa63afc60cf8"; # v1.0.0 | ||
| }; | ||
|
|
||
|
|
@@ -101,7 +101,7 @@ | |
| url = "git+ssh://[email protected]/trailofbits/medusa"; | ||
| rev = "72e9b8586ad93b37ff9063ccf3f5b471f934c264"; | ||
| }; | ||
| vendorSha256 = "sha256-IKB8c6oxF5h88FdzUAmNA96BpNo/LIbwzuDCMFsdZNE="; | ||
| vendorHash = "sha256-IKB8c6oxF5h88FdzUAmNA96BpNo/LIbwzuDCMFsdZNE="; | ||
bohendo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| nativeBuildInputs = [ | ||
| packages.crytic-compile | ||
| pkgs.solc | ||
|
|
@@ -134,7 +134,6 @@ | |
| go-tools | ||
| gopls | ||
| go-outline | ||
| gocode | ||
| gopkgs | ||
| gocode-gomod | ||
| godef | ||
bohendo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,23 @@ | |
| # shellcheck source=/dev/null | ||
| set -e | ||
|
|
||
| ######################################## | ||
| ## Helper Functions | ||
|
|
||
| function github_api { | ||
| project="$1" | ||
| github_api="https://api.github.com/repos/${project}/releases/latest" | ||
| curl -s "${github_api}" | ||
| } | ||
|
|
||
| function get_latest_version { | ||
| github_api "$1" | jq '.tag_name' | tr -d 'v' | tr -d '"' | ||
| } | ||
|
|
||
| function get_latest_artifact { | ||
| github_api "$1" | jq '.assets[] | select(.name | test("linux")) | .browser_download_url' | tr -d '"' | ||
| } | ||
|
|
||
|
Comment on lines
+5
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The helper functions function github_api {
project="$1"
github_api="https://api.github.com/repos/${project}/releases/latest"
response=$(curl -s "${github_api}")
if [ $? -ne 0 ]; then
echo "Failed to fetch data from GitHub API for project ${project}"
exit 1
fi
echo "${response}"
} |
||
| ######################################## | ||
| ## Required Configuration and Dependencies | ||
|
|
||
|
|
@@ -15,40 +32,55 @@ export DEBIAN_FRONTEND=noninteractive | |
| apt-get update | ||
| apt-get install -y jq s3cmd tmux python3-pip python3-venv | ||
|
|
||
| echo "Downloading doctl..." | ||
| curl -fsSL -o /tmp/doctl-1.92.0-linux-amd64.tar.gz https://github.com/digitalocean/doctl/releases/download/v1.92.0/doctl-1.92.0-linux-amd64.tar.gz | ||
| echo "Extracting doctl..." | ||
| tar -xzf /tmp/doctl-1.92.0-linux-amd64.tar.gz -C /tmp | ||
| echo "Installing doctl..." | ||
| echo "Installing doctl v$( | ||
| set -e | ||
| get_latest_version "digitalocean/doctl" | ||
| )..." | ||
| curl -fsSL -o /tmp/doctl.tar.gz "$( | ||
| set -e | ||
| get_latest_artifact "digitalocean/doctl" | grep "amd64" | ||
| )" | ||
| tar -xzf /tmp/doctl.tar.gz -C /tmp | ||
| mv /tmp/doctl /usr/local/bin | ||
| echo "Cleaning up..." | ||
| rm /tmp/doctl-1.92.0-linux-amd64.tar.gz | ||
| rm /tmp/doctl.tar.gz | ||
| echo "Done installing: $(doctl version)" | ||
|
|
||
| ######################################## | ||
| ## Common fuzz testing and analysis tools | ||
|
|
||
| echo "Installing solc and slither..." | ||
| echo "Installing slither..." | ||
| python3 -m venv ~/venv | ||
| source ~/venv/bin/activate | ||
| pip3 install solc-select slither-analyzer crytic-compile | ||
| solc-select use latest --always-install | ||
|
|
||
| echo "Downloading echidna..." | ||
| curl -fsSL https://github.com/crytic/echidna/releases/download/v2.2.3/echidna-2.2.3-x86_64-linux.tar.gz -o /tmp/echidna.tar.gz | ||
| echo "Extracting echidna..." | ||
| echo "Installing echidna v$( | ||
| set -e | ||
| get_latest_version "crytic/echidna" | ||
| )..." | ||
| curl -fsSL -o /tmp/echidna.tar.gz "$( | ||
| set -e | ||
| get_latest_artifact "crytic/echidna" | grep -v "sigstore" | ||
| )" | ||
| tar -xzf /tmp/echidna.tar.gz -C /tmp | ||
| echo "Installing echidna..." | ||
| mv /tmp/echidna /usr/local/bin | ||
| chmod +x /usr/local/bin/echidna | ||
| rm /tmp/echidna.tar.gz | ||
| echo "Done installing: $(echidna --version)" | ||
|
|
||
| echo "Downloading medusa..." | ||
| curl -fsSL https://github.com/crytic/medusa/releases/download/v0.1.3/medusa-linux-x64.tar.gz -o /tmp/medusa.tar.gz | ||
| echo "Extracting medusa..." | ||
| echo "Installing medusa v$( | ||
| set -e | ||
| get_latest_version "crytic/medusa" | ||
| )..." | ||
| curl -fsSL -o /tmp/medusa.tar.gz "$( | ||
| set -e | ||
| get_latest_artifact "crytic/medusa" | grep -v "sigstore" | ||
| )" | ||
| tar -xzf /tmp/medusa.tar.gz -C /tmp | ||
| echo "Installing medusa..." | ||
| chmod +x /tmp/medusa | ||
| sudo mv /tmp/medusa /usr/local/bin | ||
| chmod +x /usr/local/bin/medusa | ||
| rm /tmp/medusa.tar.gz | ||
| echo "Done installing: $(medusa --version)" | ||
bohendo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| echo "Installing docker and its dependencies..." | ||
| apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common | ||
|
|
@@ -61,3 +93,7 @@ apt-get install -y docker-ce docker-ce-cli containerd.io | |
| user="$(whoami)" | ||
| usermod -aG docker "${user}" | ||
| systemctl enable docker | ||
| echo "Done installing docker:" | ||
| docker version | ||
|
|
||
| echo "Done provisioning" | ||
Uh oh!
There was an error while loading. Please reload this page.