Book a call

Security

Scan every dependency change for vulnerabilities and license terms

  • A dependency can change under you twice over. Its code can gain a backdoor, as xz did in 2024, and its license can change, as Terraform's did in 2023.
  • Free, open-source tools cover the security side: an SBOM from Syft, vulnerability scans from Trivy, Grype or OSV-Scanner, Semgrep, gitleaks, Scorecard and cosign.
  • Restricted licenses fall into three groups that matter to a SaaS or on-prem product: strong copyleft, source-available, and AI model and dataset terms.
  • Write the license policy down as allow, review and deny lists, enforce it in CI on every change, and give each exception a named owner.

We think every change that adds or upgrades a dependency should pass two gates in CI, one for security and one for license terms. It matters because both can change without anyone on your team editing a line, and coding agents now add dependencies faster than a person can read their terms.

Two changes nobody on the team made

On 10 August 2023 HashiCorp announced that future releases of its products, Terraform among them, would move from the Mozilla Public License 2.0 to the Business Source License 1.1. The new terms restrict use in an offering that competes with HashiCorp. Its APIs, SDKs and almost all other libraries stayed on MPL 2.0. The community answer was OpenTofu, a Terraform fork under Linux Foundation stewardship.

Redis followed a similar path. On 20 March 2024 it moved from the three-clause BSD license to RSALv2 and SSPLv1, starting with Redis 7.4, and said earlier releases keep the BSD license. In May 2025 it added the AGPL as an option from Redis 8. Elastic took a similar step in August 2024, adding the AGPL next to its Elastic License 2.0 and SSPL options.

The security version of the same problem came on 29 March 2024. Andres Freund reported a backdoor in xz 5.6.0 and 5.6.1, a compression library that the SSH server loaded on some Linux distributions. He found it by chasing slow SSH logins and valgrind errors. The injected code sat in the release tarballs and not in the git source, so a review of the repository would not have shown it.

In each case the risk arrived with a version bump. A pinned version, an SBOM and a check that runs on every upgrade turn that into a review step.

The open-source security toolkit

The tools below are free and run in any CI system. The split that matters is what blocks a merge and what runs on a schedule.

An SBOM, a software bill of materials, is the list of every component in a build with its version and license. Syft generates one from a container image or a directory, in CycloneDX or SPDX format. Store it with each release, because the nightly scans and any future incident question start from it.

Trivy scans images, filesystems and repositories for known vulnerabilities, misconfigurations, secrets and licenses. Grype scans an image or a Syft SBOM for known vulnerabilities. OSV-Scanner checks lockfiles and images against the OSV.dev database. One of them is enough to start.

Semgrep is static analysis with rules that look like the code they match, across more than 30 languages. Gitleaks finds keys and passwords in commits and in git history, and runs as a pre-commit hook or a GitHub Action.

Two tools judge the supply chain itself. OpenSSF Scorecard scores a project from 0 to 10 on checks such as pinned dependencies, branch protection, signed releases and risky workflows. Cosign signs and verifies container images and attestations, so a deploy can refuse an image your pipeline did not build. GitHub also recommends pinning third-party actions to a full commit SHA, because a tag can be moved to new code.

Where each check runs

  1. LaptopBefore the commit

    Gitleaks as a pre-commit hook, so a key never reaches the remote.

  2. Every changeOn every pull request

    Gitleaks again, Semgrep on the changed files, a vulnerability scan of the lockfile, and the license check against the policy. Each one blocks the merge on a new finding.

  3. Every changeOn every build

    Syft writes the SBOM, Trivy or Grype scans the image, and cosign signs the image.

  4. NightlyEvery night

    Rescan the SBOMs of everything running in production against fresh vulnerability data, run Scorecard on your direct dependencies, and run the full Semgrep rule set.

  5. Every changeAt deploy

    Verify the cosign signature and refuse any image without one.

The nightly rescan is the step teams skip. A vulnerability published today affects the image you shipped last month, and only a scan of its stored SBOM will tell you.

The licenses that restrict you

This is a summary for engineers and is not legal advice. Take any specific case to counsel.

Strong copyleft licenses tie obligations to how you deliver the software. The GPL's duties attach when you convey a copy, and the license says that mere interaction with a user over a network, with no copy transferred, is not conveying. GPL code inside an on-prem product is therefore a different question from GPL code on your own servers.

The AGPL closes that gap in section 13. If you modify AGPL code and users reach it over a network, you must offer them the source of your modified version.

Source-available licenses publish the code but restrict commercial use. The Business Source License allows non-production use, and each licensor's Additional Use Grant sets which production use is allowed. Each version converts to an open license on its Change Date, at the latest four years after release.

