Skip to content

fix(network-ops): provision the full toolchain and harden the install script (ENG-8822) - #172

Merged
thomasqbrady merged 1 commit into
mainfrom
eng-8822-network-ops-toolchain
Oct 14, 2026
Merged

thomasqbrady merged 1 commit into
mainfrom
eng-8822-network-ops-toolchain

Conversation

@thomasqbrady

Copy link
Copy Markdown
Contributor

Summary

On the local Docker sandbox, the network-ops capability (2.1.7) failed to load. Two root causes:

  1. Toolchain not installed. Most tools the pipeline shells out to were never declared for install, and several had no pre-flight check — so they were missing at call time with no warning.
  2. Install script hard-failed. scripts/install_coercion_tools.sh created root-owned system directories (/usr/share/wordlists, /opt) as the non-root sandbox user under set -euo pipefail, so the first mkdir Permission-denied aborted the whole script and the capability failed to load.

Changes

  • Declare the toolchain in capability.yaml:
    • apt: nmap, smbclient, hashcat, john
    • pip: impacket, certipy-ad, bloodyAD
    • NetExec (nxc) is not on PyPI, so the install script fetches its prebuilt standalone binary (pinned v1.5.0, the most recent release carrying a Linux build) and symlinks netexec/NetExec → nxc (the tools invoke netexec).
  • Add a checks: entry for every invoked tool and fetched asset, so a gap surfaces in pre-flight rather than as a command-not-found mid-run.
  • Harden the install script: every privileged write goes through a sudo -n, non-fatal helper (ensure_writable_dir); downloads and clones are non-fatal. A sandbox without egress or sudo still loads the capability, just without the optional assets.
  • Tests (tests/test_provisioning.py): static guards (toolchain declared, every tool checked, no unguarded privileged mkdir, clones conditional) plus a behavioral test that runs the script with every privileged operation failing and asserts it still exits 0.

Verification

  • dreadnode capability validate passes (checks report the tools absent on the validation host, as expected — they install at provision time).
  • Package resolution and check-alias correctness confirmed by installing each tool on the ubuntu:24.04 runtime base.
  • NetExec's prebuilt binary confirmed to run on the real base (ubuntu:24.04 / glibc 2.39) via an E2B sandbox, including invocation through the netexec symlink.
  • Full network-ops test suite passes (54 tests).

Note

This PR also lands the capability's in-progress 2.1.7 work (pipeline agents, skills, worker, tool updates) that was already staged in the working tree; the provisioning changes above are the focus.

ENG-8822

… script (ENG-8822)

On the local Docker sandbox the capability failed to load: install_coercion_tools.sh
created root-owned system directories (/usr/share/wordlists, /opt) as the non-root
sandbox user under `set -euo pipefail`, so the first failure aborted provisioning —
and most of the toolchain was never declared for install at all.

- Declare the apt tools (nmap, smbclient, hashcat, john) and pip tools
  (certipy-ad, bloodyAD) in dependencies; fetch NetExec's prebuilt binary in the
  install script (it is not on PyPI) and symlink `netexec` -> `nxc`.
- Add a check for every invoked tool and fetched asset so a gap surfaces in
  pre-flight rather than as a command-not-found mid-run.
- Route every privileged write through a sudo-aware (`sudo -n`), non-fatal helper
  so one unwritable path can no longer abort the capability load.
- Add provisioning regression tests.
@thomasqbrady
thomasqbrady force-pushed the eng-8822-network-ops-toolchain branch from 63cf657 to 1cb478a Compare October 14, 2026 14:13
@thomasqbrady
thomasqbrady merged commit 8e8ebe2 into main Oct 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants