Skip to content
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
Support

Package Scanning

Package scanning checks the packages of the package registry for known vulnerabilities, the same way Dependency Scanning does for repositories. It needs a valid license.

A package has no repository or branch, so its findings are stored per owner and package version.

  • What is scanned: every published version of the types that OSV has an ecosystem for: npm, PyPI, Cargo, Composer, Maven, NuGet, RubyGems, Conan, Pub, CRAN and Go. Container and distribution packages are not scanned.
  • When: a version is queued when it is published and when a new vulnerability database changes its advisories. A nightly task (scan_security_packages, at midnight) rescans the versions that were not scanned for 20 hours, because advisories are often published long after a version.
  • Findings: a dismissed finding stays dismissed, a withdrawn advisory closes its finding, and a failed scan leaves the findings untouched.
  • Declared dependencies: a scan also checks the runtime dependencies that the metadata of a version pins to exactly one version (npm, Cargo, Composer, NuGet, Maven and RubyGems). Dependencies declared as a range such as ^4.17.15, dev, optional and peer dependencies, platform requirements and URL or alias requirements are skipped. Conan, Go and PyPI declare no usable dependencies in their package metadata, so they are not covered.

/{owner}/-/packages/{type}/{name}/security lists the findings of a package: the latest version unless a version or all versions are picked, with a version filter, a rescan button and open and closed tabs. .../{version}/security shows a single version, and the version sidebar links to it with the number of open findings. Each finding has a page with the advisory, where it can be dismissed and reopened. The page lists who dismissed or reopened the finding, when and why.

These pages are for people with write access to the packages of the owner, site administrators and administrators of the linked repository. Everyone else gets a 404, because a public package should not advertise its advisories.

Endpoint Purpose
GET /packages/{owner}/{type}/{name}/{version}/security/findings The findings of a version
GET /packages/{owner}/{type}/{name}/-/security/findings The findings of a package: the latest version, or the one in version (a version or all)
POST /packages/{owner}/{type}/{name}/{version}/security/findings/{id}/dismiss and .../reopen Dismiss or reopen a finding

The access rule is the same as for the page.

  • A user or organization can turn package scanning on or off in its security scan settings (Scan the packages for known vulnerabilities, on by default). Turning it off removes the findings of its packages, and turning it on scans the existing versions.
  • Instance administrators can use the options ee.security.packages.enabled (scan packages) and ee.security.packages.dependencies.enabled (also check declared dependencies). Both are on by default.
  • The findings are shown in the Packages tab of the security center.