SSPL section 13 requires anyone offering the program as a service to publish the source of the whole service, including management, monitoring, backup and hosting software. Elastic License 2.0 bars providing the software as a hosted or managed service. The Commons Clause adds a ban on selling a product whose value comes mainly from the software.

AI models and data bring their own terms. The Llama 3.1 license requires a separate license from Meta for products above 700 million monthly active users. It also binds you to an acceptable use policy and asks distributors to display "Built with Llama". Many datasets carry CC BY-NC 4.0, which forbids commercial use.

What each license class means for two ways of shipping

SaaS you hostSoftware customers install
Permissive, such as MIT, BSD or Apache 2.0Keep noticesKeep notices and ship them
GPLUsually no source duty if no copy leaves your servers (Partly)Source duty on what you distribute
AGPLSource duty if you modify it and users reach it over the networkSource duty on distribution
BUSLDepends on the Additional Use Grant (Partly)Depends on the Additional Use Grant (Partly)
SSPL or Elastic License 2.0Restricted if you offer the software itself as a service (Partly)Read the terms for your case (Partly)
Commons ClauseRestricted if your product's value is mainly that softwareRestricted if your product's value is mainly that software
Llama 3.1 licenseUse policy, attribution, separate license above 700M monthly usersSame, plus pass the terms on
CC BY-NC datasetNo commercial useNo commercial use
  • SaaS you host

    Permissive, such as MIT, BSD or Apache 2.0
    Keep notices
    GPL
    Usually no source duty if no copy leaves your servers (Partly)
    AGPL
    Source duty if you modify it and users reach it over the network
    BUSL
    Depends on the Additional Use Grant (Partly)
    SSPL or Elastic License 2.0
    Restricted if you offer the software itself as a service (Partly)
    Commons Clause
    Restricted if your product's value is mainly that software
    Llama 3.1 license
    Use policy, attribution, separate license above 700M monthly users
    CC BY-NC dataset
    No commercial use
  • Software customers install

    Permissive, such as MIT, BSD or Apache 2.0
    Keep notices and ship them
    GPL
    Source duty on what you distribute
    AGPL
    Source duty on distribution
    BUSL
    Depends on the Additional Use Grant (Partly)
    SSPL or Elastic License 2.0
    Read the terms for your case (Partly)
    Commons Clause
    Restricted if your product's value is mainly that software
    Llama 3.1 license
    Same, plus pass the terms on
    CC BY-NC dataset
    No commercial use

A summary for engineers, not legal advice. The license text decides.

How to control it

Write the policy down as three lists of SPDX identifiers, the standard short names on the SPDX license list. The allow list merges without a person. The review list opens a ticket for a named owner. The deny list blocks the merge.

Then enforce the policy in CI on every change. OSV-Scanner accepts an allow list of SPDX identifiers, and Trivy reports licenses in the same run as its vulnerability scan.

For a deeper check, ScanCode Toolkit detects licenses and copyright notices in source and binaries, and the OSS Review Toolkit evaluates policy rules written as code and produces CycloneDX and SPDX SBOMs. For your own repositories, REUSE puts an SPDX license tag and a copyright line in each file header, so a scanner never has to guess.

Record the license of every component in the SBOM, next to its version. That turns "what are we running under BUSL" into a query.

Give exceptions an owner and an end date. An approved exception names the component, the version range, the use it covers and the person who signed off, and it expires. Check the license again whenever the version changes. HashiCorp and Redis changed terms on new releases while old ones kept theirs, so the license on a dependency is a property of the exact version you run.

Where we land

Coding agents add packages in seconds, and a reviewer reading a large diff rarely opens a dependency's license file. We argued that AI code ships faster than it is tested. Dependencies are the same problem, so the security and license gates have to run on every change, agent-written or not, and block the merge themselves.

Model weights and datasets need the same review as code. They belong in the SBOM with their license and their use terms, and our post on data licenses for AI proposes how to label a dataset before it reaches a model.

Start with one command. Generate an SBOM of your production image with Syft, list every license in it, and sort the list into allow, review and deny. Anything in the deny column is your first ticket. The same list is where our security and AI governance method begins.

Sources

The license changes and the xz backdoor:

Security tools:

Licenses and license tooling:

Amol Patil
Founder, CEONearly twenty years turning new technology into products, including eight at Globant as Technical Director for its mobile, wearables and IoT studios. Has taken vision, voice and agentic systems into production across many industries.

Working on something in this territory?

Tell us what you are trying to win. We answer within one business day, from the people who build.