Skip to main content
Semgrep Malware Firewall is in private beta.
If the Semgrep Malware Firewall blocks a package version you need, use the mfw CLI to request an exception for your organization’s deployment. Admins use the same CLI to review, approve, or deny requests and revoke approved exceptions.

How exceptions work

An exception request goes through the following steps:
  1. The firewall blocks a package version during an install.
  2. A requester runs mfw exception request and explains why they need that version.
  3. If an admin set up notifications for your deployment, Semgrep posts the request to a Slack channel or webhook. For more information, see Get notified about new requests.
  4. A deployment admin approves or denies the request with mfw exception review.
  5. After approval, the firewall allows that version on every machine in the deployment.
Keep the following in mind:
  • An exception covers one exact version. It applies to one ecosystem, package name, and version, such as npm/example-package@1.2.3. It doesn’t cover version ranges, and every other version of the package stays blocked.
  • An exception applies to your whole deployment. It isn’t limited to the requester, or to one machine or project.
  • The package stays blocked until an admin approves the request. Requesting an exception doesn’t change anything on your machine. If you retry the install while the request is waiting, the firewall blocks it again.
  • Approvals and revocations take up to 5 minutes to apply. To apply a change on your own machine right away, run mfw restart.

When an approval stops applying

An approval covers the advisories that matched the package when the requester asked for the exception. If those advisories change later, the firewall stops applying the approval and blocks the package again. The request’s status stays approved, but mfw exception list notes that it’s no longer applied, and mfw exception review labels it STALE. An admin must revoke the approval before anyone can request an exception for that version again.

Request an exception or review a request

Open the tab for the task you want to finish. An admin can request an exception and review requests.
PrerequisitesTo request an exception:
  • The Malware Firewall is installed on your machine and turned on for your deployment. For more information, see Install and verify.
  • You’re signed in to the firewall with your own Semgrep account through mfw login. API tokens, such as one set in SEMGREP_APP_TOKEN, can’t request exceptions yet.

Request an exception

To request an exception for a blocked package, follow these steps:
1
Find the blocked package in the install output. The firewall lists each package that it blocked, with a link to each advisory that matched.
2
Request an exception for that exact version:
Replace the following:
  • ECOSYSTEM: The package’s ecosystem, such as npm or pypi. See Ecosystems and package names.
  • NAME@VERSION: The exact package version from the install output, such as example-package@1.2.3.
  • REASON: Why you need this version. Admins see it when they review the request.
For example:
If you leave out --reason, mfw asks for one, then asks you to confirm before it sends the request.
3
Confirm that mfw sent the request. The output looks like this:
If you belong to more than one deployment, mfw files a separate request in each deployment that has the firewall turned on. An admin of each deployment reviews it. If a request for the same version already exists, mfw tells you its status instead of filing another one.

Ecosystems and package names

Use one of the following ecosystem names:For Maven and Gradle projects, the ecosystem is maven and the package name is the groupId:artifactId coordinate. Maven SNAPSHOT versions can’t have exceptions, because a snapshot refers to a series of builds that keeps changing. Request the exact release instead.

Request options

Check the status of your requests

To see every exception request you’ve made, run:
Each line shows the request ID, the package, the deployment, and the request’s status:
A request has one of the following statuses:To narrow the list, pass a package, a status, or both. To include more than one status, repeat --state:

Install a package after approval

After an admin approves your request, the firewall allows the package on every machine in your deployment within about 5 minutes. To apply the approval on your own machine right away, run:
Then run your install again. The install succeeds, and the firewall prints a line like the following for each package that an exception allowed:
This line means that Semgrep still flags the package as malicious. The firewall let it through only because an admin approved an exception for it. If the package matched advisories, a link to each one follows the line.

Troubleshoot a request

To fix a failed request or install, match the message or symptom in the following table:

Limitations

Exceptions have the following limitations:
  • User sign-in only. API tokens can’t request or review exceptions yet. Sign in with mfw login.
  • Review happens in the CLI. You can’t approve, deny, or revoke requests in Semgrep AppSec Platform or Slack.
  • Exact versions only. An exception can’t cover a version range or a Maven SNAPSHOT version.
  • Packages flagged by inline scanning have no advisory. Semgrep’s inline scanning flags some packages without a published advisory. For these requests, mfw shows Advisories: none; flagged by inline scanning, and the Slack message shows Flagged by inline scanning.