osvpy 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- osvpy-0.2.0/CMakeLists.txt +63 -0
- osvpy-0.2.0/LICENSE +32 -0
- osvpy-0.2.0/PKG-INFO +279 -0
- osvpy-0.2.0/README.md +259 -0
- osvpy-0.2.0/go/abi.go +437 -0
- osvpy-0.2.0/go/bridge.go +158 -0
- osvpy-0.2.0/go/discard_logger.go +13 -0
- osvpy-0.2.0/go/go.mod +164 -0
- osvpy-0.2.0/go/go.sum +568 -0
- osvpy-0.2.0/go/indexes.go +253 -0
- osvpy-0.2.0/go/operation.go +192 -0
- osvpy-0.2.0/go/operation_test.go +106 -0
- osvpy-0.2.0/go/patches/0001-scanner.patch +118 -0
- osvpy-0.2.0/go/patches/0002-scalibr.patch +48 -0
- osvpy-0.2.0/go/payload.go +237 -0
- osvpy-0.2.0/go/payload_test.go +88 -0
- osvpy-0.2.0/go/report.go +250 -0
- osvpy-0.2.0/go/report_queries_test.go +207 -0
- osvpy-0.2.0/go/report_test.go +183 -0
- osvpy-0.2.0/go/slabs.go +54 -0
- osvpy-0.2.0/go/store.go +354 -0
- osvpy-0.2.0/go/vendor/bitbucket.org/creachadair/stringset/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/bitbucket.org/creachadair/stringset/README.md +8 -0
- osvpy-0.2.0/go/vendor/cloud.google.com/go/compute/metadata/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/cloud.google.com/go/compute/metadata/README.md +27 -0
- osvpy-0.2.0/go/vendor/dario.cat/mergo/LICENSE +28 -0
- osvpy-0.2.0/go/vendor/dario.cat/mergo/README.md +253 -0
- osvpy-0.2.0/go/vendor/deps.dev/api/v3/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/deps.dev/api/v3alpha/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/deps.dev/util/maven/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/deps.dev/util/pypi/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/deps.dev/util/resolve/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/deps.dev/util/semver/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/deps.dev/util/semver/README.md +34 -0
- osvpy-0.2.0/go/vendor/github.com/BurntSushi/toml/README.md +120 -0
- osvpy-0.2.0/go/vendor/github.com/CycloneDX/cyclonedx-go/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/github.com/CycloneDX/cyclonedx-go/README.md +62 -0
- osvpy-0.2.0/go/vendor/github.com/GehirnInc/crypt/LICENSE +26 -0
- osvpy-0.2.0/go/vendor/github.com/Microsoft/go-winio/LICENSE +22 -0
- osvpy-0.2.0/go/vendor/github.com/Microsoft/go-winio/README.md +89 -0
- osvpy-0.2.0/go/vendor/github.com/ProtonMail/go-crypto/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/github.com/Velocidex/json/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/github.com/Velocidex/json/README.md +64 -0
- osvpy-0.2.0/go/vendor/github.com/Velocidex/ordereddict/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/github.com/Velocidex/ordereddict/README.md +2 -0
- osvpy-0.2.0/go/vendor/github.com/Velocidex/yaml/v2/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/github.com/Velocidex/yaml/v2/README.md +139 -0
- osvpy-0.2.0/go/vendor/github.com/aead/serpent/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/aead/serpent/README.md +9 -0
- osvpy-0.2.0/go/vendor/github.com/agext/levenshtein/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/github.com/agext/levenshtein/README.md +38 -0
- osvpy-0.2.0/go/vendor/github.com/anchore/go-lzo/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/anchore/go-lzo/README.md +10 -0
- osvpy-0.2.0/go/vendor/github.com/anchore/go-struct-converter/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/github.com/anchore/go-struct-converter/README.md +166 -0
- osvpy-0.2.0/go/vendor/github.com/ayoubfaouzi/pkcs7/LICENSE +22 -0
- osvpy-0.2.0/go/vendor/github.com/ayoubfaouzi/pkcs7/README.md +63 -0
- osvpy-0.2.0/go/vendor/github.com/bazelbuild/buildtools/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/github.com/canonical/chisel-manifest/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/github.com/cespare/xxhash/v2/README.md +74 -0
- osvpy-0.2.0/go/vendor/github.com/clipperhouse/uax29/v2/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/clipperhouse/uax29/v2/graphemes/README.md +120 -0
- osvpy-0.2.0/go/vendor/github.com/cloudflare/circl/LICENSE +57 -0
- osvpy-0.2.0/go/vendor/github.com/compose-spec/compose-go/v2/LICENSE +191 -0
- osvpy-0.2.0/go/vendor/github.com/compose-spec/compose-go/v2/dotenv/LICENSE +22 -0
- osvpy-0.2.0/go/vendor/github.com/containerd/errdefs/LICENSE +191 -0
- osvpy-0.2.0/go/vendor/github.com/containerd/errdefs/README.md +13 -0
- osvpy-0.2.0/go/vendor/github.com/containerd/errdefs/pkg/LICENSE +191 -0
- osvpy-0.2.0/go/vendor/github.com/containerd/typeurl/v2/LICENSE +191 -0
- osvpy-0.2.0/go/vendor/github.com/containerd/typeurl/v2/README.md +27 -0
- osvpy-0.2.0/go/vendor/github.com/cyphar/filepath-securejoin/README.md +184 -0
- osvpy-0.2.0/go/vendor/github.com/davecgh/go-spew/LICENSE +15 -0
- osvpy-0.2.0/go/vendor/github.com/deitch/magic/LICENSE +13 -0
- osvpy-0.2.0/go/vendor/github.com/diskfs/go-diskfs/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/diskfs/go-diskfs/README.md +123 -0
- osvpy-0.2.0/go/vendor/github.com/distribution/reference/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/github.com/distribution/reference/README.md +30 -0
- osvpy-0.2.0/go/vendor/github.com/djherbis/times/LICENSE +22 -0
- osvpy-0.2.0/go/vendor/github.com/djherbis/times/README.md +67 -0
- osvpy-0.2.0/go/vendor/github.com/docker/cli/LICENSE +191 -0
- osvpy-0.2.0/go/vendor/github.com/docker/docker-credential-helpers/LICENSE +20 -0
- osvpy-0.2.0/go/vendor/github.com/docker/go-connections/LICENSE +191 -0
- osvpy-0.2.0/go/vendor/github.com/docker/go-units/LICENSE +191 -0
- osvpy-0.2.0/go/vendor/github.com/docker/go-units/README.md +16 -0
- osvpy-0.2.0/go/vendor/github.com/dsoprea/go-exfat/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/dsoprea/go-exfat/README.md +38 -0
- osvpy-0.2.0/go/vendor/github.com/dsoprea/go-logging/LICENSE +9 -0
- osvpy-0.2.0/go/vendor/github.com/dsoprea/go-logging/README.md +223 -0
- osvpy-0.2.0/go/vendor/github.com/dustin/go-humanize/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/edsrzf/mmap-go/LICENSE +25 -0
- osvpy-0.2.0/go/vendor/github.com/edsrzf/mmap-go/README.md +14 -0
- osvpy-0.2.0/go/vendor/github.com/elliotwutingfeng/asciiset/LICENSE +28 -0
- osvpy-0.2.0/go/vendor/github.com/elliotwutingfeng/asciiset/README.md +93 -0
- osvpy-0.2.0/go/vendor/github.com/emirpasic/gods/LICENSE +41 -0
- osvpy-0.2.0/go/vendor/github.com/erikvarga/go-rpmdb/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/felixge/httpsnoop/README.md +95 -0
- osvpy-0.2.0/go/vendor/github.com/go-errors/errors/README.md +84 -0
- osvpy-0.2.0/go/vendor/github.com/go-git/gcfg/LICENSE +28 -0
- osvpy-0.2.0/go/vendor/github.com/go-git/go-billy/v5/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/github.com/go-git/go-billy/v5/README.md +77 -0
- osvpy-0.2.0/go/vendor/github.com/go-git/go-git/v5/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/github.com/go-git/go-git/v5/README.md +131 -0
- osvpy-0.2.0/go/vendor/github.com/go-logr/logr/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/github.com/go-logr/logr/README.md +407 -0
- osvpy-0.2.0/go/vendor/github.com/go-logr/stdr/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/github.com/go-logr/stdr/README.md +6 -0
- osvpy-0.2.0/go/vendor/github.com/go-ole/go-ole/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/go-ole/go-ole/README.md +46 -0
- osvpy-0.2.0/go/vendor/github.com/go-restruct/restruct/README.md +58 -0
- osvpy-0.2.0/go/vendor/github.com/go-viper/mapstructure/v2/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/go-viper/mapstructure/v2/README.md +81 -0
- osvpy-0.2.0/go/vendor/github.com/gobwas/glob/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/golang/groupcache/LICENSE +191 -0
- osvpy-0.2.0/go/vendor/github.com/google/go-containerregistry/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/github.com/google/go-containerregistry/pkg/authn/README.md +322 -0
- osvpy-0.2.0/go/vendor/github.com/google/go-containerregistry/pkg/name/README.md +3 -0
- osvpy-0.2.0/go/vendor/github.com/google/go-containerregistry/pkg/v1/empty/README.md +8 -0
- osvpy-0.2.0/go/vendor/github.com/google/go-containerregistry/pkg/v1/mutate/README.md +56 -0
- osvpy-0.2.0/go/vendor/github.com/google/go-containerregistry/pkg/v1/partial/README.md +82 -0
- osvpy-0.2.0/go/vendor/github.com/google/go-containerregistry/pkg/v1/remote/README.md +117 -0
- osvpy-0.2.0/go/vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/README.md +129 -0
- osvpy-0.2.0/go/vendor/github.com/google/go-containerregistry/pkg/v1/stream/README.md +68 -0
- osvpy-0.2.0/go/vendor/github.com/google/go-containerregistry/pkg/v1/tarball/README.md +280 -0
- osvpy-0.2.0/go/vendor/github.com/google/osv-scalibr/LICENSE +261 -0
- osvpy-0.2.0/go/vendor/github.com/google/osv-scalibr/README.md +239 -0
- osvpy-0.2.0/go/vendor/github.com/google/osv-scalibr/extractor/filesystem/os/kernel/module/README.md +14 -0
- osvpy-0.2.0/go/vendor/github.com/google/osv-scalibr/veles/README.md +16 -0
- osvpy-0.2.0/go/vendor/github.com/google/osv-scanner/v2/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/github.com/google/uuid/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/github.com/google/uuid/README.md +21 -0
- osvpy-0.2.0/go/vendor/github.com/ianlancetaylor/demangle/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/github.com/ianlancetaylor/demangle/README.md +3 -0
- osvpy-0.2.0/go/vendor/github.com/icholy/digest/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/icholy/digest/README.md +211 -0
- osvpy-0.2.0/go/vendor/github.com/jbenet/go-context/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/jedib0t/go-pretty/v6/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/jedib0t/go-pretty/v6/table/README.md +141 -0
- osvpy-0.2.0/go/vendor/github.com/jedib0t/go-pretty/v6/text/README.md +141 -0
- osvpy-0.2.0/go/vendor/github.com/kevinburke/ssh_config/LICENSE +49 -0
- osvpy-0.2.0/go/vendor/github.com/kevinburke/ssh_config/README.md +92 -0
- osvpy-0.2.0/go/vendor/github.com/klauspost/compress/LICENSE +304 -0
- osvpy-0.2.0/go/vendor/github.com/klauspost/compress/README.md +712 -0
- osvpy-0.2.0/go/vendor/github.com/klauspost/compress/fse/README.md +79 -0
- osvpy-0.2.0/go/vendor/github.com/klauspost/compress/huff0/README.md +89 -0
- osvpy-0.2.0/go/vendor/github.com/klauspost/compress/internal/snapref/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/github.com/klauspost/compress/zstd/README.md +474 -0
- osvpy-0.2.0/go/vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md +71 -0
- osvpy-0.2.0/go/vendor/github.com/klauspost/cpuid/v2/LICENSE +22 -0
- osvpy-0.2.0/go/vendor/github.com/klauspost/cpuid/v2/README.md +580 -0
- osvpy-0.2.0/go/vendor/github.com/lunixbochs/struc/LICENSE +19 -0
- osvpy-0.2.0/go/vendor/github.com/lunixbochs/struc/README.md +103 -0
- osvpy-0.2.0/go/vendor/github.com/masahiro331/go-ext4-filesystem/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/github.com/mattn/go-isatty/LICENSE +9 -0
- osvpy-0.2.0/go/vendor/github.com/mattn/go-isatty/README.md +50 -0
- osvpy-0.2.0/go/vendor/github.com/mattn/go-runewidth/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/mattn/go-runewidth/README.md +27 -0
- osvpy-0.2.0/go/vendor/github.com/mattn/go-shellwords/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/mattn/go-shellwords/README.md +67 -0
- osvpy-0.2.0/go/vendor/github.com/micromdm/plist/LICENSE +91 -0
- osvpy-0.2.0/go/vendor/github.com/micromdm/plist/README.md +29 -0
- osvpy-0.2.0/go/vendor/github.com/moby/buildkit/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/github.com/moby/docker-image-spec/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/github.com/moby/moby/api/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/github.com/moby/moby/client/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/github.com/moby/moby/client/README.md +56 -0
- osvpy-0.2.0/go/vendor/github.com/ncruces/go-strftime/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/ncruces/go-strftime/README.md +5 -0
- osvpy-0.2.0/go/vendor/github.com/opencontainers/go-digest/LICENSE +192 -0
- osvpy-0.2.0/go/vendor/github.com/opencontainers/go-digest/README.md +96 -0
- osvpy-0.2.0/go/vendor/github.com/opencontainers/image-spec/LICENSE +191 -0
- osvpy-0.2.0/go/vendor/github.com/ossf/osv-schema/bindings/go/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/github.com/owenrumney/go-sarif/v3/LICENSE +24 -0
- osvpy-0.2.0/go/vendor/github.com/package-url/packageurl-go/LICENSE +18 -0
- osvpy-0.2.0/go/vendor/github.com/package-url/packageurl-go/README.md +90 -0
- osvpy-0.2.0/go/vendor/github.com/pandatix/go-cvss/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/pierrec/lz4/v4/LICENSE +28 -0
- osvpy-0.2.0/go/vendor/github.com/pierrec/lz4/v4/README.md +92 -0
- osvpy-0.2.0/go/vendor/github.com/pjbgf/sha1cd/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/github.com/pjbgf/sha1cd/README.md +57 -0
- osvpy-0.2.0/go/vendor/github.com/pkg/errors/LICENSE +23 -0
- osvpy-0.2.0/go/vendor/github.com/pkg/errors/README.md +59 -0
- osvpy-0.2.0/go/vendor/github.com/pkg/xattr/LICENSE +25 -0
- osvpy-0.2.0/go/vendor/github.com/pkg/xattr/README.md +45 -0
- osvpy-0.2.0/go/vendor/github.com/planetscale/vtprotobuf/LICENSE +29 -0
- osvpy-0.2.0/go/vendor/github.com/remyoudompheng/bigfft/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/github.com/rust-secure-code/go-rustaudit/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/rust-secure-code/go-rustaudit/README.md +5 -0
- osvpy-0.2.0/go/vendor/github.com/saferwall/pe/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/saferwall/pe/README.md +266 -0
- osvpy-0.2.0/go/vendor/github.com/saferwall/pe/log/README.md +42 -0
- osvpy-0.2.0/go/vendor/github.com/santhosh-tekuri/jsonschema/v6/LICENSE +175 -0
- osvpy-0.2.0/go/vendor/github.com/santhosh-tekuri/jsonschema/v6/README.md +88 -0
- osvpy-0.2.0/go/vendor/github.com/sergi/go-diff/LICENSE +20 -0
- osvpy-0.2.0/go/vendor/github.com/shirou/gopsutil/LICENSE +61 -0
- osvpy-0.2.0/go/vendor/github.com/sirupsen/logrus/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/sirupsen/logrus/README.md +519 -0
- osvpy-0.2.0/go/vendor/github.com/skeema/knownhosts/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/github.com/skeema/knownhosts/README.md +132 -0
- osvpy-0.2.0/go/vendor/github.com/spdx/gordf/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/thoas/go-funk/LICENSE +21 -0
- osvpy-0.2.0/go/vendor/github.com/tidwall/gjson/LICENSE +20 -0
- osvpy-0.2.0/go/vendor/github.com/tidwall/gjson/README.md +492 -0
- osvpy-0.2.0/go/vendor/github.com/tidwall/jsonc/LICENSE +20 -0
- osvpy-0.2.0/go/vendor/github.com/tidwall/jsonc/README.md +90 -0
- osvpy-0.2.0/go/vendor/github.com/tidwall/match/LICENSE +20 -0
- osvpy-0.2.0/go/vendor/github.com/tidwall/match/README.md +29 -0
- osvpy-0.2.0/go/vendor/github.com/tidwall/pretty/LICENSE +20 -0
- osvpy-0.2.0/go/vendor/github.com/tidwall/pretty/README.md +122 -0
- osvpy-0.2.0/go/vendor/github.com/tink-crypto/tink-go/v2/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/github.com/tklauser/go-sysconf/LICENSE +29 -0
- osvpy-0.2.0/go/vendor/github.com/tklauser/go-sysconf/README.md +46 -0
- osvpy-0.2.0/go/vendor/github.com/tklauser/numcpus/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/github.com/tklauser/numcpus/README.md +52 -0
- osvpy-0.2.0/go/vendor/github.com/tonistiigi/go-csvvalue/LICENSE +22 -0
- osvpy-0.2.0/go/vendor/github.com/ulikunitz/xz/LICENSE +26 -0
- osvpy-0.2.0/go/vendor/github.com/ulikunitz/xz/README.md +88 -0
- osvpy-0.2.0/go/vendor/github.com/xanzy/ssh-agent/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/github.com/xanzy/ssh-agent/README.md +23 -0
- osvpy-0.2.0/go/vendor/github.com/xeipuuv/gojsonpointer/README.md +41 -0
- osvpy-0.2.0/go/vendor/github.com/xeipuuv/gojsonreference/README.md +10 -0
- osvpy-0.2.0/go/vendor/github.com/xeipuuv/gojsonschema/README.md +466 -0
- osvpy-0.2.0/go/vendor/github.com/xhit/go-str2duration/v2/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/github.com/xhit/go-str2duration/v2/README.md +88 -0
- osvpy-0.2.0/go/vendor/github.com/yusufpapurcu/wmi/LICENSE +20 -0
- osvpy-0.2.0/go/vendor/github.com/yusufpapurcu/wmi/README.md +6 -0
- osvpy-0.2.0/go/vendor/go.etcd.io/bbolt/LICENSE +20 -0
- osvpy-0.2.0/go/vendor/go.etcd.io/bbolt/README.md +1044 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/auto/sdk/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/LICENSE +231 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/otel/LICENSE +231 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/otel/README.md +122 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/otel/attribute/README.md +3 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/otel/baggage/README.md +3 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/otel/codes/README.md +3 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/otel/metric/LICENSE +231 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/otel/metric/README.md +3 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/otel/metric/embedded/README.md +3 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/otel/metric/noop/README.md +3 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/otel/propagation/README.md +3 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/README.md +3 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/otel/semconv/v1.43.0/README.md +3 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/otel/trace/LICENSE +231 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/otel/trace/README.md +3 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/otel/trace/embedded/README.md +3 -0
- osvpy-0.2.0/go/vendor/go.opentelemetry.io/otel/trace/noop/README.md +3 -0
- osvpy-0.2.0/go/vendor/go.uber.org/multierr/README.md +43 -0
- osvpy-0.2.0/go/vendor/go.uber.org/zap/LICENSE +19 -0
- osvpy-0.2.0/go/vendor/go.uber.org/zap/README.md +149 -0
- osvpy-0.2.0/go/vendor/go.yaml.in/yaml/v2/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/go.yaml.in/yaml/v2/README.md +131 -0
- osvpy-0.2.0/go/vendor/go.yaml.in/yaml/v4/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/go.yaml.in/yaml/v4/README.md +266 -0
- osvpy-0.2.0/go/vendor/go.yaml.in/yaml/v4/internal/libyaml/README.md +549 -0
- osvpy-0.2.0/go/vendor/golang.org/x/crypto/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/golang.org/x/mod/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/golang.org/x/net/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/golang.org/x/net/http2/README.md +19 -0
- osvpy-0.2.0/go/vendor/golang.org/x/oauth2/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/golang.org/x/oauth2/README.md +35 -0
- osvpy-0.2.0/go/vendor/golang.org/x/sync/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/golang.org/x/sys/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/golang.org/x/sys/unix/README.md +184 -0
- osvpy-0.2.0/go/vendor/golang.org/x/telemetry/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/golang.org/x/text/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/golang.org/x/tools/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/golang.org/x/vuln/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/golang.org/x/vuln/internal/buildinfo/README.md +9 -0
- osvpy-0.2.0/go/vendor/golang.org/x/vuln/internal/gosym/README.md +11 -0
- osvpy-0.2.0/go/vendor/golang.org/x/xerrors/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/google.golang.org/genproto/googleapis/api/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/google.golang.org/genproto/googleapis/rpc/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/google.golang.org/grpc/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/google.golang.org/grpc/README.md +108 -0
- osvpy-0.2.0/go/vendor/google.golang.org/protobuf/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/gopkg.in/ini.v1/LICENSE +191 -0
- osvpy-0.2.0/go/vendor/gopkg.in/ini.v1/README.md +45 -0
- osvpy-0.2.0/go/vendor/gopkg.in/warnings.v0/LICENSE +24 -0
- osvpy-0.2.0/go/vendor/gopkg.in/yaml.v3/LICENSE +50 -0
- osvpy-0.2.0/go/vendor/gopkg.in/yaml.v3/README.md +150 -0
- osvpy-0.2.0/go/vendor/modernc.org/libc/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/modernc.org/libc/README.md +9 -0
- osvpy-0.2.0/go/vendor/modernc.org/libc/honnef.co/go/netdb/README.md +12 -0
- osvpy-0.2.0/go/vendor/modernc.org/mathutil/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/modernc.org/memory/LICENSE +27 -0
- osvpy-0.2.0/go/vendor/modernc.org/memory/README.md +13 -0
- osvpy-0.2.0/go/vendor/modernc.org/sqlite/LICENSE +26 -0
- osvpy-0.2.0/go/vendor/modernc.org/sqlite/README.md +91 -0
- osvpy-0.2.0/go/vendor/osv.dev/bindings/go/LICENSE +202 -0
- osvpy-0.2.0/go/vendor/sigs.k8s.io/yaml/LICENSE +306 -0
- osvpy-0.2.0/go/vendor/sigs.k8s.io/yaml/README.md +123 -0
- osvpy-0.2.0/go/vendor/www.velocidex.com/golang/go-ntfs/LICENSE +201 -0
- osvpy-0.2.0/go/vendor/www.velocidex.com/golang/regparser/LICENSE +201 -0
- osvpy-0.2.0/pyproject.toml +85 -0
- osvpy-0.2.0/src/osvpy/__init__.py +31 -0
- osvpy-0.2.0/src/osvpy/_abi.pxd +22 -0
- osvpy-0.2.0/src/osvpy/_native.pyi +207 -0
- osvpy-0.2.0/src/osvpy/_native.pyx +621 -0
- osvpy-0.2.0/src/osvpy/exceptions.py +13 -0
- osvpy-0.2.0/src/osvpy/languages.py +147 -0
- osvpy-0.2.0/src/osvpy/models.py +49 -0
- osvpy-0.2.0/src/osvpy/py.typed +0 -0
- osvpy-0.2.0/src/osvpy/scanner.py +89 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.20)
|
|
2
|
+
project(osvpy LANGUAGES C)
|
|
3
|
+
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
|
|
4
|
+
find_program(GO_EXECUTABLE go REQUIRED)
|
|
5
|
+
find_program(GIT_EXECUTABLE git REQUIRED)
|
|
6
|
+
include(CheckIPOSupported)
|
|
7
|
+
check_ipo_supported(LANGUAGES C)
|
|
8
|
+
|
|
9
|
+
set(OSVPY_LIBRARY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}osvpy${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
|
10
|
+
set(OSVPY_GO_DIR "${CMAKE_CURRENT_BINARY_DIR}/go")
|
|
11
|
+
# Apply pinned upstream patches in the build tree, never in the source checkout.
|
|
12
|
+
file(REMOVE_RECURSE "${OSVPY_GO_DIR}")
|
|
13
|
+
file(MAKE_DIRECTORY "${OSVPY_GO_DIR}")
|
|
14
|
+
file(GLOB OSVPY_GO_SOURCES CONFIGURE_DEPENDS
|
|
15
|
+
"${CMAKE_CURRENT_SOURCE_DIR}/go/*.go"
|
|
16
|
+
"${CMAKE_CURRENT_SOURCE_DIR}/go/go.mod"
|
|
17
|
+
"${CMAKE_CURRENT_SOURCE_DIR}/go/go.sum")
|
|
18
|
+
foreach(source IN LISTS OSVPY_GO_SOURCES)
|
|
19
|
+
get_filename_component(name "${source}" NAME)
|
|
20
|
+
configure_file("${source}" "${OSVPY_GO_DIR}/${name}" COPYONLY)
|
|
21
|
+
endforeach()
|
|
22
|
+
execute_process(COMMAND "${GO_EXECUTABLE}" mod vendor
|
|
23
|
+
WORKING_DIRECTORY "${OSVPY_GO_DIR}" COMMAND_ERROR_IS_FATAL ANY)
|
|
24
|
+
file(GLOB OSVPY_PATCHES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/go/patches/*.patch")
|
|
25
|
+
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${OSVPY_PATCHES})
|
|
26
|
+
foreach(patch IN LISTS OSVPY_PATCHES)
|
|
27
|
+
execute_process(COMMAND "${GIT_EXECUTABLE}" apply "${patch}"
|
|
28
|
+
WORKING_DIRECTORY "${OSVPY_GO_DIR}" COMMAND_ERROR_IS_FATAL ANY)
|
|
29
|
+
endforeach()
|
|
30
|
+
|
|
31
|
+
add_custom_target(osvpy_native ALL
|
|
32
|
+
COMMAND "${CMAKE_COMMAND}" -E env "CGO_ENABLED=1" "CC=${CMAKE_C_COMPILER}"
|
|
33
|
+
"${GO_EXECUTABLE}" build -mod=vendor -trimpath -buildvcs=false
|
|
34
|
+
-buildmode=c-shared -ldflags=-s -o "${OSVPY_LIBRARY}" .
|
|
35
|
+
WORKING_DIRECTORY "${OSVPY_GO_DIR}"
|
|
36
|
+
BYPRODUCTS "${OSVPY_LIBRARY}" "${CMAKE_CURRENT_BINARY_DIR}/libosvpy.h"
|
|
37
|
+
VERBATIM)
|
|
38
|
+
|
|
39
|
+
install(FILES "${OSVPY_LIBRARY}" DESTINATION osvpy/_lib)
|
|
40
|
+
|
|
41
|
+
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_native.c"
|
|
42
|
+
COMMAND "${Python_EXECUTABLE}" -m cython -3
|
|
43
|
+
-I "${CMAKE_CURRENT_SOURCE_DIR}/src"
|
|
44
|
+
-o "${CMAKE_CURRENT_BINARY_DIR}/_native.c"
|
|
45
|
+
"${CMAKE_CURRENT_SOURCE_DIR}/src/osvpy/_native.pyx"
|
|
46
|
+
DEPENDS src/osvpy/_native.pyx src/osvpy/_abi.pxd VERBATIM)
|
|
47
|
+
Python_add_library(_native MODULE WITH_SOABI "${CMAKE_CURRENT_BINARY_DIR}/_native.c")
|
|
48
|
+
add_dependencies(_native osvpy_native)
|
|
49
|
+
target_include_directories(_native PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
|
|
50
|
+
target_link_libraries(_native PRIVATE "${OSVPY_LIBRARY}")
|
|
51
|
+
set_target_properties(_native PROPERTIES
|
|
52
|
+
INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE
|
|
53
|
+
C_VISIBILITY_PRESET hidden)
|
|
54
|
+
if(APPLE)
|
|
55
|
+
set_target_properties(_native PROPERTIES INSTALL_RPATH "@loader_path/_lib")
|
|
56
|
+
add_custom_command(TARGET osvpy_native POST_BUILD
|
|
57
|
+
COMMAND install_name_tool -id "@rpath/libosvpy.dylib" "${OSVPY_LIBRARY}"
|
|
58
|
+
COMMAND codesign --force --sign - "${OSVPY_LIBRARY}"
|
|
59
|
+
VERBATIM)
|
|
60
|
+
else()
|
|
61
|
+
set_target_properties(_native PROPERTIES INSTALL_RPATH "$ORIGIN/_lib")
|
|
62
|
+
endif()
|
|
63
|
+
install(TARGETS _native LIBRARY DESTINATION osvpy)
|
osvpy-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
The Clear BSD License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026- Elias Gabriel
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted (subject to the limitations in the disclaimer
|
|
8
|
+
below) provided that the following conditions are met:
|
|
9
|
+
|
|
10
|
+
* Redistributions of source code must retain the above copyright notice,
|
|
11
|
+
this list of conditions and the following disclaimer.
|
|
12
|
+
|
|
13
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
14
|
+
notice, this list of conditions and the following disclaimer in the
|
|
15
|
+
documentation and/or other materials provided with the distribution.
|
|
16
|
+
|
|
17
|
+
* Neither the name of the copyright holder nor the names of its
|
|
18
|
+
contributors may be used to endorse or promote products derived from this
|
|
19
|
+
software without specific prior written permission.
|
|
20
|
+
|
|
21
|
+
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
|
|
22
|
+
THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
|
23
|
+
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
24
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
|
25
|
+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
26
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
27
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
28
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
29
|
+
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
|
30
|
+
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
31
|
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
32
|
+
POSSIBILITY OF SUCH DAMAGE.
|
osvpy-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: osvpy
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Scan container images for vulnerabilities in Python. Built on OSV-Scanner.
|
|
5
|
+
License-Expression: BSD-3-Clause-Clear
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
|
+
Classifier: Intended Audience :: Developers
|
|
9
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
10
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Classifier: Topic :: Security
|
|
16
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
17
|
+
Classifier: Typing :: Typed
|
|
18
|
+
Requires-Python: >=3.13
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# osvpy
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+

|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
Scan container images for vulnerabilities and license incompatibilities.
|
|
28
|
+
|
|
29
|
+
Built with [osvscanner](https://github.com/google/osv-scanner). In-process, no external dependencies.
|
|
30
|
+
|
|
31
|
+
Supports Python 3.13+ on Linux, WSL, or macOS 13+.
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
python -m pip install osvpy
|
|
37
|
+
# or
|
|
38
|
+
uv add osvpy
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Scan images
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
import asyncio
|
|
45
|
+
|
|
46
|
+
import osvpy
|
|
47
|
+
|
|
48
|
+
batch = await osvpy.scan("ubuntu:latest", "python:3.12-slim", workers=2)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
for image in batch.images:
|
|
52
|
+
if not image.complete:
|
|
53
|
+
for diagnostic in image.diagnostics:
|
|
54
|
+
print(image.requested, diagnostic.code, diagnostic.message)
|
|
55
|
+
continue
|
|
56
|
+
|
|
57
|
+
for finding in image.findings:
|
|
58
|
+
package = finding.occurrence.package
|
|
59
|
+
print(
|
|
60
|
+
image.requested,
|
|
61
|
+
package.name,
|
|
62
|
+
package.version,
|
|
63
|
+
finding.vulnerability.id,
|
|
64
|
+
tuple(finding.fix_evidence.versions),
|
|
65
|
+
finding.fix_evidence.status,
|
|
66
|
+
)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`scan()` returns a `BatchResult` with one image result per input, in input order.
|
|
70
|
+
Repeated inputs have separate image results. Calling `scan()` without images
|
|
71
|
+
raises `ValueError`. The examples below use `await` inside an async function
|
|
72
|
+
or notebook.
|
|
73
|
+
|
|
74
|
+
### Scan options
|
|
75
|
+
|
|
76
|
+
Keyword options apply to every image in the call.
|
|
77
|
+
|
|
78
|
+
| Option | Default | Purpose |
|
|
79
|
+
| ------------------ | ---------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
80
|
+
| `workers` | `None` (auto) | Maximum number of images scanned concurrently; a positive integer or `None` for automatic selection. |
|
|
81
|
+
| `all_packages` | `False` | Include packages without vulnerability or license findings. |
|
|
82
|
+
| `languages` | `None` | Select language families or individual package formats. |
|
|
83
|
+
| `allowed_licenses` | `None` | Evaluate packages against an SPDX license allowlist. |
|
|
84
|
+
| `auth` | `None` | Supply registry credentials with `RegistryAuth`. |
|
|
85
|
+
| `platform` | `None` (`linux/amd64`) | Select the image platform, such as `"linux/arm64"`. |
|
|
86
|
+
|
|
87
|
+
### Private registries and platforms
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
batch = await osvpy.scan(
|
|
91
|
+
"registry.example.com/team/app:latest",
|
|
92
|
+
auth=osvpy.RegistryAuth("reader", "password"),
|
|
93
|
+
platform="linux/arm64",
|
|
94
|
+
all_packages=True,
|
|
95
|
+
)
|
|
96
|
+
print(batch.images[0].status)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Registry references accept tags or digests. Supply credentials through
|
|
100
|
+
`RegistryAuth`; Docker credential helpers are not used.
|
|
101
|
+
|
|
102
|
+
## Concurrency and cancellation
|
|
103
|
+
|
|
104
|
+
Use `workers` to limit concurrency within a batch. Separate calls can run
|
|
105
|
+
concurrently, and completed results can be read from multiple threads.
|
|
106
|
+
Concurrency limits apply to each call separately. `None` selects the usable CPU
|
|
107
|
+
count bounded between two and four, then capped at the number of input images.
|
|
108
|
+
If the CPU count is unavailable, the automatic limit is two before the image
|
|
109
|
+
count cap. Set `workers=1` for serial scanning; zero and negative values raise
|
|
110
|
+
`ValueError`.
|
|
111
|
+
|
|
112
|
+
Set a deadline with `asyncio.timeout()` or `asyncio.wait_for()`:
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
import asyncio
|
|
116
|
+
|
|
117
|
+
async with asyncio.timeout(30):
|
|
118
|
+
batch = await osvpy.scan("debian:12-slim")
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Cancel an active scan with `task.cancel()`. Cancellation raises
|
|
122
|
+
`asyncio.CancelledError` after the scan stops; it does not return a partial batch.
|
|
123
|
+
Timeouts raise `TimeoutError` and may take longer than the requested deadline
|
|
124
|
+
while the scan stops. Repeated cancellation and `asyncio.TaskGroup` are supported.
|
|
125
|
+
|
|
126
|
+
## Language coverage
|
|
127
|
+
|
|
128
|
+
Combine families with `|`, or select individual formats such as `PYTHON_UV`:
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
batch = await osvpy.scan(
|
|
132
|
+
"python:3.12-slim",
|
|
133
|
+
languages=osvpy.LanguageSelection.PYTHON | osvpy.LanguageSelection.JAVA,
|
|
134
|
+
)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Family selections include supported manifests and lockfiles. Individual format
|
|
138
|
+
names combine the family and suffix, such as `JAVA_MAVEN`.
|
|
139
|
+
|
|
140
|
+
| Family | Format suffixes |
|
|
141
|
+
| ---------- | --------------------------------------------------------------- |
|
|
142
|
+
| CPP | CONAN |
|
|
143
|
+
| DART | PUBSPEC |
|
|
144
|
+
| DOTNET | PROJECT, DEPS, CENTRAL_PACKAGES, PACKAGES_CONFIG, PACKAGES_LOCK |
|
|
145
|
+
| ELIXIR | MIX |
|
|
146
|
+
| GO | BINARY, MODULES |
|
|
147
|
+
| HASKELL | CABAL, STACK |
|
|
148
|
+
| JAVA | ARCHIVE, GRADLE_LOCK, GRADLE_VERIFICATION, MAVEN |
|
|
149
|
+
| JAVASCRIPT | INSTALLED, NPM, PNPM, YARN, BUN |
|
|
150
|
+
| PHP | COMPOSER |
|
|
151
|
+
| PYTHON | INSTALLED, REQUIREMENTS, POETRY, PIPFILE, PDM, PYLOCK, UV |
|
|
152
|
+
| R | RENV |
|
|
153
|
+
| RUBY | GEMFILE |
|
|
154
|
+
| RUST | BINARY, CARGO |
|
|
155
|
+
| SWIFT | PACKAGE_RESOLVED |
|
|
156
|
+
|
|
157
|
+
- `None` or `LanguageSelection.INSTALLED`: installed Python and JavaScript packages, Java archives, and Go and Rust binaries.
|
|
158
|
+
- `LanguageSelection.ALL`: every format listed above.
|
|
159
|
+
- `LanguageSelection.NONE`: OS packages only.
|
|
160
|
+
|
|
161
|
+
OS package scanning remains enabled with every language selection. Standalone
|
|
162
|
+
source directories, lockfiles, and SBOM files are not accepted as scan inputs.
|
|
163
|
+
|
|
164
|
+
## Read results
|
|
165
|
+
|
|
166
|
+
Access fields directly, such as `package.name` or `image.status`.
|
|
167
|
+
|
|
168
|
+
| Object | Data and relationships |
|
|
169
|
+
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
170
|
+
| `batch` | `images`, `packages`, `vulnerabilities`, `advisory_sources`, `findings`, `complete`, `errors` |
|
|
171
|
+
| `image` | `requested`, `os`, `status`, `diagnostics`, `complete`, `packages`, `occurrences`, `vulnerable_packages`, `noncompliant_packages`, `vulnerabilities`, `findings` |
|
|
172
|
+
| `package` | `name`, `version`, `ecosystem`, `commit`, `os_package_name`, `purl`, `present_images`, `vulnerable_images`, `noncompliant_images`, `affected_images`, `findings` |
|
|
173
|
+
| `vulnerability` | `id`, `aliases`, `affected_images`, `findings` |
|
|
174
|
+
| `advisory_source` | `id`, `aliases`, `summary`, `severities`, `references`, `modified`, `published`, `withdrawn`, `affected_images`, `findings` |
|
|
175
|
+
| `occurrence` | `image`, `package`, `context`, `license_assessment`, `findings` |
|
|
176
|
+
| `finding` | `occurrence`, `vulnerability`, `advisory_source`, `assessment`, `fix_evidence` |
|
|
177
|
+
|
|
178
|
+
An occurrence describes a package in a particular image and location. Its
|
|
179
|
+
`context` includes the path, source type, layer digest, and dependency groups.
|
|
180
|
+
Package `affected_images` combines vulnerability-affected and license-noncompliant
|
|
181
|
+
images; `present_images` includes every image reporting that package.
|
|
182
|
+
|
|
183
|
+
Vulnerabilities group related advisory identifiers, preferring a CVE identifier
|
|
184
|
+
when available. Individual advisories provide their own summaries, severity
|
|
185
|
+
information, references, and dates.
|
|
186
|
+
|
|
187
|
+
### Fix evidence
|
|
188
|
+
|
|
189
|
+
`finding.fix_evidence.versions` contains reported package-specific, non-Git fix
|
|
190
|
+
versions. When version ordering is supported, fixes at or below the installed
|
|
191
|
+
version are excluded.
|
|
192
|
+
|
|
193
|
+
| `finding.fix_evidence.status` | Meaning |
|
|
194
|
+
| ----------------------------- | -------------------------------------------------------------- |
|
|
195
|
+
| `reported` | Applicable fix versions were reported. |
|
|
196
|
+
| `no_reported_fix` | No applicable explicit fix version was reported. |
|
|
197
|
+
| `unknown` | Fix applicability or version ordering could not be determined. |
|
|
198
|
+
|
|
199
|
+
Unknown ordering preserves reported version strings. An empty collection does
|
|
200
|
+
not establish that no fix exists. Reported fixes are not upgrade recommendations
|
|
201
|
+
or a guarantee that later versions are unaffected.
|
|
202
|
+
|
|
203
|
+
### Collections and equality
|
|
204
|
+
|
|
205
|
+
Collections support iteration, `len()`, negative indexing, and slicing. Slices
|
|
206
|
+
return tuples. Use `tuple(values)` to collect all items into a tuple.
|
|
207
|
+
|
|
208
|
+
Results are read-only and cannot be pickled. References to the same record within
|
|
209
|
+
a batch compare equal and have the same hash. Records from separate scans compare
|
|
210
|
+
unequal; compare their fields when checking for matching contents. A package,
|
|
211
|
+
finding, or collection remains usable after its original batch variable is deleted.
|
|
212
|
+
|
|
213
|
+
## License policies
|
|
214
|
+
|
|
215
|
+
```python
|
|
216
|
+
batch = await osvpy.scan("python:3.12-slim", allowed_licenses={"MIT", "Apache-2.0"})
|
|
217
|
+
|
|
218
|
+
for occurrence in batch.images[0].occurrences:
|
|
219
|
+
assessment = occurrence.license_assessment
|
|
220
|
+
print(occurrence.package.name, assessment.status, tuple(assessment.violations))
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
`allowed_licenses=None` disables license evaluation. An empty collection allows
|
|
224
|
+
no licenses. Policies support SPDX expressions. `assessment.policy` is `None`
|
|
225
|
+
when evaluation was not requested, or an empty sequence for an empty allowlist.
|
|
226
|
+
|
|
227
|
+
License assessment statuses are `not_evaluated`, `compliant`, `noncompliant`,
|
|
228
|
+
and `unknown`. Packages can have license violations without vulnerabilities.
|
|
229
|
+
|
|
230
|
+
## Failures and diagnostics
|
|
231
|
+
|
|
232
|
+
An image download or scan failure produces a failed image result; remaining
|
|
233
|
+
inputs are still scanned. `batch.complete` is false if any image failed.
|
|
234
|
+
|
|
235
|
+
```python
|
|
236
|
+
for image_index, diagnostic in batch.errors:
|
|
237
|
+
print(batch.images[image_index].requested)
|
|
238
|
+
print(diagnostic.code, diagnostic.message)
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Error codes include `registry_authentication`, `image_not_found`, `invalid_image`,
|
|
242
|
+
and `scan_error`. Failed images represent unknown results.
|
|
243
|
+
Successful images may also contain diagnostics in `image.diagnostics`.
|
|
244
|
+
|
|
245
|
+
Batch-level failures raise `osvpy.NativeLibraryError` and abort the batch.
|
|
246
|
+
Library exceptions derive from `osvpy.OSVError`.
|
|
247
|
+
|
|
248
|
+
## Comparison
|
|
249
|
+
|
|
250
|
+
Features available out of the box when integrating with Python:
|
|
251
|
+
|
|
252
|
+
| Feature | osvpy | OSV-Scanner CLI |
|
|
253
|
+
| ------------------------------------------------------------------------------------------ | ----- | ------------------------------- |
|
|
254
|
+
| Container vulnerability and license scanning | ✅ | ✅ |
|
|
255
|
+
| [Source directory, lockfile, and SBOM inputs](https://google.github.io/osv-scanner/usage/) | ❌ | ✅ |
|
|
256
|
+
| Typed Python results | ✅ | ❌ Parse JSON yourself |
|
|
257
|
+
| Cross-image result relationships | ✅ | ❌ Build relationships yourself |
|
|
258
|
+
| [HTML and SARIF reports](https://google.github.io/osv-scanner/output/) | ❌ | ✅ |
|
|
259
|
+
| In-process scanning, no separate executable | ✅ | ❌ Install scanner separately |
|
|
260
|
+
| Async Python API with cancellation | ✅ | ❌ Write subprocess handling |
|
|
261
|
+
| Batch scanning | ✅ | ❌ Write batch orchestration |
|
|
262
|
+
|
|
263
|
+
## Building distributions
|
|
264
|
+
|
|
265
|
+
Source builds require Go (see `go/go.mod`), Git, and a C compiler. `uv build`
|
|
266
|
+
builds a source archive and then a wheel from that archive.
|
|
267
|
+
|
|
268
|
+
Linux wheels need [repairing for PyPI](https://scikit-build-core.readthedocs.io/en/stable/guide/build.html#repairing):
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
uv build
|
|
272
|
+
uvx --with patchelf auditwheel repair dist/*.whl --wheel-dir wheelhouse
|
|
273
|
+
uv publish --dry-run dist/*.tar.gz wheelhouse/*.whl
|
|
274
|
+
uv publish dist/*.tar.gz wheelhouse/*.whl
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Publish the repaired wheel from `wheelhouse`. Its minimum glibc version depends
|
|
278
|
+
on the build environment; use a manylinux container to target older Linux
|
|
279
|
+
systems. On macOS, publish the wheel in `dist` directly.
|
osvpy-0.2.0/README.md
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
# osvpy
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
Scan container images for vulnerabilities and license incompatibilities.
|
|
8
|
+
|
|
9
|
+
Built with [osvscanner](https://github.com/google/osv-scanner). In-process, no external dependencies.
|
|
10
|
+
|
|
11
|
+
Supports Python 3.13+ on Linux, WSL, or macOS 13+.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
python -m pip install osvpy
|
|
17
|
+
# or
|
|
18
|
+
uv add osvpy
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Scan images
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
import asyncio
|
|
25
|
+
|
|
26
|
+
import osvpy
|
|
27
|
+
|
|
28
|
+
batch = await osvpy.scan("ubuntu:latest", "python:3.12-slim", workers=2)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
for image in batch.images:
|
|
32
|
+
if not image.complete:
|
|
33
|
+
for diagnostic in image.diagnostics:
|
|
34
|
+
print(image.requested, diagnostic.code, diagnostic.message)
|
|
35
|
+
continue
|
|
36
|
+
|
|
37
|
+
for finding in image.findings:
|
|
38
|
+
package = finding.occurrence.package
|
|
39
|
+
print(
|
|
40
|
+
image.requested,
|
|
41
|
+
package.name,
|
|
42
|
+
package.version,
|
|
43
|
+
finding.vulnerability.id,
|
|
44
|
+
tuple(finding.fix_evidence.versions),
|
|
45
|
+
finding.fix_evidence.status,
|
|
46
|
+
)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`scan()` returns a `BatchResult` with one image result per input, in input order.
|
|
50
|
+
Repeated inputs have separate image results. Calling `scan()` without images
|
|
51
|
+
raises `ValueError`. The examples below use `await` inside an async function
|
|
52
|
+
or notebook.
|
|
53
|
+
|
|
54
|
+
### Scan options
|
|
55
|
+
|
|
56
|
+
Keyword options apply to every image in the call.
|
|
57
|
+
|
|
58
|
+
| Option | Default | Purpose |
|
|
59
|
+
| ------------------ | ---------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
60
|
+
| `workers` | `None` (auto) | Maximum number of images scanned concurrently; a positive integer or `None` for automatic selection. |
|
|
61
|
+
| `all_packages` | `False` | Include packages without vulnerability or license findings. |
|
|
62
|
+
| `languages` | `None` | Select language families or individual package formats. |
|
|
63
|
+
| `allowed_licenses` | `None` | Evaluate packages against an SPDX license allowlist. |
|
|
64
|
+
| `auth` | `None` | Supply registry credentials with `RegistryAuth`. |
|
|
65
|
+
| `platform` | `None` (`linux/amd64`) | Select the image platform, such as `"linux/arm64"`. |
|
|
66
|
+
|
|
67
|
+
### Private registries and platforms
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
batch = await osvpy.scan(
|
|
71
|
+
"registry.example.com/team/app:latest",
|
|
72
|
+
auth=osvpy.RegistryAuth("reader", "password"),
|
|
73
|
+
platform="linux/arm64",
|
|
74
|
+
all_packages=True,
|
|
75
|
+
)
|
|
76
|
+
print(batch.images[0].status)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Registry references accept tags or digests. Supply credentials through
|
|
80
|
+
`RegistryAuth`; Docker credential helpers are not used.
|
|
81
|
+
|
|
82
|
+
## Concurrency and cancellation
|
|
83
|
+
|
|
84
|
+
Use `workers` to limit concurrency within a batch. Separate calls can run
|
|
85
|
+
concurrently, and completed results can be read from multiple threads.
|
|
86
|
+
Concurrency limits apply to each call separately. `None` selects the usable CPU
|
|
87
|
+
count bounded between two and four, then capped at the number of input images.
|
|
88
|
+
If the CPU count is unavailable, the automatic limit is two before the image
|
|
89
|
+
count cap. Set `workers=1` for serial scanning; zero and negative values raise
|
|
90
|
+
`ValueError`.
|
|
91
|
+
|
|
92
|
+
Set a deadline with `asyncio.timeout()` or `asyncio.wait_for()`:
|
|
93
|
+
|
|
94
|
+
```python
|
|
95
|
+
import asyncio
|
|
96
|
+
|
|
97
|
+
async with asyncio.timeout(30):
|
|
98
|
+
batch = await osvpy.scan("debian:12-slim")
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Cancel an active scan with `task.cancel()`. Cancellation raises
|
|
102
|
+
`asyncio.CancelledError` after the scan stops; it does not return a partial batch.
|
|
103
|
+
Timeouts raise `TimeoutError` and may take longer than the requested deadline
|
|
104
|
+
while the scan stops. Repeated cancellation and `asyncio.TaskGroup` are supported.
|
|
105
|
+
|
|
106
|
+
## Language coverage
|
|
107
|
+
|
|
108
|
+
Combine families with `|`, or select individual formats such as `PYTHON_UV`:
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
batch = await osvpy.scan(
|
|
112
|
+
"python:3.12-slim",
|
|
113
|
+
languages=osvpy.LanguageSelection.PYTHON | osvpy.LanguageSelection.JAVA,
|
|
114
|
+
)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Family selections include supported manifests and lockfiles. Individual format
|
|
118
|
+
names combine the family and suffix, such as `JAVA_MAVEN`.
|
|
119
|
+
|
|
120
|
+
| Family | Format suffixes |
|
|
121
|
+
| ---------- | --------------------------------------------------------------- |
|
|
122
|
+
| CPP | CONAN |
|
|
123
|
+
| DART | PUBSPEC |
|
|
124
|
+
| DOTNET | PROJECT, DEPS, CENTRAL_PACKAGES, PACKAGES_CONFIG, PACKAGES_LOCK |
|
|
125
|
+
| ELIXIR | MIX |
|
|
126
|
+
| GO | BINARY, MODULES |
|
|
127
|
+
| HASKELL | CABAL, STACK |
|
|
128
|
+
| JAVA | ARCHIVE, GRADLE_LOCK, GRADLE_VERIFICATION, MAVEN |
|
|
129
|
+
| JAVASCRIPT | INSTALLED, NPM, PNPM, YARN, BUN |
|
|
130
|
+
| PHP | COMPOSER |
|
|
131
|
+
| PYTHON | INSTALLED, REQUIREMENTS, POETRY, PIPFILE, PDM, PYLOCK, UV |
|
|
132
|
+
| R | RENV |
|
|
133
|
+
| RUBY | GEMFILE |
|
|
134
|
+
| RUST | BINARY, CARGO |
|
|
135
|
+
| SWIFT | PACKAGE_RESOLVED |
|
|
136
|
+
|
|
137
|
+
- `None` or `LanguageSelection.INSTALLED`: installed Python and JavaScript packages, Java archives, and Go and Rust binaries.
|
|
138
|
+
- `LanguageSelection.ALL`: every format listed above.
|
|
139
|
+
- `LanguageSelection.NONE`: OS packages only.
|
|
140
|
+
|
|
141
|
+
OS package scanning remains enabled with every language selection. Standalone
|
|
142
|
+
source directories, lockfiles, and SBOM files are not accepted as scan inputs.
|
|
143
|
+
|
|
144
|
+
## Read results
|
|
145
|
+
|
|
146
|
+
Access fields directly, such as `package.name` or `image.status`.
|
|
147
|
+
|
|
148
|
+
| Object | Data and relationships |
|
|
149
|
+
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
150
|
+
| `batch` | `images`, `packages`, `vulnerabilities`, `advisory_sources`, `findings`, `complete`, `errors` |
|
|
151
|
+
| `image` | `requested`, `os`, `status`, `diagnostics`, `complete`, `packages`, `occurrences`, `vulnerable_packages`, `noncompliant_packages`, `vulnerabilities`, `findings` |
|
|
152
|
+
| `package` | `name`, `version`, `ecosystem`, `commit`, `os_package_name`, `purl`, `present_images`, `vulnerable_images`, `noncompliant_images`, `affected_images`, `findings` |
|
|
153
|
+
| `vulnerability` | `id`, `aliases`, `affected_images`, `findings` |
|
|
154
|
+
| `advisory_source` | `id`, `aliases`, `summary`, `severities`, `references`, `modified`, `published`, `withdrawn`, `affected_images`, `findings` |
|
|
155
|
+
| `occurrence` | `image`, `package`, `context`, `license_assessment`, `findings` |
|
|
156
|
+
| `finding` | `occurrence`, `vulnerability`, `advisory_source`, `assessment`, `fix_evidence` |
|
|
157
|
+
|
|
158
|
+
An occurrence describes a package in a particular image and location. Its
|
|
159
|
+
`context` includes the path, source type, layer digest, and dependency groups.
|
|
160
|
+
Package `affected_images` combines vulnerability-affected and license-noncompliant
|
|
161
|
+
images; `present_images` includes every image reporting that package.
|
|
162
|
+
|
|
163
|
+
Vulnerabilities group related advisory identifiers, preferring a CVE identifier
|
|
164
|
+
when available. Individual advisories provide their own summaries, severity
|
|
165
|
+
information, references, and dates.
|
|
166
|
+
|
|
167
|
+
### Fix evidence
|
|
168
|
+
|
|
169
|
+
`finding.fix_evidence.versions` contains reported package-specific, non-Git fix
|
|
170
|
+
versions. When version ordering is supported, fixes at or below the installed
|
|
171
|
+
version are excluded.
|
|
172
|
+
|
|
173
|
+
| `finding.fix_evidence.status` | Meaning |
|
|
174
|
+
| ----------------------------- | -------------------------------------------------------------- |
|
|
175
|
+
| `reported` | Applicable fix versions were reported. |
|
|
176
|
+
| `no_reported_fix` | No applicable explicit fix version was reported. |
|
|
177
|
+
| `unknown` | Fix applicability or version ordering could not be determined. |
|
|
178
|
+
|
|
179
|
+
Unknown ordering preserves reported version strings. An empty collection does
|
|
180
|
+
not establish that no fix exists. Reported fixes are not upgrade recommendations
|
|
181
|
+
or a guarantee that later versions are unaffected.
|
|
182
|
+
|
|
183
|
+
### Collections and equality
|
|
184
|
+
|
|
185
|
+
Collections support iteration, `len()`, negative indexing, and slicing. Slices
|
|
186
|
+
return tuples. Use `tuple(values)` to collect all items into a tuple.
|
|
187
|
+
|
|
188
|
+
Results are read-only and cannot be pickled. References to the same record within
|
|
189
|
+
a batch compare equal and have the same hash. Records from separate scans compare
|
|
190
|
+
unequal; compare their fields when checking for matching contents. A package,
|
|
191
|
+
finding, or collection remains usable after its original batch variable is deleted.
|
|
192
|
+
|
|
193
|
+
## License policies
|
|
194
|
+
|
|
195
|
+
```python
|
|
196
|
+
batch = await osvpy.scan("python:3.12-slim", allowed_licenses={"MIT", "Apache-2.0"})
|
|
197
|
+
|
|
198
|
+
for occurrence in batch.images[0].occurrences:
|
|
199
|
+
assessment = occurrence.license_assessment
|
|
200
|
+
print(occurrence.package.name, assessment.status, tuple(assessment.violations))
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
`allowed_licenses=None` disables license evaluation. An empty collection allows
|
|
204
|
+
no licenses. Policies support SPDX expressions. `assessment.policy` is `None`
|
|
205
|
+
when evaluation was not requested, or an empty sequence for an empty allowlist.
|
|
206
|
+
|
|
207
|
+
License assessment statuses are `not_evaluated`, `compliant`, `noncompliant`,
|
|
208
|
+
and `unknown`. Packages can have license violations without vulnerabilities.
|
|
209
|
+
|
|
210
|
+
## Failures and diagnostics
|
|
211
|
+
|
|
212
|
+
An image download or scan failure produces a failed image result; remaining
|
|
213
|
+
inputs are still scanned. `batch.complete` is false if any image failed.
|
|
214
|
+
|
|
215
|
+
```python
|
|
216
|
+
for image_index, diagnostic in batch.errors:
|
|
217
|
+
print(batch.images[image_index].requested)
|
|
218
|
+
print(diagnostic.code, diagnostic.message)
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Error codes include `registry_authentication`, `image_not_found`, `invalid_image`,
|
|
222
|
+
and `scan_error`. Failed images represent unknown results.
|
|
223
|
+
Successful images may also contain diagnostics in `image.diagnostics`.
|
|
224
|
+
|
|
225
|
+
Batch-level failures raise `osvpy.NativeLibraryError` and abort the batch.
|
|
226
|
+
Library exceptions derive from `osvpy.OSVError`.
|
|
227
|
+
|
|
228
|
+
## Comparison
|
|
229
|
+
|
|
230
|
+
Features available out of the box when integrating with Python:
|
|
231
|
+
|
|
232
|
+
| Feature | osvpy | OSV-Scanner CLI |
|
|
233
|
+
| ------------------------------------------------------------------------------------------ | ----- | ------------------------------- |
|
|
234
|
+
| Container vulnerability and license scanning | ✅ | ✅ |
|
|
235
|
+
| [Source directory, lockfile, and SBOM inputs](https://google.github.io/osv-scanner/usage/) | ❌ | ✅ |
|
|
236
|
+
| Typed Python results | ✅ | ❌ Parse JSON yourself |
|
|
237
|
+
| Cross-image result relationships | ✅ | ❌ Build relationships yourself |
|
|
238
|
+
| [HTML and SARIF reports](https://google.github.io/osv-scanner/output/) | ❌ | ✅ |
|
|
239
|
+
| In-process scanning, no separate executable | ✅ | ❌ Install scanner separately |
|
|
240
|
+
| Async Python API with cancellation | ✅ | ❌ Write subprocess handling |
|
|
241
|
+
| Batch scanning | ✅ | ❌ Write batch orchestration |
|
|
242
|
+
|
|
243
|
+
## Building distributions
|
|
244
|
+
|
|
245
|
+
Source builds require Go (see `go/go.mod`), Git, and a C compiler. `uv build`
|
|
246
|
+
builds a source archive and then a wheel from that archive.
|
|
247
|
+
|
|
248
|
+
Linux wheels need [repairing for PyPI](https://scikit-build-core.readthedocs.io/en/stable/guide/build.html#repairing):
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
uv build
|
|
252
|
+
uvx --with patchelf auditwheel repair dist/*.whl --wheel-dir wheelhouse
|
|
253
|
+
uv publish --dry-run dist/*.tar.gz wheelhouse/*.whl
|
|
254
|
+
uv publish dist/*.tar.gz wheelhouse/*.whl
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Publish the repaired wheel from `wheelhouse`. Its minimum glibc version depends
|
|
258
|
+
on the build environment; use a manylinux container to target older Linux
|
|
259
|
+
systems. On macOS, publish the wheel in `dist` directly.
|