-
Notifications
You must be signed in to change notification settings - Fork 19
feat(smitebot): add working doctor command (checks + --json + docs) #77
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
Open
Ashish-Kumar-Dash
wants to merge
7
commits into
morehouse:master
Choose a base branch
from
Ashish-Kumar-Dash:feat/smitebot-doctor-command
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d5acc80
feat(smitebot): implement doctor command with prerequisite checks and…
Ashish-Kumar-Dash 8698e9c
refactor(smitebot):Refactor doctor into modules + add tests
Ashish-Kumar-Dash fd10aad
fix(smitebot): rustfmt fixes
Ashish-Kumar-Dash 159e317
refactor(smitebot): minor edit in README
Ashish-Kumar-Dash 8f8f7c9
fix(smitebot): Include smitebot in workload Docker builds
Ashish-Kumar-Dash a44d67e
Docs(smitebot): clarify doctor output + utils intent
Ashish-Kumar-Dash 2f5b01f
Docs(smitebot); minor change
Ashish-Kumar-Dash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| [package] | ||
| name = "smitebot" | ||
| version.workspace = true | ||
| edition.workspace = true | ||
| license.workspace = true | ||
|
|
||
| [lints] | ||
| workspace = true | ||
|
|
||
| [dependencies] | ||
| clap = { version = "4.5", features = ["derive"] } | ||
| serde.workspace = true | ||
| serde_json.workspace = true | ||
| thiserror.workspace = true | ||
|
|
||
| [dev-dependencies] | ||
| tempfile = "3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # smitebot | ||
|
|
||
| `smitebot` is the Smite automation CLI. It is intended to orchestrate common fuzzing workflows and reduce manual setup/operations. | ||
|
|
||
| ## Install | ||
|
|
||
| Install `smitebot` once from this repository: | ||
|
|
||
| ```bash | ||
| cargo install --path smitebot | ||
| ``` | ||
|
|
||
| After install, run it directly: | ||
|
|
||
| ```bash | ||
| smitebot doctor | ||
| smitebot doctor --json | ||
| ``` | ||
|
|
||
| ## Commands | ||
|
|
||
| ### smitebot doctor | ||
|
|
||
| `smitebot doctor` validates host prerequisites before running Smite campaigns. | ||
|
|
||
| ```bash | ||
| smitebot doctor | ||
| smitebot doctor --json | ||
| smitebot doctor --aflpp-path ~/AFLplusplus --smite-dir . | ||
|
Ashish-Kumar-Dash marked this conversation as resolved.
|
||
| ``` | ||
|
Ashish-Kumar-Dash marked this conversation as resolved.
|
||
|
|
||
| ## Checks | ||
|
|
||
| - `x86_64` architecture | ||
| - CPU virtualization enabled (`vmx` or `svm`) | ||
| - `/dev/kvm` is present and openable | ||
| - Docker daemon is reachable (`docker info`) | ||
| - Required host tools (`bash`, `python3`) | ||
| - AFL++ tools (`afl-fuzz`, `afl-cmin`, `afl-tmin`, `afl-whatsup`) available on `PATH` or under `--aflpp-path` | ||
| - Nyx packer `hget` exists under AFL++ | ||
| - `libnyx.so` is found on `LD_LIBRARY_PATH` or under `--aflpp-path` | ||
| - VMware backdoor is enabled | ||
| - Required Smite scripts are present and executable | ||
| - Required workload Dockerfiles are present | ||
|
|
||
| ## JSON output | ||
|
|
||
| By default, output is in a human readable format. The `--json` flag changes output to structured JSON: | ||
|
|
||
| ```json | ||
| { | ||
| "checks": [ | ||
| { "name": "x86_64 architecture", "passed": true }, | ||
| { "name": "Docker daemon reachable", "passed": false, "reason": "docker info exited with status exit status: 1" } | ||
| ], | ||
| "overall": false | ||
| } | ||
| ``` | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.