Skip to content

fix(network-ops): isolate certipy-ad and bloodyAD into uv tool envs - #191

Merged
briangreunke merged 2 commits into
mainfrom
feat/eng-8935-certipy-bloodyad-tool-envs
Oct 20, 2026
Merged

briangreunke merged 2 commits into
mainfrom
feat/eng-8935-certipy-bloodyad-tool-envs

Conversation

@briangreunke

@briangreunke briangreunke commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

network-ops declared certipy-ad and bloodyAD in dependencies.python, which the SDK installs unconstrained into the shared runtime virtualenv. Their conflicting cryptography pins made the resolver backtrack certipy-ad to 4.8.2 — which fails to start (ModuleNotFoundError: pkg_resources) — and downgraded the shared venv's cryptography to 44.0.2 (several CVEs; breaks joserfc, which needs cryptography >= 45).

This moves both tools out of the shared venv into isolated uv tool environments provisioned by install_coercion_tools.sh, so the shared venv keeps a current cryptography and both commands still resolve from $HOME/.local/bin.

Changes

  • capability.yaml — drop certipy-ad/bloodyAD from dependencies.python (keep loguru, impacket); bump version 3.0.1 → 3.0.2.
  • scripts/install_coercion_tools.sh — after the nxc block, add uv tool install certipy-ad==5.1.0 and uv tool install bloodyAD==2.5.5, each command -v-guarded (skip + "already present, skipping") and non-fatal when uv is missing or the install fails.
  • tools/certipy.py, tools/bloodyad.py — "not found in PATH" warnings (and the bloodyAD docstring) now point to the uv tool install ... command instead of pip install.
  • tests/test_provisioning.py — assert the two packages are no longer in dependencies.python (while loguru/impacket are, and netexec stays out), and that the install script installs both via uv tool install behind a command -v guard.

Validation

  • pytest capabilities/network-ops/tests -q → 170 passed.
  • just validate strict=true → exit 0 (network-ops@3.0.2).
  • CI: all checks green.

Container-level validation against the runtime sandbox image is still pending and should be run before this leaves draft.

🤖 Generated with Claude Code

…ENG-8935)

Remove certipy-ad and bloodyAD from the shared dependencies.python list and
install each into its own isolated `uv tool` environment via
install_coercion_tools.sh instead, avoiding dependency conflicts with the
shared capability virtualenv. Each install is skipped when the tool is
already present, and is non-fatal when `uv` is missing or the install fails.

Updates the "not found in PATH" warnings in tools/certipy.py and
tools/bloodyad.py to point at the new `uv tool install` commands. Bumps
network-ops 3.0.1 -> 3.0.2.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@briangreunke

briangreunke commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Pre-merge review: the diff maps to the issue requirements and is limited to the five touched files. pytest capabilities/network-ops/tests -q (170 passed) and just validate strict=true (exit 0) pass locally, and CI is green.

Container-level validation against the runtime sandbox image is still pending and should be run before this leaves draft.

🤖 Generated with Claude Code

@briangreunke
briangreunke marked this pull request as ready for review October 20, 2026 13:45
@briangreunke
briangreunke requested a balanced review from Copilot October 20, 2026 13:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Provisioning concerns remain unresolved, and required Docker acceptance checks still need verification by a reviewer with registry access.

2 open issues
What changed in this PR

Moves Certipy and bloodyAD into isolated tool environments to avoid dependency conflicts in the shared runtime.

Changes:

  • Removes both shared Python dependencies and bumps network-ops to 3.0.2.
  • Adds pinned, guarded, non-fatal installations through uv tool.
  • Updates installation guidance and provisioning tests.
File Description
capabilities/​network-ops/​tools/​certipy.py Updates installation warning.
capabilities/​network-ops/​tools/​bloodyad.py Updates installation warning and docstring.
capabilities/​network-ops/​tests/​test_provisioning.py Checks dependency isolation, pins, and guards.
capabilities/​network-ops/​scripts/​install_coercion_tools.sh Adds isolated tool installations.
capabilities/​network-ops/​capability.yaml Removes shared dependencies and bumps version.

Review effort: Balanced

Comment on lines +56 to +58
# certipy-ad and bloodyAD are also installed by the script below, each into
# its own isolated `uv tool` environment, to avoid dependency conflicts with
# the shared python deps above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — addressed in d914025. network-ops now declares $HOME/.local/bin in dependencies.path, mirroring web-security/capability.yaml, so the directory is appended to PATH for the preflight checks, MCP subprocesses, and the agent's shell tools (including off-platform under dreadnode serve, where the image PATH doesn't apply). This also covers the existing nxc install, which lands in the same directory.

Comment on lines +106 to +107
if command -v certipy >/dev/null 2>&1 || command -v certipy-ad >/dev/null 2>&1; then
echo "[*] certipy already present, skipping"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case is a long-lived sandbox that already has the broken certipy-ad 4.8.2 on PATH. Remediating pre-existing broken copies is deliberately out of scope here — this change fixes fresh provisioning. The skip-if-present guard is also intended behavior: a runtime that already has a working tool should make no outbound install request.

On a fresh runtime there is no pre-existing certipy, so the guard triggers the isolated install as intended, and with $HOME/.local/bin now declared in dependencies.path the isolated executable is the one on PATH. Leaving the guard as-is.

@briangreunke briangreunke changed the title fix(network-ops): isolate certipy-ad and bloodyAD into uv tool envs (ENG-8935) fix(network-ops): isolate certipy-ad and bloodyAD into uv tool envs Oct 20, 2026
…8935)

The install script drops nxc, certipy, and bloodyAD into $HOME/.local/bin.
Declare it in dependencies.path so the runtime adds it to PATH for preflight
checks, MCP subprocesses, and the agent's shell tools — including off-platform
under `dreadnode serve`, where the image PATH does not apply. Mirrors
web-security.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@briangreunke
briangreunke merged commit ebcb44b into main Oct 20, 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