Semgrep Malware Firewall is in private beta.
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:- The firewall blocks a package version during an install.
- A requester runs
mfw exception requestand explains why they need that version. - 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.
- A deployment admin approves or denies the request with
mfw exception review. - After approval, the firewall allows that version on every machine in the deployment.
- 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 staysapproved, 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.- Request an exception
- Review requests (admins)
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 inSEMGREP_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:If you leave out
ECOSYSTEM: The package’s ecosystem, such asnpmorpypi. See Ecosystems and package names.NAME@VERSION: The exact package version from the install output, such asexample-package@1.2.3.REASON: Why you need this version. Admins see it when they review the request.
--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: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: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: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
SNAPSHOTversion. - Packages flagged by inline scanning have no advisory. Semgrep’s inline scanning flags some packages without a published advisory. For these requests,
mfwshowsAdvisories: none; flagged by inline scanning, and the Slack message shows Flagged by inline scanning.