13.8 C
Canberra
Sunday, November 2, 2025

A library for Software program Composition Evaluation


In December 2022, we introduced OSV-Scanner, a device to allow builders to simply scan for vulnerabilities of their open supply dependencies. Along with the open supply group, we’ve continued to construct this device, including remediation options, in addition to increasing ecosystem help to 11 programming languages and 20 bundle supervisor codecs. 

At this time, we’re excited to launch OSV-SCALIBR (Software program Composition Evaluation LIBRary), an extensible library for SCA and file system scanning. OSV-SCALIBR combines Google’s inside vulnerability administration experience into one scanning library with vital new capabilities comparable to:

  • SCA for put in packages, standalone binaries, in addition to supply code

  • OSes bundle scanning on Linux (COS, Debian, Ubuntu, RHEL, and way more), Home windows, and Mac

  • Artifact and lockfile scanning in main language ecosystems (Go, Java, Javascript, Python, Ruby, and way more)

  • Vulnerability scanning instruments comparable to weak credential detectors for Linux, Home windows, and Mac

  • SBOM era in SPDX and CycloneDX, the 2 hottest doc codecs

  • Optimization for on-host scanning of useful resource constrained environments the place efficiency and low useful resource consumption is crucial

OSV-SCALIBR is now the first SCA engine used inside Google for stay hosts, code repos, and containers. It’s been used and examined extensively throughout many various merchandise and inside instruments to assist generate SBOMs, discover vulnerabilities, and assist defend our customers’ information at Google scale.

We provide OSV-SCALIBR primarily as an open supply Go library at present, and we’re engaged on including its new capabilities into OSV-Scanner as the first CLI interface.

Utilizing OSV-SCALIBR as a library

All of OSV-SCALIBR’s capabilities are modularized into plugins for software program extraction and vulnerability detection that are quite simple to broaden.You should use OSV-SCALIBR as a library to:

1.Generate SBOMs from the construct artifacts and code repos in your stay host:

import (

 “context”

 “github.com/google/osv-scalibr”

 “github.com/google/osv-scalibr/converter”

 “github.com/google/osv-scalibr/extractor/filesystem/record”

 “github.com/google/osv-scalibr/fs”

 “github.com/google/osv-scalibr/plugin”

 spdx “github.com/spdx/tools-golang/spdx/v2/v2_3”

)

func GenSBOM(ctx context.Context) *spdx.Doc {

 capab := &plugin.Capabilities{OS: plugin.OSLinux}

 cfg := &scalibr.ScanConfig{

   ScanRoots: fs.RealFSScanRoots(“/”),

   FilesystemExtractors: record.FromCapabilities(capab),

   Capabilities: capab,

 }

 consequence := scalibr.New().Scan(ctx, cfg)

 return converter.ToSPDX23(consequence, converter.SPDXConfig{})

}

2. Scan a git repo for SBOMs:

Merely substitute “/” with the trail to your git repo. Additionally check out the numerous language extractors to allow for code scanning.

3. Scan a distant container for SBOMs:

Substitute the scan config from the above code snippet with

import (

 …

 “github.com/google/go-containerregistry/pkg/authn”

 “github.com/google/go-containerregistry/pkg/v1/distant”

 “github.com/google/osv-scalibr/artifact/picture”

 …

)

filesys, _ := picture.NewFromRemoteName(

 “alpine:newest”,

 distant.WithAuthFromKeychain(authn.DefaultKeychain),

)

cfg := &scalibr.ScanConfig{

 ScanRoots: []*fs.ScanRoot{{FS: filesys}},

 

}

4. Discover vulnerabilities in your filesystem or a distant container:

Extract the PURLs from the SCALIBR stock outcomes from the earlier steps:

import (

 …

 “github.com/google/osv-scalibr/converter”

 

)

consequence := scalibr.New().Scan(ctx, cfg)

for _, i := vary consequence.Inventories {

 fmt.Println(converter.ToPURL(i))

}

And ship them to osv.dev, e.g.

$ curl -d ‘{“bundle”: {“purl”: “pkg:npm/dojo@1.2.3”}}’ “https://api.osv.dev/v1/question”

See the utilization docs for extra particulars.

OSV-Scanner + OSV-SCALIBR

Customers searching for an out-of-the-box vulnerability scanning CLI device ought to try OSV-Scanner, which already offers complete language bundle scanning capabilities utilizing a lot of the identical extraction as OSV-SCALIBR. 

A few of OSV-SCALIBR’s capabilities usually are not but out there in OSV-Scanner, however we’re at present engaged on integrating OSV-SCALIBR extra deeply into OSV-Scanner. It will make an increasing number of of OSV-SCALIBR’s capabilities out there in OSV-Scanner within the subsequent few months, together with put in bundle extraction, weak credentials scanning, SBOM era, and extra.

Look out quickly for an announcement of OSV-Scanner V2 with many of those new options out there. OSV-Scanner will develop into the first frontend to the OSV-SCALIBR library for customers who require a CLI interface. Current customers of OSV-Scanner can proceed to make use of the device the identical approach, with backwards compatibility maintained for all current use instances. 

For set up and utilization directions, take a look at OSV-Scanner’s documentation right here.


What’s subsequent

Along with making all of OSV-SCALIBR’s options out there in OSV-Scanner, we’re additionally engaged on extra new capabilities. This is among the issues you may anticipate:

  • Assist for extra OS and language ecosystems, each for normal extraction and for Guided Remediation

  • Layer attribution and base picture identification for container scanning

  • Reachability evaluation to cut back false constructive vulnerability matches

  • Extra vulnerability and misconfiguration detectors for Home windows

  • Extra weak credentials detectors

We hope that this library helps builders and organizations to safe their software program and encourages the open supply group to contribute again by sharing new plugins on high of OSV-SCALIBR.

You probably have any questions or if you want to contribute, do not hesitate to achieve out to us at osv-discuss@google.com or by posting a problem in our concern tracker.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles