Custom scan volumes
A custom scan volume is an extra FossID scan server that your organization hosts. It typically holds code FossID's own knowledge base doesn't know about: your company's other products, a customer's codebase, or code you have licensed under specific terms.
When volumes are configured, FossID checks your files against each of them in addition to your main FossID server. A match on a volume is reported as its own finding. It doesn't mean there is a license problem. It means this code also appears in someone else's codebase, which only you can judge.
Set up the scan server for a volume
A volume runs on a FossID scan server that you host. The server is the container image quay.io/fossid/fossid-scan-server. The same image serves any number of volumes, so you don't need a new image for each volume.
You need:
- Docker.
- Credentials to pull FossID's images from Quay. Ask your FossID contact.
- A volume that you built from your source code with FossID's
kb-generatortool. - FossID for VS Code 1.0.1 or later, if the server checks sign-ins.
Pull quay.io/fossid/fossid-scan-server:latest, or pin quay.io/fossid/fossid-scan-server:0.2.2 to stay on a known build. Use 0.2.2 or later. Earlier images put the server's command lines, output and request bodies into error responses.
Start the server with the kb-generator workspace folder mounted at /fossid/vols. That folder holds your volume. The volume is called VOLCUSTOM, unless you chose another name with the --volume option of kb-generator. Without the mount, the server uses a small built-in test volume. Two settings choose who may use the server:
| Who may use the volume | FOSSID_GATEWAY_AUTH | FOSSID_GATEWAY_JWT_CUSTOMERS |
|---|---|---|
| Only people in your organization | jwt | <your customer ID> |
| Everyone who signs in to FossID | jwt | '*' |
| Anyone who can reach the server | off | not set |
Let only your organization use the volume
docker run --rm \
-v /data/workspace:/fossid/vols \
-e FOSSID_GATEWAY_AUTH=jwt \
-e FOSSID_GATEWAY_JWT_CUSTOMERS=<your customer ID> \
-p 8080:8080 \
quay.io/fossid/fossid-scan-server:latest
VS Code sends the sign-in that you made with your organization. The server accepts it only if it carries your customer ID. The ID is a lowercase UUID, for example 11111111-2222-4333-8444-555555555555. An account admin sees it on the Customer ID card on the Overview page of the FossID account site, https://auth.fossid.app. Select Copy to copy it.
To serve more than one organization, separate the IDs with commas. A value that is not a customer ID stops the server from starting, and its log says so.
Set both settings. If you set only FOSSID_GATEWAY_JWT_CUSTOMERS, the image keeps its own setting, off. The server then checks nothing and writes only a warning to its log.
The server checks each sign-in with FossID's public signing keys. It must be able to open outbound HTTPS connections to https://auth.fossid.app to get them. It keeps the keys in memory for 24 hours, and a restart empties the memory. If the server can't reach https://auth.fossid.app when it needs the keys, every sign-in fails with a 500 error until it can.
A person can scan only if their sign-in has the MCP permission (mcp). Without it, the server answers 403. Ask your FossID contact. The connection check that FossID runs doesn't test this permission. A successful check proves that the volume is reachable and that it accepts your sign-in. It doesn't prove that your account may scan.
Versions of FossID for VS Code before 1.0.1 don't send your sign-in to a volume. A server that checks sign-ins refuses those requests, and FossID warns refused the scan credential. Update VS Code, or use off until you can.
Let everyone who signs in to FossID use the volume
To share a volume, set the customers to *. Put the * in quotes on the command line, or your shell expands it:
docker run --rm \
-v /data/workspace:/fossid/vols \
-e FOSSID_GATEWAY_AUTH=jwt \
-e 'FOSSID_GATEWAY_JWT_CUSTOMERS=*' \
-p 8080:8080 \
quay.io/fossid/fossid-scan-server:latest
The server then accepts a sign-in from any organization that FossID's sign-in service serves. The rest is as above.
Important: With
*, any FossID sign-in can read what the volume holds, including a copy of your source code. Use*only for a volume that you mean to share. Build the volume with--no-mirrorif the source must stay private.
Don't check sign-ins
Set FOSSID_GATEWAY_AUTH=off to switch the check off. Every version of FossID for VS Code can then use the volume:
docker run --rm \
-v /data/workspace:/fossid/vols \
-e FOSSID_GATEWAY_AUTH=off \
-p 8080:8080 \
quay.io/fossid/fossid-scan-server:latest
Important: With
off, anyone who can reach the server's port can read what the volume holds. By default, that includes a copy of your source code. Keep the server on a private network that only your own people can reach, such as your VPN.
If you don't need FossID to show the matched code of the volume, build the volume with the --no-mirror option of kb-generator. The volume then holds no source code. Snippet matching still works.
Check that the server checks sign-ins
Important: A server from an older image ignores
FOSSID_GATEWAY_AUTHand accepts every request. A misspelled setting name leaves the server open in the same way. Nothing in the log says so.
After you start the server, send it a request without a sign-in:
curl -s -o /dev/null -w '%{http_code}\n' http://<server>:8080/capabilities
401 means the server checks sign-ins. 200 means it does not. Don't use /healthz for this check. It answers the same either way.
Give VS Code the address
The server speaks plain HTTP on port 8080, and it has no setting for TLS. VS Code needs an https:// address, except for a server on your own machine. Put a reverse proxy or a load balancer that ends TLS in front of the server. Make sure that it passes the Authorization header on to the server. Then enter its address as the volume's URL, as described in Adding a volume.
Change the server's settings
Every setting of the server is also an environment variable: FOSSID_ followed by the setting's name in upper case. The environment wins over the configuration file. For example, FOSSID_GATEWAY_MAX_CONCURRENT_REQUESTS limits how many requests the server handles at the same time.
If the server turns down the sign-in
The person sees a status code. The server's log says why.
| Status | What it means | What to check |
|---|---|---|
| 401 | The request has no credential, or the sign-in is expired, damaged, or not from FossID's sign-in service. | Sign in again. |
| 403 | The sign-in is valid, but this server doesn't serve the person's organization. The response says only "forbidden", and signing in again doesn't help. | Find the log line customer is not listed in gateway_jwt_customers. It shows the ID of the organization that was refused. Compare it with your setting. Add an ID only if it is your own organization. |
403, with the header WWW-Authenticate: Bearer error="insufficient_scope", scope="mcp" | The organization doesn't have the permission that scope names. The scope mcp is the MCP permission. | Ask your FossID contact. |
| 500 | The server couldn't get FossID's signing keys. The fault is on the way to FossID's sign-in service, not in the person's sign-in. It clears when the server can reach the service again. | Check that the server can reach https://auth.fossid.app. The log says sso signing keys unavailable. This is most likely just after a restart. Signing in again doesn't help. |
If the server doesn't start, its log names the setting. For example: gateway_auth = jwt needs gateway_jwt_customers, the customers it accepts, or invalid gateway_jwt_customers: "<entry>" is not a customer id. A customer ID must be a lowercase UUID.
Also check:
- Both settings are set, and you restarted the server.
- The customer ID is the one on the Customer ID card of the account site.
- Your organization has a FossID subscription, which FossID sets up. Until then, people who sign in see an explanation that the extension needs a FossID subscription, with links to learn more or contact Sales.
Adding a volume
- Open Detection Rules, from the FossID side bar (Policies view) or with FossID: Open Detection Rules.
- In the Custom Volumes section, enter a Name and the volume's URL (for example
https://scan.corp.example). - Select Add volume.
New volumes start at severity Error. Change it in the volume's row:
| Severity | Use it when a match on this volume is… |
|---|---|
| Error | a serious problem that must be fixed. |
| Warning | worth reviewing. |
| Info | routine, but good to know. |
To remove a volume, select Remove and confirm.
Under a company policy, the volumes are your organization's. The banner at the top of the editor says Managed by your organization. With the policy-write permission you can add, remove and re-rate volumes. Until you select Publish, your changes apply only to scans in this window. Once you publish, they apply to everyone. Without it, the volumes are read-only. See License policy.
Naming rules:
- up to 64 letters, digits, dots, dashes and underscores, starting with a letter or digit;
- unique (ignoring case);
- the name
fossidis reserved for your main server.
URL rules: must start with https:// (use http:// only for a local server). Don't include a username or password in the URL.
Without a company policy, volumes are stored in .fossid/policy.json and committed with your code. Under a company policy, the volumes in the repository file are ignored. The file must never contain credentials. A folder must be open to configure volumes.
FossID sends your FossID sign-in to a volume's server only after the checks in Which volumes get your sign-in. Add only servers that your organization runs.
{
"volumes": [
{ "name": "corp-products", "url": "https://scan.corp.example", "severity": "error" },
{ "name": "partner-x", "url": "https://scan.partner.example", "severity": "warn" }
]
}
In the file, severity is error, warn or info.
Which volumes get your sign-in
A volume gets your FossID sign-in. A repository can list volumes in .fossid/policy.json, so a repository that you clone could name its own server. FossID therefore sends your sign-in to a repository's volume only when all of these are true:
- No company policy is in force. Under a company policy, the volumes are your organization's and need no answer.
- The workspace is trusted. In Restricted Mode, FossID doesn't use a repository's volumes and doesn't ask.
- You allowed the volume's server.
FossID asks one question for all the servers that you haven't answered for. It reads: This repository lists custom volumes that would get your FossID sign-in: <servers>. Allow only servers that your organization runs.
Your answer applies to all the servers in the question. Select Allow only if your organization runs all of them. If it doesn't, select Don't Allow. Then allow your own servers, one at a time, in Detection Rules.
- FossID keeps your answer on your computer, not in the repository. The answer belongs to the server's address with its scheme and port. A server on another port, or on
httpinstead ofhttps, is another server. - FossID asks about any server that you haven't answered for, such as one that a later pull adds.
- If you close the question without an answer, FossID doesn't use the volume. It asks again in the next window.
- In Detection Rules, a volume that FossID holds back shows (Not allowed yet), (Not allowed) or (Not used in Restricted Mode) after its name. Select Allow to allow its server. For a volume that you allowed, select Don't Allow to stop. In Restricted Mode, trust the workspace first.
- When you add a volume in Detection Rules, you allow its server.
- FossID: Reset Custom Volume Permissions forgets every answer. FossID then asks again about the servers that the repository lists.
When volumes are scanned
- After each automatic scan of a source file. When FossID scans a source file against your main server (on open, switch or save), it then scans the file against each volume in turn. If a volume can't be reached, FossID skips it and your other results are unaffected. See If a volume can't be reached.
- On demand. FossID: Scan Workspace Against Volume… checks the whole workspace against one volume. If you have several, pick one from the list. It doesn't clear your current results, and its matches are tagged with the volume. If no volumes are configured, FossID offers Add a Volume.
If a volume can't be reached
FossID checks each volume that gets your sign-in, once it has connected to your server, and again whenever the list of volumes changes. A scan that can't reach a volume also counts.
If a volume can't be reached, FossID warns you once: FossID: custom volume "<name>" (<url>) can't be reached, so files aren't checked against it. If the volume answered but turned away the credential FossID sent, the message says refused the scan credential instead of can't be reached. For a volume that you host, see If the server turns down the sign-in.
- Select Check Again to check all volumes now. If a volume is still down, FossID warns you again.
- Select Open Detection Rules to see each volume's status.
While a volume is down, scans skip it, and FossID checks it again in the background every minute. When the volume is back, scans use it again, its dot in Detection Rules turns green, and the status bar briefly shows FossID: custom volume "<name>" is reachable again.
In Detection Rules, a dot before each volume's name shows its status: green when it can be reached, red when it can't be used, and grey when it hasn't been checked yet. Hover over the dot to see when it was last checked and, for a volume that is down, why. Until the first check, the tooltip says Not checked yet. A volume that FossID holds back shows its reason in brackets after its name. See Which volumes get your sign-in.
What a volume match looks like
- In the Problems panel, under the source FossID ·
<volume name>, with the codefossid/custom-volume-match. For example:Matches <component> <version> as <path> in custom volume "corp-products" (score 97).A partial match starts with Partially matches. - Severity: a whole-file match uses the volume's severity. A partial (snippet) match is one step lower: Error becomes Warning, Warning becomes Info.
- A whole-file match is shown as a coloured band across the first line of the file, with the text ⚠ Whole-file match ·
<volume>, or · N volumes if several volumes match. Hover over it for details. - A snippet match is underlined in the editor, like other findings.
A volume match is not a license question, so your license policy doesn't change it. License findings for the same code are still reported separately.
Ignoring a volume match
Volume matches can be ignored like other findings, with a reason and an expiry:
- A whole-file match is ignored by component, with a
componententry:path:component:<name>@<version>. Use<name>@*to cover all versions. - A snippet match is ignored by its snippet ID.