mcpField
G
glab-dependency-firewall

glab-dependency-firewall

github.com/vince-winkintelSecurity4960 installsUpdated 1d ago
Repository

About glab-dependency-firewall

glab dependency-firewall is a command-line skill for GitLab Dependency Firewall, with package checks and policy-enforced package-manager operations. It also summarizes CI activity and blocks in-scope traffic that cannot be parsed or approved.

Key features

  1. 01Check versioned package coordinates
  2. 02Run supported package managers for installs or uploads
  3. 03Enforce dependency policy on package traffic
  4. 04Read and summarize CI activity

Use cases

  1. 01Check npm, PyPI, Maven, or RubyGems packages
  2. 02Run policy-checked installs in a GitLab project
  3. 03Review Dependency Firewall blocks
  4. 04Troubleshoot package parsing or policy failures

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/vince-winkintel/gitlab-cli-skills --skill glab-dependency-firewall

After installing, type/glab-dependency-firewallin Claude Code to confirm it loaded.

Bundled filesreferences/commands.md

Details

From the project README

glab dependency-firewall

Check package URLs, run supported package managers through GitLab Dependency Firewall, and inspect recorded activity. This command group is experimental; confirm availability before relying on it in durable automation.

NuGet traffic matching

The proxy recognizes NuGet v3 flatcontainer package downloads and multipart PUT package/symbol uploads. Unparseable in-scope traffic fails closed, including .nupkg download URLs outside the supported flatcontainer shape. This matcher does not expose a nuget or dotnet wrapper, and does not extend the package command's supported PURL types. Use only wrappers listed by parent help.

Check one package

Use package when you need a policy decision for one versioned package coordinate without running a package manager:

glab dependency-firewall package pkg:npm/[email protected]
glab dependency-firewall package pkg:pypi/[email protected]
glab dependency-firewall package pkg:maven/org.slf4j/[email protected]
glab dependency-firewall package pkg:gem/[email protected]

The supported PURL types are npm, pypi, maven, and gem, and the PURL must include a version. Exit 0 means allow or warning, exit 1 means misconfiguration or transport failure, and exit 3 means blocked. Treat a warning as review input even though it exits zero, and treat exit 3 as a policy result rather than retrying around it. This command does not write .gitlab/df/ci-log.json, so its result does not appear in ci-summary.

Supported wrappers

Each wrapper first resolves the GitLab project from the current repository and creates a GitLab API client, then obtains that project's Dependency Firewall policy, forwards all remaining arguments to the named package-manager binary, enforces policy on package traffic, and summarizes the run. Project resolution always runs before the package manager starts. The wrappers use the package manager's existing registry, index, or source configuration rather than rewriting it.

Current glab streams recognized successful package artifacts with a known content length instead of buffering the entire artifact in memory. This covers wheels, crates, tarballs, ZIPs, gems, JARs, WARs, AARs, and NuGet packages by extension or supported binary content type. Unknown-length, transport-decompressed, metadata, and non-success responses still use the buffered path so HTTP framing and headers can be repaired safely. Preserve the package manager's checksum/integrity verification and treat any partial-download error as a failed install.

glab commandExecutableExample
cargocargoglab dependency-firewall cargo fetch
bundlebundleglab dependency-firewall bundle install
gemgemglab dependency-firewall gem install rake
gradlegradleglab dependency-firewall gradle build
mavenmvnglab dependency-firewall maven verify
npmnpmglab dependency-firewall npm ci --ignore-scripts
pippipglab dependency-firewall pip install requests
pipenvpipenvglab dependency-firewall pipenv install requests
pnpmpnpmglab dependency-firewall pnpm install left-pad
poetrypoetryglab dependency-firewall poetry add requests
twinetwineglab dependency-firewall twine upload dist/*
uvuvglab dependency-firewall uv pip install requests
yarnyarnglab dependency-firewall yarn add left-pad

Run wrappers inside a Git repository whose GitLab remote identifies the intended project, and verify glab authentication first. Treat a policy block as authoritative; do not retry outside the wrapper merely to bypass the result.

Unparseable package traffic

The proxy fails closed when it recognizes an in-scope package upload or download but cannot determine its package coordinates. Examples include malformed publish metadata, uploads beyond the inspection limit, and malformed artifact filenames or paths. Such requests are blocked with HTTP 403 and recorded as blocks before contacting the upstream registry or policy checker. A policy-check error also blocks the request.

Metadata, indexes, and sidecar requests classified as out of scope still pass through; this is not a claim that every possible package protocol is inspected. Check the recorded reason and the package manager's request format when troubleshooting. Do not retry outside the wrapper to bypass a parsing or policy block. Internal ecosystem matchers do not imply additional CLI wrappers are available.

Wrapper help

Everything after the wrapper name is forwarded verbatim to the package manager. Wrapper commands use DisableFlagParsing, so glab flags such as -h, -R, --repo, or --hostname are not parsed there. Project resolution and GitLab API-client creation still run first; outside a GitLab-remote repository or valid auth context, glab dependency-firewall <wrapper> --help fails before the package manager can show help.

# Parent command and supported wrappers
glab dependency-firewall --help
glab help dependency-firewall package

# glab's wrapper help without invoking the package manager
glab help dependency-firewall cargo
glab help dependency-firewall npm
glab help dependency-firewall maven
glab help dependency-firewall uv
glab help dependency-firewall yarn

Use glab help dependency-firewall <wrapper> for every wrapper when generating documentation or automation. Do not rely on glab dependency-firewall <wrapper> --help for wrapper discovery.

Summarize CI activity

ci-summary reads .gitlab/df/ci-log.json relative to the current working directory. Run it from the same directory as the package-manager/Dependency Firewall operation that produced the log.

if glab dependency-firewall ci-summary; then
  echo "No blocked dependency entries"
else
  rc=$?
  case "$rc" in
    1) echo "Dependency Firewall log could not be read" >&2 ;;
    3) echo "Dependency Firewall blocked one or more packages" >&2 ;;
    *) echo "Unexpected Dependency Firewall failure: $rc" >&2 ;;
  esac
  exit "$rc"
fi

Exit codes:

  • 0: no blocked entries; allow-only, warnings-only, or no recorded activity.
  • 1: the log could not be read or parsed.
  • 3: one or more entries were blocked.

Treat exit 3 as a policy result, not a transient command failure. Surface the blocked package, version, and reason; do not bypass the policy or rewrite the log. Treat warnings as review input even though they do not fail the command.

Current human-readable summaries use a colored Unicode box when the terminal supports it. Do not parse that presentation format; use exit codes and the underlying log for automation.

Troubleshooting

No activity is reported:

  • Confirm .gitlab/df/ci-log.json exists under the current working directory used for the command.
  • Do not assume a log in a repository root applies when the package manager ran in a nested workspace.

Wrapper help is confusing:

  • Use glab help dependency-firewall <wrapper>.
  • Direct wrapper invocations always resolve the GitLab project and client before starting the package manager, and glab flags after the wrapper name are passed to the package manager.

A package manager is not listed:

  • Do not invent a wrapper from internal support code or a similar package ecosystem.
  • Check the current parent help and official docs for the target glab/GitLab version.

The package manager uses the wrong registry/index/source:

  • The wrapper intentionally uses existing package-manager configuration.
  • Inspect that configuration without printing credentials, then correct it through the package manager's documented workflow rather than expecting glab to rewrite it.

Command reference

See references/commands.md for checksum-verified parent, package-check, wrapper, and summary help.

Comments

Markdown supported