home | help
glab(1) 								 glab(1)

NAME
     glab-dependency-firewall - Configure and monitor GitLab Dependency Firewall
     for local package managers. (BETA)

SYNOPSIS
     glab dependency-firewall  [flags]

DESCRIPTION
     Commands  to  configure  GitLab  Dependency Firewall for local package man-
     agers, run local package managers with a  summary	of  blocked  or  flagged
     packages, and view activity during the current session.

     Each  package  manager command, like glab dependency-firewall npm, runs the
     package manager binary and forwards every argument to  it	verbatim.  While
     the package manager runs, the command:

       1. Starts  a  local  proxy and routes the package manager's HTTPS traffic
	  through it.

       2. Reads the name and version of each package the package  manager  down-
	  loads or publishes.

       3. Asks	GitLab	to  evaluate  the  package  against the policies for the
	  project in your Git remote.

       4. Refuses blocked packages with a 403 response that gives the block rea-
	  son, and lets allowed and warned packages through.

       5. Records blocked and  warned  packages  in  .gitlab/df/ci-log.json  and
	  prints a summary.

     When  the	package  manager  finishes,  the command prints a summary of the
     packages that matched your policies. A ^a marks a blocked package, and a ^a^2
     marks a package with a warning. If no package matched, the  command  prints
     no  summary.  A run with at least one blocked package prints the summary to
     standard error. A run with only warnings prints it to standard output.

     Evaluation results are cached for the length of a run, so	a  package  that
     appears many times in a dependency tree is evaluated once.

     If  GitLab  can't	evaluate a package, the command blocks it. If the Depen-
     dency Firewall isn't evaluating the project, the command allows every pack-
     age.

     The command does not change your registry configuration. For the length  of
     the  run,	it  sets  environment variables that route the package manager's
     traffic through the proxy and make the package manager trust the proxy cer-
     tificate. Your existing CA bundles stay trusted.

     To  reach	package  registries,  the  proxy  uses	the  outbound  proxy  in
     HTTPS_PROXY,  including  any  credentials	in  its URL. For plain-HTTP reg-
     istries it uses HTTP_PROXY instead, when that's  set.  For  npm  and  pnpm,
     HTTPS_PROXY takes precedence over HTTP_PROXY for plain-HTTP registries too,
     matching those tools. It connects directly to the hosts listed in NO_PROXY.
     The  proxy  setting  in  your glab configuration applies only to GitLab API
     calls.

     If an https:// outbound proxy requires  a	client	certificate,  the  proxy
     presents the certificate in the client_cert setting for your GitLab host to
     it. Package registries never receive that certificate, and module downloads
     by glab dependency-firewall go don't present it.

     Some  package  managers have proxy environment variables of their own, such
     as     npm_config_https_proxy,	YARN_HTTPS_PROXY,     PIP_PROXY,     and
     CARGO_HTTP_PROXY. The proxy reads those variables first, so for those pack-
     age managers the outbound proxy can differ from HTTPS_PROXY and HTTP_PROXY.
     A	proxy  from  Yarn's  or  pip's	own  settings  also  applies to hosts in
     NO_PROXY, as it does in those tools.

     For npm, Yarn, pip, pipenv, and cargo, the proxy also reads the  same  set-
     tings  from your user and global config files, such as ~/.npmrc, ~/.yarnrc,
     ~/.yarnrc.yml, pip.conf, and $CARGO_HOME/config.toml. For Maven and Gradle,
     it reads the proxy settings in your user and  global  config  files  first,
     such as ~/.m2/settings.xml and ~/.gradle/gradle.properties. It doesn't read
     proxy  settings  from  files  inside  the	project,  such	as  a  .npmrc or
     .cargo/config.toml in the repository, or  a  user	or  global  config  file
     stored  there.  Outside  a Git repository, the working directory and every-
     thing under it count as the project.

     A proxy from  Maven's  or	Gradle's  settings  also  applies  to  hosts  in
     NO_PROXY,	as it does in those tools, but not to the hosts in its nonProxy-
     Hosts or http.nonProxyHosts setting. Maven proxy passwords  encrypted  with
     settings-security.xml are not supported.

     Connections  to  package registries trust the system certificates, the cer-
     tificate in the ca_cert setting for your GitLab host, and the CA bundles in
     SSL_CERT_FILE,   REQUESTS_CA_BUNDLE,   PIP_CERT,	 TWINE_CERT,	NODE_EX-
     TRA_CA_CERTS,  BUNDLE_SSL_CA_CERT,  and CARGO_HTTP_CAINFO. GitLab API calls
     trust only the system certificates and ca_cert, so if your  outbound  proxy
     uses a private certificate authority, set ca_cert to that CA to cover both.
     glab  dependency-firewall	go uses the same outbound proxy and certificates
     for module downloads from a module proxy. On macOS, on  Windows,  and  when
     only  SSL_CERT_DIR is set, go keeps its own trust for them. Modules that go
     fetches directly from version control use the certificate	and  proxy  set-
     tings of go and git.

     Maven  and  Gradle  registry  connections also trust the JVM truststore set
     with  -Djavax.net.ssl.trustStore  in  MAVEN_OPTS,	GRADLE_OPTS,  JAVA_OPTS,
     JAVA_TOOL_OPTIONS,  JDK_JAVA_OPTIONS,  or .mvn/jvm.config. Without that op-
     tion, they trust the default truststore of the JDK in JAVA_HOME.  When  the
     option  names  a  file  that does not exist or cannot be opened, they trust
     that JDK's cacerts instead, as the JVM does. Only PKCS#12	truststores  are
     read.  When  the command opens a truststore that one of these options names
     but cannot use it, for example a JKS truststore, it prints a warning. A JDK
     default truststore in JKS format, which JDK 17 and earlier ship, is skipped
     without a warning.

     Maven   registry	connections   also   trust   a	 truststore   set   with
     -Djavax.net.ssl.trustStore   in   the   mvn   arguments,	MAVEN_ARGS,   or
     .mvn/maven.config, unless one of the options above sets the same  property,
     as  on Maven 4. On Maven 3, such an option replaces the truststore the com-
     mand gives Maven, so Maven cannot trust the proxy and the run fails. On the
     gradle command line, it does the same to Gradle. The command warns in  both
     cases. Set it in MAVEN_OPTS or GRADLE_OPTS instead.

     A	truststore set in _JAVA_OPTIONS, or for Maven in MAVEN_DEBUG_OPTS or, on
     Maven 4, .mvn/jvm.config, replaces the truststore the command  gives  Maven
     or  Gradle,  so  they  cannot  trust the proxy and the run fails. Set it in
     MAVEN_OPTS or GRADLE_OPTS instead. The command  warns  about  _JAVA_OPTIONS
     and MAVEN_DEBUG_OPTS.

     The command writes .gitlab/df/ci-log.json to the working directory on every
     run, including local runs. Add .gitlab/df/ to your .gitignore file.

     To  run  a  package  manager  command  in	a GitLab CI/CD job, set GLAB_EN-
     ABLE_CI_AUTOLOGIN to true so the command signs in with the CI/CD job token.
     When the firewall blocks a package, the install fails, and so does the job.
     For more information, see CI/CD auto-login <https://docs.gitlab.com/cli/au-
     thentication/#auto-login>.

     install:
       variables:
	 GLAB_ENABLE_CI_AUTOLOGIN: "true"
       script:
	 - glab dependency-firewall npm ci

     Package manager commands exit with the following codes:

     +-------------------------------+-----------------------------+
     | Exit code		     | Meaning			   |
     +-------------------------------+-----------------------------+
     | The package manager exit code | The package manager ran and |
     |				     | exited.			   |
     +-------------------------------+-----------------------------+
     | 1			     | The package manager was not |
     |				     | found on your PATH or could |
     |				     | not start.		   |
     +-------------------------------+-----------------------------+
     | 130			     | The run was interrupted	or |
     |				     | stopped,  for example, with |
     |				     | Control+C or when  a  CI/CD |
     |				     | job is canceled. 	   |
     +-------------------------------+-----------------------------+

     This  feature  is	in  beta  and might not be ready for production use.  It
     might be unstable and breaking changes can occur outside of major releases.
     For   more   information,	  see	 https://docs.gitlab.com/policy/develop-
     ment_stages_support/.

OPTIONS INHERITED FROM PARENT COMMANDS
     -h, --help[=false]      Show help for this command.

SEE ALSO
     glab(1),	 glab-dependency-firewall-bundle(1),   glab-dependency-firewall-
     cargo(1), glab-dependency-firewall-ci-summary(1), glab-dependency-firewall-
     gem(1), glab-dependency-firewall-go(1), glab-dependency-firewall-gradle(1),
     glab-dependency-firewall-job-proxy(1),   glab-dependency-firewall-maven(1),
     glab-dependency-firewall-npm(1), glab-dependency-firewall-package(1), glab-
     dependency-firewall-pip(1), glab-dependency-firewall-pipenv(1), glab-depen-
     dency-firewall-pnpm(1),   glab-dependency-firewall-poetry(1),   glab-depen-
     dency-firewall-twine(1),  glab-dependency-firewall-uv(1),	glab-dependency-
     firewall-yarn(1)

Auto generated by spf13/cobra	    Nov 2026				 glab(1)

home | help