From 163060818b2f4a7605f19cf9702ed2607b7e6b1d Mon Sep 17 00:00:00 2001 From: Akash Singhal Date: Wed, 15 Nov 2023 01:05:21 +0000 Subject: [PATCH] feat: add vulnerability report verifier --- .github/workflows/publish-package.yml | 1 + CONTRIBUTING.md | 2 +- Makefile | 2 + ..._v1beta1_verifier_vulnerabilityreport.yaml | 15 + go.mod | 5 +- go.sum | 89 + httpserver/Dockerfile | 2 + .../samples/constraint.yaml | 11 + .../notation-nested-validation/template.yaml | 80 + .../samples/constraint.yaml | 11 + .../template.yaml | 82 + .../schemavalidation/schemas/sarif-2.1.0.json | 3012 +++++++++++++++++ .../schemavalidation/schemavalidation_test.go | 84 + .../schemavalidation/schemavalidator.go | 65 + .../schemavalidation/testdata/bad_schema.json | 2 + .../testdata/mismatch_schema.json | 964 ++++++ .../testdata/trivy_scan_report.json | 1889 +++++++++++ .../vulnerability_report.go | 400 +++ .../vulnerability_report_test.go | 783 +++++ scripts/azure-ci-test.sh | 2 +- 20 files changed, 7498 insertions(+), 3 deletions(-) create mode 100644 config/samples/config_v1beta1_verifier_vulnerabilityreport.yaml create mode 100644 library/notation-nested-validation/samples/constraint.yaml create mode 100644 library/notation-nested-validation/template.yaml create mode 100644 library/vulnerability-report-validation/samples/constraint.yaml create mode 100644 library/vulnerability-report-validation/template.yaml create mode 100644 plugins/verifier/vulnerabilityreport/schemavalidation/schemas/sarif-2.1.0.json create mode 100644 plugins/verifier/vulnerabilityreport/schemavalidation/schemavalidation_test.go create mode 100644 plugins/verifier/vulnerabilityreport/schemavalidation/schemavalidator.go create mode 100644 plugins/verifier/vulnerabilityreport/schemavalidation/testdata/bad_schema.json create mode 100644 plugins/verifier/vulnerabilityreport/schemavalidation/testdata/mismatch_schema.json create mode 100644 plugins/verifier/vulnerabilityreport/schemavalidation/testdata/trivy_scan_report.json create mode 100644 plugins/verifier/vulnerabilityreport/vulnerability_report.go create mode 100644 plugins/verifier/vulnerabilityreport/vulnerability_report_test.go diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 4e0c90a650..6a6c8234e1 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -73,6 +73,7 @@ jobs: --build-arg build_sbom=true \ --build-arg build_licensechecker=true \ --build-arg build_schemavalidator=true \ + --build-arg build_vulnerabilityreport=true \ --build-arg LDFLAGS="-X github.com/deislabs/ratify/internal/version.Version=$(TAG)" \ --label org.opencontainers.image.revision=${{ github.sha }} \ -t ${{ steps.prepare.outputs.ref }} \ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1365441649..4be2fc32d3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -144,7 +144,7 @@ Follow the steps below to build and deploy a Ratify image with your private chan export REGISTRY=yourregistry docker buildx create --use -docker buildx build -f httpserver/Dockerfile --platform linux/amd64 --build-arg build_cosign=true --build-arg build_sbom=true --build-arg build_licensechecker=true --build-arg build_schemavalidator=true -t ${REGISTRY}/deislabs/ratify:yourtag . +docker buildx build -f httpserver/Dockerfile --platform linux/amd64 --build-arg build_cosign=true --build-arg build_sbom=true --build-arg build_licensechecker=true --build-arg build_schemavalidator=true build_vulnerabilityreport -t ${REGISTRY}/deislabs/ratify:yourtag . docker build --progress=plain --build-arg KUBE_VERSION="1.25.0" --build-arg TARGETOS="linux" --build-arg TARGETARCH="amd64" -f crd.Dockerfile -t ${REGISTRY}/localbuildcrd:yourtag ./charts/ratify/crds ``` diff --git a/Makefile b/Makefile index 95f61c6d6a..74c609473f 100644 --- a/Makefile +++ b/Makefile @@ -68,6 +68,7 @@ build-plugins: go build -cover -coverpkg=github.com/deislabs/ratify/plugins/verifier/sample/... -o ./bin/plugins/ ./plugins/verifier/sample go build -cover -coverpkg=github.com/deislabs/ratify/plugins/verifier/sbom/... -o ./bin/plugins/ ./plugins/verifier/sbom go build -cover -coverpkg=github.com/deislabs/ratify/plugins/verifier/schemavalidator/... -o ./bin/plugins/ ./plugins/verifier/schemavalidator + go build -cover -coverpkg=github.com/deislabs/ratify/plugins/verifier/vulnerabilityreport/... -o ./bin/plugins/ ./plugins/verifier/vulnerabilityreport .PHONY: install install: @@ -468,6 +469,7 @@ e2e-build-local-ratify-image: --build-arg build_sbom=true \ --build-arg build_licensechecker=true \ --build-arg build_schemavalidator=true \ + --build-arg build_vulnerabilityreport=true \ -f ./httpserver/Dockerfile \ -t localbuild:test . kind load docker-image --name kind localbuild:test diff --git a/config/samples/config_v1beta1_verifier_vulnerabilityreport.yaml b/config/samples/config_v1beta1_verifier_vulnerabilityreport.yaml new file mode 100644 index 0000000000..1c348eae74 --- /dev/null +++ b/config/samples/config_v1beta1_verifier_vulnerabilityreport.yaml @@ -0,0 +1,15 @@ +apiVersion: config.ratify.deislabs.io/v1beta1 +kind: Verifier +metadata: + name: verifier-vulnerabilityreport +spec: + name: vulnerabilityreport + artifactTypes: application/sarif+json + parameters: + nestedReferences: application/vnd.cncf.notary.signature + maximumAge: 24h + disallowedSeverity: + - high + - critical + denylistCVEs: + - CVE-2021-44228 # Log4Shell diff --git a/go.mod b/go.mod index 741172c341..b3ad149928 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/deislabs/ratify -go 1.20 +go 1.21 + +toolchain go1.21.3 // Accidentally published prior to 1.0.0 release retract ( @@ -34,6 +36,7 @@ require ( github.com/open-policy-agent/opa v0.58.0 github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.1.0-rc5 + github.com/owenrumney/go-sarif/v2 v2.3.0 github.com/pkg/errors v0.9.1 github.com/sigstore/cosign/v2 v2.2.1 github.com/sigstore/sigstore v1.7.5 diff --git a/go.sum b/go.sum index 150dd6cadc..b936296f0e 100644 --- a/go.sum +++ b/go.sum @@ -31,7 +31,9 @@ cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2Aawl cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/iam v1.1.4 h1:K6n/GZHFTtEoKT5aUG3l9diPi0VduZNQ1PfdnpkkIFk= +cloud.google.com/go/iam v1.1.4/go.mod h1:l/rg8l1AaA+VFMho/HYx2Vv6xinPSLMF8qfhRPIZ0L8= cloud.google.com/go/kms v1.15.4 h1:gEZzC54ZBI+aeW8/jg9tgz9KR4Aa+WEDPbdGIV3iJ7A= +cloud.google.com/go/kms v1.15.4/go.mod h1:L3Sdj6QTHK8dfwK5D1JLsAyELsNMnd3tAIwGS4ltKpc= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -46,6 +48,7 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= github.com/AdamKorcz/go-fuzz-headers-1 v0.0.0-20230618160516-e936619f9f18 h1:rd389Q26LMy03gG4anandGFC2LW/xvjga5GezeeaxQk= +github.com/AdamKorcz/go-fuzz-headers-1 v0.0.0-20230618160516-e936619f9f18/go.mod h1:fgJuSBrJP5qZtKqaMJE0hmhS2tmRH+44IkfZvjtaf1M= github.com/AliyunContainerService/ack-ram-tool/pkg/credentials/alibabacloudsdkgo/helper v0.2.0 h1:8+4G8JaejP8Xa6W46PzJEwisNgBXMvFcz78N6zG/ARw= github.com/AliyunContainerService/ack-ram-tool/pkg/credentials/alibabacloudsdkgo/helper v0.2.0/go.mod h1:GgeIE+1be8Ivm7Sh4RgwI42aTtC9qrcj+Y9Y6CjJhJs= github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU= @@ -57,7 +60,9 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0/go.mod h1:1fXstnBMas5kzG github.com/Azure/azure-sdk-for-go/sdk/internal v1.4.0 h1:TuEMD+E+1aTjjLICGQOW6vLe8UWES7kopac9mUXL56Y= github.com/Azure/azure-sdk-for-go/sdk/internal v1.4.0/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1 h1:MyVTgWR8qd/Jw1Le0NZebGBUCLbtak3bJ3z1OlqZBpw= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1/go.mod h1:GpPjLhVR9dnUoJMyHWSPy71xY9/lcmpzIPZXmF0FCVY= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 h1:D3occbWoio4EBLkbkevetNMAVX197GkzbUMtqjGWn80= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0/go.mod h1:bTSOgj05NGRuHHhQwAdPnYr9TOdNmKlZTgGLL6nyAdI= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.11.24/go.mod h1:G6kyRlFnTuSbEYkQGawPfsCswgme4iYf6rfSKUDzbCc= @@ -102,6 +107,7 @@ github.com/ThalesIgnite/crypto11 v1.2.5/go.mod h1:ILDKtnCKiQ7zRoNxcp36Y1ZR8LBPmR github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0= +github.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74 h1:Kk6a4nehpJ3UuJRqlA3JxYxBZEqCeOmATOvrbT4p9RA= github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4= github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.2/go.mod h1:sCavSAvdzOjul4cEqeVtvlSaSScfNsTQ+46HwlTL1hc= @@ -148,12 +154,14 @@ github.com/aliyun/credentials-go v1.3.1 h1:uq/0v7kWrxmoLGpqjx7vtQ/s03f0zR//0br/x github.com/aliyun/credentials-go v1.3.1/go.mod h1:8jKYhQuDawt8x2+fusqa1Y6mPxemTsBEN04dgcAcYz0= github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 h1:aM1rlcoLz8y5B2r4tTLMiVTrMtpfY0O8EScKJxaSaEc= github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092/go.mod h1:rYqSE9HbjzpHTI74vwPvae4ZVYZd1lue2ta6xHPdblA= +github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aws/aws-sdk-go v1.47.0 h1:/JUg9V1+xh+qBn8A6ec/l15ETPaMaBqxkjz+gg63dNk= +github.com/aws/aws-sdk-go v1.47.0/go.mod h1:DlEaEbWKZmsITVbqlSVvekPARM1HzeV9PMYg15ymSDA= github.com/aws/aws-sdk-go-v2 v1.21.2 h1:+LXZ0sgo8quN9UOKXXzAWRT3FWd4NxeXWOZom9pE7GA= github.com/aws/aws-sdk-go-v2 v1.21.2/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM= github.com/aws/aws-sdk-go-v2/config v1.19.1 h1:oe3vqcGftyk40icfLymhhhNysAwk0NfiwkDi2GTPMXs= @@ -175,6 +183,7 @@ github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.18.2/go.mod h1:fUHpGXr4DrXkEDp github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 h1:WWZA/I2K4ptBS1kg0kV1JbBtG/umed0vwHRrmcr9z7k= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37/go.mod h1:vBmDnwWXWxNPFRMmG2m/3MKOe+xEcMDo1tanpaWCcck= github.com/aws/aws-sdk-go-v2/service/kms v1.24.7 h1:uRGw0UKo5hc7M2T7uGsK/Yg2qwecq/dnVjQbbq9RCzY= +github.com/aws/aws-sdk-go-v2/service/kms v1.24.7/go.mod h1:z3O9CXfVrKAV3c9fMWOUUv2C6N2ggXCDHeXpOB6lAEk= github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 h1:JuPGc7IkOP4AaqcZSIcyqLpFSqBWK32rM9+a1g6u73k= github.com/aws/aws-sdk-go-v2/service/sso v1.15.2/go.mod h1:gsL4keucRCgW+xA85ALBpRFfdSLH4kHOVSnLMSuBECo= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 h1:HFiiRkf1SdaAmV3/BHOFZ9DjFynPHj8G/UIO1lQS+fk= @@ -193,10 +202,14 @@ github.com/bshuster-repo/logrus-logstash-hook v1.1.0 h1:o2FzZifLg+z/DN1OFmzTWzZZ github.com/bshuster-repo/logrus-logstash-hook v1.1.0/go.mod h1:Q2aXOe7rNuPgbBtPCOzYyWDvKX7+FpxE5sRdvcPoui0= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bytecodealliance/wasmtime-go/v3 v3.0.2 h1:3uZCA/BLTIu+DqCfguByNMJa2HVHpXvjfy0Dy7g6fuA= +github.com/bytecodealliance/wasmtime-go/v3 v3.0.2/go.mod h1:RnUjnIXxEJcL6BgCvNyzCCRzZcxCgsZCi+RNlvYor5Q= github.com/cenkalti/backoff/v3 v3.2.2 h1:cfUAAO3yvKMYKPrvhDuHSwQnhZNk/RMHKdZqKTxfm6M= +github.com/cenkalti/backoff/v3 v3.2.2/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -217,6 +230,7 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE= +github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4= github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be h1:J5BL2kskAlV9ckgEsNQXscjIaLiOYiZ75d4e94E6dcQ= github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be/go.mod h1:mk5IQ+Y0ZeO87b858TlA645sVcEcbiX6YqP98kt+7+w= github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k= @@ -228,6 +242,7 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/cyberphone/json-canonicalization v0.0.0-20231011164504-785e29786b46 h1:2Dx4IHfC1yHWI12AxQDJM1QbRCDfk6M+blLzlZCXdrc= github.com/cyberphone/json-canonicalization v0.0.0-20231011164504-785e29786b46/go.mod h1:uzvlm1mxhHkdfqitSA92i7Se+S9ksOn3a3qmv/kyOCw= github.com/danieljoos/wincred v1.2.0 h1:ozqKHaLK0W/ii4KVbbvluM91W2H3Sh0BncbUNPS7jLE= +github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0SkRa/eYHgec= github.com/dapr/go-sdk v1.8.0 h1:OEleeL3zUTqXxIZ7Vkk3PClAeCh1g8sZ1yR2JFZKfXM= github.com/dapr/go-sdk v1.8.0/go.mod h1:MBcTKXg8PmBc8A968tVWQg1Xt+DZtmeVR6zVVVGcmeA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -235,11 +250,14 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/depcheck-test/depcheck-test v0.0.0-20220607135614-199033aaa936 h1:foGzavPWwtoyBvjWyKJYDYsyzy+23iBV7NKTwdk+LRY= +github.com/depcheck-test/depcheck-test v0.0.0-20220607135614-199033aaa936/go.mod h1:ttKPnOepYt4LLzD+loXQ1rT6EmpyIYHro7TAJuIIlHo= github.com/dgraph-io/badger/v3 v3.2103.5 h1:ylPa6qzbjYRQMU6jokoj4wzcaweHylt//CH0AKt0akg= +github.com/dgraph-io/badger/v3 v3.2103.5/go.mod h1:4MPiseMeDQ3FNCYwRbbcBOGJLf5jsE0PPFzRiKjtcdw= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/digitorus/pkcs7 v0.0.0-20230713084857-e76b763bdc49/go.mod h1:SKVExuS+vpu2l9IoOc0RwqE7NYnb0JlcFHFnEJkVDzc= @@ -252,6 +270,7 @@ github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/ github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/cli v24.0.7+incompatible h1:wa/nIwYFW7BVTGa7SWPVyyXU9lgORqUb1xfI36MSkFg= github.com/docker/cli v24.0.7+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= @@ -272,13 +291,19 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/foxcpp/go-mockdns v1.0.0 h1:7jBqxd3WDWwi/6WhDvacvH1XsN3rOLXyHM1uhvIx6FI= +github.com/foxcpp/go-mockdns v1.0.0/go.mod h1:lgRN6+KxQBawyIghpnl5CezHFGS9VLzvtVlwxvzXTQ4= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= @@ -310,6 +335,7 @@ github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ4 github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= +github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= github.com/go-openapi/analysis v0.21.4 h1:ZDFLvSNxpDaomuCueM0BlSXxpANBlFYiBvr+GXrvIHc= github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo= @@ -350,6 +376,7 @@ github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+ github.com/go-openapi/validate v0.22.1 h1:G+c2ub6q47kfX1sOBLwIQwzBVt8qmOAARyo/9Fqs9NU= github.com/go-openapi/validate v0.22.1/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= @@ -357,10 +384,13 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91 github.com/go-playground/validator/v10 v10.15.5 h1:LEBecTWb/1j5TNY1YYG2RcOUN3R7NLylN+x8TTueE24= github.com/go-playground/validator/v10 v10.15.5/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-rod/rod v0.114.4 h1:FpkNFukjCuZLwnoLs+S9aCL95o/EMec6M+41UmvQay8= +github.com/go-rod/rod v0.114.4/go.mod h1:aiedSEFg5DwG/fnNbUOTPMTTWX3MRj6vIs/a684Mthw= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= +github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= @@ -388,6 +418,7 @@ github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY9 github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= +github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= @@ -437,6 +468,7 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/certificate-transparency-go v1.1.7 h1:IASD+NtgSTJLPdzkthwvAG1ZVbF2WtFg4IvoA68XGSw= github.com/google/certificate-transparency-go v1.1.7/go.mod h1:FSSBo8fyMVgqptbfF6j5p/XNdgQftAhSmXcIxV9iphE= github.com/google/flatbuffers v2.0.8+incompatible h1:ivUb1cGomAB101ZM1T0nOiWz9pSrTMoa9+EiY7igmkM= +github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 h1:0VpGH+cDhbDtdcweoyCVsF3fhN8kejK6rFe/2FFX2nU= github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49/go.mod h1:BkkQ4L1KS1xMt2aWSPStnn55ChGC0DPOn2FQYj+f25M= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -477,19 +509,25 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b h1:RMpPgZTSApbPf7xaVel+QkoGPRLFLrwFO89uDUHEGf0= +github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/tink/go v1.7.0 h1:6Eox8zONGebBFcCBqkVmt60LaWZa6xg1cl/DwAh/J1w= +github.com/google/tink/go v1.7.0/go.mod h1:GAUOd+QE3pgj9q8VKIGTCP33c/B7eb4NhxLcgTJZStM= github.com/google/trillian v1.5.3 h1:3ioA5p09qz+U9/t2riklZtaQdZclaStp0/eQNfewNRg= +github.com/google/trillian v1.5.3/go.mod h1:p4tcg7eBr7aT6DxrAoILpc3uXNfcuAvZSnQKonVg+Eo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= +github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -497,24 +535,34 @@ github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7 h1:UpiO20jno/eV1eVZcxqWnUohyKRe1g8FPV/xH1s/2qs= +github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 h1:kes8mmyCpxJsI7FTwtzRqEy9CdjCtrXrXGuOpxEA7Ts= +github.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4= github.com/hashicorp/go-sockaddr v1.0.5 h1:dvk7TIXCZpmfOlM+9mlcrWmWjw/wlKT+VDq2wMvfPJU= +github.com/hashicorp/go-sockaddr v1.0.5/go.mod h1:uoUUmtwU7n9Dv3O4SNLeFvg0SxQ3lyjsj6+CCykpaxI= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= github.com/hashicorp/vault/api v1.10.0 h1:/US7sIjWN6Imp4o/Rj1Ce2Nr5bki/AXi9vAW3p2tOJQ= +github.com/hashicorp/vault/api v1.10.0/go.mod h1:jo5Y/ET+hNyz+JnKDt8XLAdKs+AM0G5W0Vp1IrFI8N8= github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef h1:A9HsByNhogrvm9cWb28sjiS3i7tcKCkflWFEkHfuAgM= +github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -528,12 +576,14 @@ github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLf github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267 h1:TMtDYDHKYY15rFihtRfck/bfFqNfvcabqvXAFQfAUpY= github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267/go.mod h1:h1nSAbGFqGVzn6Jyl1R/iCcBUHN4g+gW1u9CoBTrb9E= github.com/jellydator/ttlcache/v3 v3.1.0 h1:0gPFG0IHHP6xyUyXq+JaD8fwkDCqgqwohXNJBcYE71g= +github.com/jellydator/ttlcache/v3 v3.1.0/go.mod h1:hi7MGFdMAwZna5n2tuvh63DvFLzVKySzCVW6+0gA2n4= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmhodges/clock v1.2.0 h1:eq4kys+NI0PLngzaHEe7AmPT90XMGIEySD1JfV1PDIs= +github.com/jmhodges/clock v1.2.0/go.mod h1:qKjhA7x7u/lQpPB1XAqX1b1lCI/w3/fNuYpI/ZjLynI= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= @@ -557,6 +607,7 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -577,11 +628,14 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/miekg/dns v1.1.55 h1:GoQ4hpsj0nFLYe+bWiCToyrBEJXkQfOOIvFGFy0lEgo= +github.com/miekg/dns v1.1.55/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= github.com/miekg/pkcs11 v1.0.3-0.20190429190417-a667d056470f/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU= github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= @@ -623,11 +677,13 @@ github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q= +github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU= +github.com/onsi/gomega v1.27.7/go.mod h1:1p8OOlwo2iUUDsHnOrjE5UKYJ+e3W8eQ3qSlRahPmr4= github.com/open-policy-agent/cert-controller v0.8.0 h1:pao3WCLsKGz5dSWSlNUFrNFQdXtVTQ3lVDgk2IelH34= github.com/open-policy-agent/cert-controller v0.8.0/go.mod h1:alotCQRwX4M6VEwEgO53FB6nGLSlvah6L0pWxSRslIk= github.com/open-policy-agent/frameworks/constraint v0.0.0-20230411224310-3f237e2710fa h1:1r6gnPhbsswSIem/Fa11fKo/MhjijzvqSxWIu+3HQeY= @@ -640,6 +696,9 @@ github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/ github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/owenrumney/go-sarif v1.1.1/go.mod h1:dNDiPlF04ESR/6fHlPyq7gHKmrM0sHUvAGjsoh8ZH0U= +github.com/owenrumney/go-sarif/v2 v2.3.0 h1:wP5yEpI53zr0v5cBmagXzLbHZp9Oylyo3AJDpfLBITs= +github.com/owenrumney/go-sarif/v2 v2.3.0/go.mod h1:MSqMMx9WqlBSY7pXoOZWgEsVB4FDNfhcaXDA1j6Sr+w= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= @@ -671,8 +730,10 @@ github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= +github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= @@ -680,6 +741,7 @@ github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWR github.com/sassoftware/relic v7.2.1+incompatible h1:Pwyh1F3I0r4clFJXkSI8bOyJINGqpgjJU3DYAZeI05A= github.com/sassoftware/relic v7.2.1+incompatible/go.mod h1:CWfAxv73/iLZ17rbyhIEq3K9hs5w6FpNMdUT//qR+zk= github.com/sassoftware/relic/v7 v7.6.1 h1:O5s8ewCgq5QYNpv45dK4u6IpBmDM9RIcsbf/G1uXepQ= +github.com/sassoftware/relic/v7 v7.6.1/go.mod h1:NxwtWxWxlUa9as2qZi635Ye6bBT/tGnMALLq7dSfOOU= github.com/secure-systems-lab/go-securesystemslib v0.7.0 h1:OwvJ5jQf9LnIAS83waAjPbcMsODrTQUpJ02eNLUoxBg= github.com/secure-systems-lab/go-securesystemslib v0.7.0/go.mod h1:/2gYnlnHVQ6xeGtfIqFy7Do03K4cdCY0A/GlJLDKLHI= github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c= @@ -695,9 +757,13 @@ github.com/sigstore/rekor v1.3.3/go.mod h1:GO3udo2Xiu3/Uz4/U3vgjVq7w5Yq7eSpAFP1z github.com/sigstore/sigstore v1.7.5 h1:ij55dBhLwjICmLTBJZm7SqoQLdsu/oowDanACcJNs48= github.com/sigstore/sigstore v1.7.5/go.mod h1:9OCmYWhzuq/G4e1cy9m297tuMRJ1LExyrXY3ZC3Zt/s= github.com/sigstore/sigstore/pkg/signature/kms/aws v1.7.5 h1:ilufPp36exfpivctI3ElU4ZTckP3eVu6RxYebBb6u+M= +github.com/sigstore/sigstore/pkg/signature/kms/aws v1.7.5/go.mod h1:121n8nBnuXbcI6K0hIBo/0EMYiyXqGVzbIYd0rV0ZWw= github.com/sigstore/sigstore/pkg/signature/kms/azure v1.7.5 h1:gLdNJJo+xMf7+IeFRlyA/Pjavndo9rivmf5ioYeuPmM= +github.com/sigstore/sigstore/pkg/signature/kms/azure v1.7.5/go.mod h1:9nJQA5YgWsXrwjrVoVaO8JfTI/TpPF+oAkpkNKZu6lo= github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.7.5 h1:Ku3MD55VXR7+uezCS4LOY0+y2EZFlGCGFyzl+ZSoPyo= +github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.7.5/go.mod h1:FsNzxmFGATZS5ynkJLLXm9g2zHD0Xw23iJs7lM/asPo= github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.7.5 h1:yWNBuL52Je3ukUGry1qwg00ujJF2UFWShzXFIAtmxZU= +github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.7.5/go.mod h1:EI9vDWVGG8fQU9aFMY7Bd204xJiqmXcDMSkFifCf16Q= github.com/sigstore/timestamp-authority v1.2.0 h1:Ffk10QsHxu6aLwySQ7WuaoWkD63QkmcKtozlEFot/VI= github.com/sigstore/timestamp-authority v1.2.0/go.mod h1:ojKaftH78Ovfow9DzuNl5WgTCEYSa4m5622UkKDHRXc= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -709,6 +775,7 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA= github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262 h1:unQFBIznI+VYD1/1fApl1A+9VcBk+9dcqGfnePY87LY= +github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262/go.mod h1:MyOHs9Po2fbM1LHej6sBUT8ozbxmMOFG+E+rx/GSGuc= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= @@ -769,6 +836,8 @@ github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinC github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk= github.com/veraison/go-cose v1.2.0 h1:Ok0Hr3GMAf8K/1NB4sV65QGgCiukG1w1QD+H5tmt0Ow= github.com/veraison/go-cose v1.2.0/go.mod h1:7ziE85vSq4ScFTg6wyoMXjucIGOf4JkFEZi/an96Ct4= +github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= +github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xanzy/go-gitlab v0.93.2 h1:kNNf3BYNYn/Zkig0B89fma12l36VLcYSGu7OnaRlRDg= @@ -793,10 +862,15 @@ github.com/yashtewari/glob-intersection v0.2.0 h1:8iuHdN88yYuCzCdjt0gDe+6bAhUwBe github.com/yashtewari/glob-intersection v0.2.0/go.mod h1:LK7pIC3piUjovexikBbJ26Yml7g8xa5bsjfx2v1fwok= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/ysmood/fetchup v0.2.3 h1:ulX+SonA0Vma5zUFXtv52Kzip/xe7aj4vqT5AJwQ+ZQ= +github.com/ysmood/fetchup v0.2.3/go.mod h1:xhibcRKziSvol0H1/pj33dnKrYyI2ebIvz5cOOkYGns= github.com/ysmood/goob v0.4.0 h1:HsxXhyLBeGzWXnqVKtmT9qM7EuVs/XOgkX7T6r1o1AQ= +github.com/ysmood/goob v0.4.0/go.mod h1:u6yx7ZhS4Exf2MwciFr6nIM8knHQIE22lFpWHnfql18= github.com/ysmood/got v0.34.1 h1:IrV2uWLs45VXNvZqhJ6g2nIhY+pgIG1CUoOcqfXFl1s= +github.com/ysmood/got v0.34.1/go.mod h1:yddyjq/PmAf08RMLSwDjPyCvHvYed+WjHnQxpH851LM= github.com/ysmood/gson v0.7.3 h1:QFkWbTH8MxyUTKPkVWAENJhxqdBa4lYTQWqZCiLG6kE= +github.com/ysmood/gson v0.7.3/go.mod h1:3Kzs5zDl21g5F/BlLTNcuAGAYLKt2lV5G8D1zF3RNmg= github.com/ysmood/leakless v0.8.0 h1:BzLrVoiwxikpgEQR0Lk8NyBN5Cit2b1z+u0mgL4ZJak= +github.com/ysmood/leakless v0.8.0/go.mod h1:R8iAXPRaG97QJwqxs74RdwzcRHT1SWCGTNqY8q0JvMQ= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.30/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -804,6 +878,8 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zalando/go-keyring v0.2.2 h1:f0xmpYiSrHtSNAVgwip93Cg8tuF45HJM6rHq/A5RI/4= +github.com/zalando/go-keyring v0.2.2/go.mod h1:sI3evg9Wvpw3+n4SqplGSJUMwtDeROfD4nsFz4z9PG0= +github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= @@ -816,11 +892,15 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q= go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 h1:3d+S281UTjM+AbF31XSOYn1qXn3BgIdWl8HNEpx08Jk= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0/go.mod h1:0+KuTDyKL4gjKCF75pHOX4wuzYDUZYfAQdSu43o+Z2I= go.opentelemetry.io/otel/exporters/prometheus v0.39.0 h1:whAaiHxOatgtKd+w0dOi//1KUxj3KoPINZdtDaDj3IA= go.opentelemetry.io/otel/exporters/prometheus v0.39.0/go.mod h1:4jo5Q4CROlCpSPsXLhymi+LYrDXd2ObU5wbKayfZs7Y= go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= @@ -832,11 +912,13 @@ go.opentelemetry.io/otel/sdk/metric v0.39.0/go.mod h1:piDIRgjcK7u0HCL5pCA4e74qpK go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= +go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.step.sm/crypto v0.36.1 h1:hrHIc0qVcOowJB/r1SgPGu10d59onUw3czYeMLJluBc= go.step.sm/crypto v0.36.1/go.mod h1:3b2wJhYMWzHpc8ke4CvTXOehx/FK5acd8rwXt+c8g68= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= @@ -1138,6 +1220,7 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1165,6 +1248,7 @@ google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.149.0 h1:b2CqT6kG+zqJIVKRQ3ELJVLN1PwHZ6DJ3dW8yl82rgY= +google.golang.org/api v0.149.0/go.mod h1:Mwn1B7JTXrzXtnvmzQE2BD6bYZQ8DShKZDZbeN9I7qI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1211,7 +1295,9 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5qmsh7Y+XXwCbvadxxZ0YY6mTdrVA= +google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k= +google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1278,6 +1364,7 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= +gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1298,6 +1385,7 @@ k8s.io/component-base v0.27.7/go.mod h1:YGjlCVL1oeKvG3HSciyPHFh+LCjIEqsxz4BDR3cf k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-aggregator v0.27.2 h1:jfHoPip+qN/fn3OcrYs8/xMuVYvkJHKo0H0DYciqdns= +k8s.io/kube-aggregator v0.27.2/go.mod h1:mwrTt4ESjQ7A6847biwohgZWn8P/KzSFHegEScbSGY4= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= @@ -1319,3 +1407,4 @@ sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= software.sslmate.com/src/go-pkcs12 v0.2.0 h1:nlFkj7bTysH6VkC4fGphtjXRbezREPgrHuJG20hBGPE= +software.sslmate.com/src/go-pkcs12 v0.2.0/go.mod h1:23rNcYsMabIc1otwLpTkCCPwUq6kQsTyowttG/as0kQ= diff --git a/httpserver/Dockerfile b/httpserver/Dockerfile index 7d20d75fe2..abdfeaf98e 100644 --- a/httpserver/Dockerfile +++ b/httpserver/Dockerfile @@ -13,6 +13,7 @@ ARG build_sbom ARG build_cosign ARG build_licensechecker ARG build_schemavalidator +ARG build_vulnerabilityreport ENV CGO_ENABLED=0 \ GOOS=${TARGETOS} \ @@ -30,6 +31,7 @@ RUN if [ "$build_sbom" = "true" ]; then go build -o /app/out/plugins/ /app/plugi RUN if [ "$build_cosign" = "true" ]; then go build -o /app/out/plugins/ /app/plugins/verifier/cosign; fi RUN if [ "$build_licensechecker" = "true" ]; then go build -o /app/out/plugins/ /app/plugins/verifier/licensechecker; fi RUN if [ "$build_schemavalidator" = "true" ]; then go build -o /app/out/plugins/ /app/plugins/verifier/schemavalidator; fi +RUN if [ "$build_vulnerabilityreport" = "true" ]; then go build -o /app/out/plugins/ /app/plugins/verifier/vulnerabilityreport; fi FROM $BASEIMAGE LABEL org.opencontainers.image.source https://github.com/deislabs/ratify diff --git a/library/notation-nested-validation/samples/constraint.yaml b/library/notation-nested-validation/samples/constraint.yaml new file mode 100644 index 0000000000..70953230c5 --- /dev/null +++ b/library/notation-nested-validation/samples/constraint.yaml @@ -0,0 +1,11 @@ +apiVersion: constraints.gatekeeper.sh/v1beta1 +kind: NotationNestedValidation +metadata: + name: notation-nested-constraint +spec: + enforcementAction: deny + match: + kinds: + - apiGroups: [""] + kinds: ["Pod"] + namespaces: ["default"] diff --git a/library/notation-nested-validation/template.yaml b/library/notation-nested-validation/template.yaml new file mode 100644 index 0000000000..6e34ad75a0 --- /dev/null +++ b/library/notation-nested-validation/template.yaml @@ -0,0 +1,80 @@ +apiVersion: templates.gatekeeper.sh/v1beta1 +kind: ConstraintTemplate +metadata: + name: notationnestedvalidation +spec: + crd: + spec: + names: + kind: NotationNestedValidation + validation: + openAPIV3Schema: + type: object + properties: + issuer: + type: string + targets: + - target: admission.k8s.gatekeeper.sh + rego: | + package notationnestedvalidation + import future.keywords.if + + remote_data := response { + images := [img | img = input.review.object.spec.containers[_].image] + images_init := [img | img = input.review.object.spec.initContainers[_].image] + images_ephemeral := [img | img = input.review.object.spec.ephemeralContainers[_].image] + other_images := array.concat(images_init, images_ephemeral) + all_images := array.concat(other_images, images) + response := external_data({"provider": "ratify-provider", "keys": all_images}) + } + + violation[{"msg": msg}] { + general_violation[{"result": msg}] + } + + # Check if there are any system errors + general_violation[{"result": result}] { + err := remote_data.system_error + err != "" + result := sprintf("System error calling external data provider: %s", [err]) + } + # Check if there are errors for any of the images + general_violation[{"result": result}] { + count(remote_data.errors) > 0 + result := sprintf("Error validating one or more images: %s", remote_data.errors) + } + + # Check if the success criteria is true + general_violation[{"result": result}] { + subject_validation := remote_data.responses[_] + subject_result := subject_validation[1] + failed_verify(subject_result) + result := sprintf("Subject failed verification: %s", [subject_validation[0]]) + } + + failed_verify(reports) if { + newReports := {"nestedResults": reports.verifierReports} + has_subject_failed_verify(newReports) + } + + has_subject_failed_verify(nestedReports) if { + [path, value] := walk(nestedReports) + path[count(path) - 1] == "nestedResults" + not notary_signature_pass_verify(value) + } + + notary_signature_pass_verify(nestedReports) if { + count_with_success := notary_signature_signature_count(nestedReports) + count_with_success > 0 + } + + notary_signature_signature_count(nestedReports) := number if { + sigs := [x | + some i + nestedReports[i].isSuccess == true + nestedReports[i].artifactType == "application/vnd.cncf.notary.signature" + x := nestedReports[i].subject + ] + number := count(sigs) + } + \ No newline at end of file diff --git a/library/vulnerability-report-validation/samples/constraint.yaml b/library/vulnerability-report-validation/samples/constraint.yaml new file mode 100644 index 0000000000..6cba3bc088 --- /dev/null +++ b/library/vulnerability-report-validation/samples/constraint.yaml @@ -0,0 +1,11 @@ +apiVersion: constraints.gatekeeper.sh/v1beta1 +kind: VulnerabilityReportValidation +metadata: + name: vulnerability-report-validation-constraint +spec: + enforcementAction: deny + match: + kinds: + - apiGroups: [""] + kinds: ["Pod"] + namespaces: ["default"] \ No newline at end of file diff --git a/library/vulnerability-report-validation/template.yaml b/library/vulnerability-report-validation/template.yaml new file mode 100644 index 0000000000..2cf29accba --- /dev/null +++ b/library/vulnerability-report-validation/template.yaml @@ -0,0 +1,82 @@ +apiVersion: templates.gatekeeper.sh/v1beta1 +kind: ConstraintTemplate +metadata: + name: vulnerabilityreportvalidation +spec: + crd: + spec: + names: + kind: VulnerabilityReportValidation + validation: + openAPIV3Schema: + type: object + properties: + issuer: + type: string + targets: + - target: admission.k8s.gatekeeper.sh + rego: | + package vulnerabilityreportvalidation + + # TODO: add support for custom reason message propagating to user + import future.keywords.if + import future.keywords.in + import future.keywords.every + + default require_signature := false # change to true to require notation signature on vulnerability report + + # Get data from Ratify + remote_data := response { + images := [img | img = input.review.object.spec.containers[_].image] + images_init := [img | img = input.review.object.spec.initContainers[_].image] + images_ephemeral := [img | img = input.review.object.spec.ephemeralContainers[_].image] + other_images := array.concat(images_init, images_ephemeral) + all_images := array.concat(other_images, images) + response := external_data({"provider": "ratify-provider", "keys": all_images}) + } + + violation[{"msg": msg}] { + general_violation[{"result": msg}] + } + + # Check if there are any system errors + general_violation[{"result": result}] { + err := remote_data.system_error + err != "" + result := sprintf("System error calling external data provider: %s", [err]) + } + + # Check if there are errors for any of the images + general_violation[{"result": result}] { + count(remote_data.errors) > 0 + result := sprintf("Error validating one or more images: %s", remote_data.errors) + } + + # Check if the success criteria is true + general_violation[{"result": result}] { + subject_validation := remote_data.responses[_] + subject_result := subject_validation[1] + vuln_results := [res | subject_result.verifierReports[i].name == "vulnerabilityreport"; res := subject_result.verifierReports[i]] + count(vuln_results) > 0 + not process_vuln_reports(vuln_results) + result := sprintf("Subject failed verification: %s", [subject_validation[0]]) + } + + process_vuln_reports(reports) if { + # At least one report must be valid + some vuln_report in reports + vuln_report.isSuccess == true + valid_signatures(vuln_report) + } + + valid_signatures(_) := true { + require_signature == false + } + + valid_signatures(report) := true { + require_signature + count(report.nestedResults) > 0 + some nestedResult in report.nestedResults + nestedResult.artifactType == "application/vnd.cncf.notary.signature" + nestedResult.isSuccess + } \ No newline at end of file diff --git a/plugins/verifier/vulnerabilityreport/schemavalidation/schemas/sarif-2.1.0.json b/plugins/verifier/vulnerabilityreport/schemavalidation/schemas/sarif-2.1.0.json new file mode 100644 index 0000000000..3deb87150c --- /dev/null +++ b/plugins/verifier/vulnerabilityreport/schemavalidation/schemas/sarif-2.1.0.json @@ -0,0 +1,3012 @@ +{ + "$id": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "definitions": { + "address": { + "description": "A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file).", + "additionalProperties": false, + "type": "object", + "properties": { + "absoluteAddress": { + "description": "The address expressed as a byte offset from the start of the addressable region.", + "type": "integer", + "minimum": -1, + "default": -1 + }, + "relativeAddress": { + "description": "The address expressed as a byte offset from the absolute address of the top-most parent object.", + "type": "integer" + }, + "length": { + "description": "The number of bytes in this range of addresses.", + "type": "integer" + }, + "kind": { + "description": "An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', 'segment', 'stack', 'stackFrame', 'table' are well-known values.", + "type": "string" + }, + "name": { + "description": "A name that is associated with the address, e.g., '.text'.", + "type": "string" + }, + "fullyQualifiedName": { + "description": "A human-readable fully qualified name that is associated with the address.", + "type": "string" + }, + "offsetFromParent": { + "description": "The byte offset of this address from the absolute or relative address of the parent object.", + "type": "integer" + }, + "index": { + "description": "The index within run.addresses of the cached object for this address.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "parentIndex": { + "description": "The index within run.addresses of the parent object.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "properties": { + "description": "Key/value pairs that provide additional information about the address.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "artifact": { + "description": "A single artifact. In some cases, this artifact might be nested within another artifact.", + "additionalProperties": false, + "type": "object", + "properties": { + "description": { + "description": "A short description of the artifact.", + "$ref": "#/definitions/message" + }, + "location": { + "description": "The location of the artifact.", + "$ref": "#/definitions/artifactLocation" + }, + "parentIndex": { + "description": "Identifies the index of the immediate parent of the artifact, if this artifact is nested.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "offset": { + "description": "The offset in bytes of the artifact within its containing artifact.", + "type": "integer", + "minimum": 0 + }, + "length": { + "description": "The length of the artifact in bytes.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "roles": { + "description": "The role or roles played by the artifact in the analysis.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "enum": [ + "analysisTarget", + "attachment", + "responseFile", + "resultFile", + "standardStream", + "tracedFile", + "unmodified", + "modified", + "added", + "deleted", + "renamed", + "uncontrolled", + "driver", + "extension", + "translation", + "taxonomy", + "policy", + "referencedOnCommandLine", + "memoryContents", + "directory", + "userSpecifiedConfiguration", + "toolSpecifiedConfiguration", + "debugOutputFile" + ] + } + }, + "mimeType": { + "description": "The MIME type (RFC 2045) of the artifact.", + "type": "string", + "pattern": "[^/]+/.+" + }, + "contents": { + "description": "The contents of the artifact.", + "$ref": "#/definitions/artifactContent" + }, + "encoding": { + "description": "Specifies the encoding for an artifact object that refers to a text file.", + "type": "string" + }, + "sourceLanguage": { + "description": "Specifies the source language for any artifact object that refers to a text file that contains source code.", + "type": "string" + }, + "hashes": { + "description": "A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by the specified hash function.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "lastModifiedTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See \"Date/time properties\" in the SARIF spec for the required format.", + "type": "string", + "format": "date-time" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the artifact.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "artifactChange": { + "description": "A change to a single artifact.", + "additionalProperties": false, + "type": "object", + "properties": { + "artifactLocation": { + "description": "The location of the artifact to change.", + "$ref": "#/definitions/artifactLocation" + }, + "replacements": { + "description": "An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by 'artifactLocation'.", + "type": "array", + "minItems": 1, + "uniqueItems": false, + "items": { + "$ref": "#/definitions/replacement" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the change.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "artifactLocation", + "replacements" + ] + }, + "artifactContent": { + "description": "Represents the contents of an artifact.", + "type": "object", + "additionalProperties": false, + "properties": { + "text": { + "description": "UTF-8-encoded content from a text artifact.", + "type": "string" + }, + "binary": { + "description": "MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding.", + "type": "string" + }, + "rendered": { + "description": "An alternate rendered representation of the artifact (e.g., a decompiled representation of a binary region).", + "$ref": "#/definitions/multiformatMessageString" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the artifact content.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "artifactLocation": { + "description": "Specifies the location of an artifact.", + "additionalProperties": false, + "type": "object", + "properties": { + "uri": { + "description": "A string containing a valid relative or absolute URI.", + "type": "string", + "format": "uri-reference" + }, + "uriBaseId": { + "description": "A string which indirectly specifies the absolute URI with respect to which a relative URI in the \"uri\" property is interpreted.", + "type": "string" + }, + "index": { + "description": "The index within the run artifacts array of the artifact object associated with the artifact location.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "description": { + "description": "A short description of the artifact location.", + "$ref": "#/definitions/message" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the artifact location.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "attachment": { + "description": "An artifact relevant to a result.", + "type": "object", + "additionalProperties": false, + "properties": { + "description": { + "description": "A message describing the role played by the attachment.", + "$ref": "#/definitions/message" + }, + "artifactLocation": { + "description": "The location of the attachment.", + "$ref": "#/definitions/artifactLocation" + }, + "regions": { + "description": "An array of regions of interest within the attachment.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/region" + } + }, + "rectangles": { + "description": "An array of rectangles specifying areas of interest within the image.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/rectangle" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the attachment.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "artifactLocation" + ] + }, + "codeFlow": { + "description": "A set of threadFlows which together describe a pattern of code execution relevant to detecting a result.", + "additionalProperties": false, + "type": "object", + "properties": { + "message": { + "description": "A message relevant to the code flow.", + "$ref": "#/definitions/message" + }, + "threadFlows": { + "description": "An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution.", + "type": "array", + "minItems": 1, + "uniqueItems": false, + "items": { + "$ref": "#/definitions/threadFlow" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the code flow.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "threadFlows" + ] + }, + "configurationOverride": { + "description": "Information about how a specific rule or notification was reconfigured at runtime.", + "type": "object", + "additionalProperties": false, + "properties": { + "configuration": { + "description": "Specifies how the rule or notification was configured during the scan.", + "$ref": "#/definitions/reportingConfiguration" + }, + "descriptor": { + "description": "A reference used to locate the descriptor whose configuration was overridden.", + "$ref": "#/definitions/reportingDescriptorReference" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the configuration override.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "configuration", + "descriptor" + ] + }, + "conversion": { + "description": "Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format.", + "additionalProperties": false, + "type": "object", + "properties": { + "tool": { + "description": "A tool object that describes the converter.", + "$ref": "#/definitions/tool" + }, + "invocation": { + "description": "An invocation object that describes the invocation of the converter.", + "$ref": "#/definitions/invocation" + }, + "analysisToolLogFiles": { + "description": "The locations of the analysis tool's per-run log files.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/artifactLocation" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the conversion.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "tool" + ] + }, + "edge": { + "description": "Represents a directed edge in a graph.", + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "description": "A string that uniquely identifies the edge within its graph.", + "type": "string" + }, + "label": { + "description": "A short description of the edge.", + "$ref": "#/definitions/message" + }, + "sourceNodeId": { + "description": "Identifies the source node (the node at which the edge starts).", + "type": "string" + }, + "targetNodeId": { + "description": "Identifies the target node (the node at which the edge ends).", + "type": "string" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the edge.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "id", + "sourceNodeId", + "targetNodeId" + ] + }, + "edgeTraversal": { + "description": "Represents the traversal of a single edge during a graph traversal.", + "type": "object", + "additionalProperties": false, + "properties": { + "edgeId": { + "description": "Identifies the edge being traversed.", + "type": "string" + }, + "message": { + "description": "A message to display to the user as the edge is traversed.", + "$ref": "#/definitions/message" + }, + "finalState": { + "description": "The values of relevant expressions after the edge has been traversed.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + "stepOverEdgeCount": { + "description": "The number of edge traversals necessary to return from a nested graph.", + "type": "integer", + "minimum": 0 + }, + "properties": { + "description": "Key/value pairs that provide additional information about the edge traversal.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "edgeId" + ] + }, + "exception": { + "description": "Describes a runtime exception encountered during the execution of an analysis tool.", + "type": "object", + "additionalProperties": false, + "properties": { + "kind": { + "type": "string", + "description": "A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal." + }, + "message": { + "description": "A message that describes the exception.", + "type": "string" + }, + "stack": { + "description": "The sequence of function calls leading to the exception.", + "$ref": "#/definitions/stack" + }, + "innerExceptions": { + "description": "An array of exception objects each of which is considered a cause of this exception.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/exception" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the exception.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "externalProperties": { + "description": "The top-level element of an external property file.", + "type": "object", + "additionalProperties": false, + "properties": { + "schema": { + "description": "The URI of the JSON schema corresponding to the version of the external property file format.", + "type": "string", + "format": "uri" + }, + "version": { + "description": "The SARIF format version of this external properties object.", + "enum": [ + "2.1.0" + ] + }, + "guid": { + "description": "A stable, unique identifer for this external properties object, in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "runGuid": { + "description": "A stable, unique identifer for the run associated with this external properties object, in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "conversion": { + "description": "A conversion object that will be merged with a separate run.", + "$ref": "#/definitions/conversion" + }, + "graphs": { + "description": "An array of graph objects that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "default": [], + "uniqueItems": true, + "items": { + "$ref": "#/definitions/graph" + } + }, + "externalizedProperties": { + "description": "Key/value pairs that provide additional information that will be merged with a separate run.", + "$ref": "#/definitions/propertyBag" + }, + "artifacts": { + "description": "An array of artifact objects that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/artifact" + } + }, + "invocations": { + "description": "Describes the invocation of the analysis tool that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/invocation" + } + }, + "logicalLocations": { + "description": "An array of logical locations such as namespaces, types or functions that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/logicalLocation" + } + }, + "threadFlowLocations": { + "description": "An array of threadFlowLocation objects that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/threadFlowLocation" + } + }, + "results": { + "description": "An array of result objects that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/result" + } + }, + "taxonomies": { + "description": "Tool taxonomies that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + "driver": { + "description": "The analysis tool object that will be merged with a separate run.", + "$ref": "#/definitions/toolComponent" + }, + "extensions": { + "description": "Tool extensions that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + "policies": { + "description": "Tool policies that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + "translations": { + "description": "Tool translations that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + "addresses": { + "description": "Addresses that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/address" + } + }, + "webRequests": { + "description": "Requests that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/webRequest" + } + }, + "webResponses": { + "description": "Responses that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/webResponse" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the external properties.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "externalPropertyFileReference": { + "description": "Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run.", + "type": "object", + "additionalProperties": false, + "properties": { + "location": { + "description": "The location of the external property file.", + "$ref": "#/definitions/artifactLocation" + }, + "guid": { + "description": "A stable, unique identifer for the external property file in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "itemCount": { + "description": "A non-negative integer specifying the number of items contained in the external property file.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "properties": { + "description": "Key/value pairs that provide additional information about the external property file.", + "$ref": "#/definitions/propertyBag" + } + }, + "anyOf": [ + { + "required": [ + "location" + ] + }, + { + "required": [ + "guid" + ] + } + ] + }, + "externalPropertyFileReferences": { + "description": "References to external property files that should be inlined with the content of a root log file.", + "additionalProperties": false, + "type": "object", + "properties": { + "conversion": { + "description": "An external property file containing a run.conversion object to be merged with the root log file.", + "$ref": "#/definitions/externalPropertyFileReference" + }, + "graphs": { + "description": "An array of external property files containing a run.graphs object to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + "externalizedProperties": { + "description": "An external property file containing a run.properties object to be merged with the root log file.", + "$ref": "#/definitions/externalPropertyFileReference" + }, + "artifacts": { + "description": "An array of external property files containing run.artifacts arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + "invocations": { + "description": "An array of external property files containing run.invocations arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + "logicalLocations": { + "description": "An array of external property files containing run.logicalLocations arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + "threadFlowLocations": { + "description": "An array of external property files containing run.threadFlowLocations arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + "results": { + "description": "An array of external property files containing run.results arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + "taxonomies": { + "description": "An array of external property files containing run.taxonomies arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + "addresses": { + "description": "An array of external property files containing run.addresses arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + "driver": { + "description": "An external property file containing a run.driver object to be merged with the root log file.", + "$ref": "#/definitions/externalPropertyFileReference" + }, + "extensions": { + "description": "An array of external property files containing run.extensions arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + "policies": { + "description": "An array of external property files containing run.policies arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + "translations": { + "description": "An array of external property files containing run.translations arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + "webRequests": { + "description": "An array of external property files containing run.requests arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + "webResponses": { + "description": "An array of external property files containing run.responses arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the external property files.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "fix": { + "description": "A proposed fix for the problem represented by a result object. A fix specifies a set of artifacts to modify. For each artifact, it specifies a set of bytes to remove, and provides a set of new bytes to replace them.", + "additionalProperties": false, + "type": "object", + "properties": { + "description": { + "description": "A message that describes the proposed fix, enabling viewers to present the proposed change to an end user.", + "$ref": "#/definitions/message" + }, + "artifactChanges": { + "description": "One or more artifact changes that comprise a fix for a result.", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/artifactChange" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the fix.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "artifactChanges" + ] + }, + "graph": { + "description": "A network of nodes and directed edges that describes some aspect of the structure of the code (for example, a call graph).", + "type": "object", + "additionalProperties": false, + "properties": { + "description": { + "description": "A description of the graph.", + "$ref": "#/definitions/message" + }, + "nodes": { + "description": "An array of node objects representing the nodes of the graph.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/node" + } + }, + "edges": { + "description": "An array of edge objects representing the edges of the graph.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/edge" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the graph.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "graphTraversal": { + "description": "Represents a path through a graph.", + "type": "object", + "additionalProperties": false, + "properties": { + "runGraphIndex": { + "description": "The index within the run.graphs to be associated with the result.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "resultGraphIndex": { + "description": "The index within the result.graphs to be associated with the result.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "description": { + "description": "A description of this graph traversal.", + "$ref": "#/definitions/message" + }, + "initialState": { + "description": "Values of relevant expressions at the start of the graph traversal that may change during graph traversal.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + "immutableState": { + "description": "Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + "edgeTraversals": { + "description": "The sequences of edges traversed by this graph traversal.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/edgeTraversal" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the graph traversal.", + "$ref": "#/definitions/propertyBag" + } + }, + "oneOf": [ + { + "required": [ + "runGraphIndex" + ] + }, + { + "required": [ + "resultGraphIndex" + ] + } + ] + }, + "invocation": { + "description": "The runtime environment of the analysis tool run.", + "additionalProperties": false, + "type": "object", + "properties": { + "commandLine": { + "description": "The command line used to invoke the tool.", + "type": "string" + }, + "arguments": { + "description": "An array of strings, containing in order the command line arguments passed to the tool from the operating system.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "items": { + "type": "string" + } + }, + "responseFiles": { + "description": "The locations of any response files specified on the tool's command line.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/artifactLocation" + } + }, + "startTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the invocation started. See \"Date/time properties\" in the SARIF spec for the required format.", + "type": "string", + "format": "date-time" + }, + "endTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the invocation ended. See \"Date/time properties\" in the SARIF spec for the required format.", + "type": "string", + "format": "date-time" + }, + "exitCode": { + "description": "The process exit code.", + "type": "integer" + }, + "ruleConfigurationOverrides": { + "description": "An array of configurationOverride objects that describe rules related runtime overrides.", + "type": "array", + "minItems": 0, + "default": [], + "uniqueItems": true, + "items": { + "$ref": "#/definitions/configurationOverride" + } + }, + "notificationConfigurationOverrides": { + "description": "An array of configurationOverride objects that describe notifications related runtime overrides.", + "type": "array", + "minItems": 0, + "default": [], + "uniqueItems": true, + "items": { + "$ref": "#/definitions/configurationOverride" + } + }, + "toolExecutionNotifications": { + "description": "A list of runtime conditions detected by the tool during the analysis.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/notification" + } + }, + "toolConfigurationNotifications": { + "description": "A list of conditions detected by the tool that are relevant to the tool's configuration.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/notification" + } + }, + "exitCodeDescription": { + "description": "The reason for the process exit.", + "type": "string" + }, + "exitSignalName": { + "description": "The name of the signal that caused the process to exit.", + "type": "string" + }, + "exitSignalNumber": { + "description": "The numeric value of the signal that caused the process to exit.", + "type": "integer" + }, + "processStartFailureMessage": { + "description": "The reason given by the operating system that the process failed to start.", + "type": "string" + }, + "executionSuccessful": { + "description": "Specifies whether the tool's execution completed successfully.", + "type": "boolean" + }, + "machine": { + "description": "The machine on which the invocation occurred.", + "type": "string" + }, + "account": { + "description": "The account under which the invocation occurred.", + "type": "string" + }, + "processId": { + "description": "The id of the process in which the invocation occurred.", + "type": "integer" + }, + "executableLocation": { + "description": "An absolute URI specifying the location of the executable that was invoked.", + "$ref": "#/definitions/artifactLocation" + }, + "workingDirectory": { + "description": "The working directory for the invocation.", + "$ref": "#/definitions/artifactLocation" + }, + "environmentVariables": { + "description": "The environment variables associated with the analysis tool process, expressed as key/value pairs.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "stdin": { + "description": "A file containing the standard input stream to the process that was invoked.", + "$ref": "#/definitions/artifactLocation" + }, + "stdout": { + "description": "A file containing the standard output stream from the process that was invoked.", + "$ref": "#/definitions/artifactLocation" + }, + "stderr": { + "description": "A file containing the standard error stream from the process that was invoked.", + "$ref": "#/definitions/artifactLocation" + }, + "stdoutStderr": { + "description": "A file containing the interleaved standard output and standard error stream from the process that was invoked.", + "$ref": "#/definitions/artifactLocation" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the invocation.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "executionSuccessful" + ] + }, + "location": { + "description": "A location within a programming artifact.", + "additionalProperties": false, + "type": "object", + "properties": { + "id": { + "description": "Value that distinguishes this location from all other locations within a single result object.", + "type": "integer", + "minimum": -1, + "default": -1 + }, + "physicalLocation": { + "description": "Identifies the artifact and region.", + "$ref": "#/definitions/physicalLocation" + }, + "logicalLocations": { + "description": "The logical locations associated with the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/logicalLocation" + } + }, + "message": { + "description": "A message relevant to the location.", + "$ref": "#/definitions/message" + }, + "annotations": { + "description": "A set of regions relevant to the location.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/region" + } + }, + "relationships": { + "description": "An array of objects that describe relationships between this location and others.", + "type": "array", + "default": [], + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/locationRelationship" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the location.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "locationRelationship": { + "description": "Information about the relation of one location to another.", + "type": "object", + "additionalProperties": false, + "properties": { + "target": { + "description": "A reference to the related location.", + "type": "integer", + "minimum": 0 + }, + "kinds": { + "description": "A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'.", + "type": "array", + "default": [ + "relevant" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "description": { + "description": "A description of the location relationship.", + "$ref": "#/definitions/message" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the location relationship.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "target" + ] + }, + "logicalLocation": { + "description": "A logical location of a construct that produced a result.", + "additionalProperties": false, + "type": "object", + "properties": { + "name": { + "description": "Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method.", + "type": "string" + }, + "index": { + "description": "The index within the logical locations array.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "fullyQualifiedName": { + "description": "The human-readable fully qualified name of the logical location.", + "type": "string" + }, + "decoratedName": { + "description": "The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name.", + "type": "string" + }, + "parentIndex": { + "description": "Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "kind": { + "description": "The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those accurately describe the construct.", + "type": "string" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the logical location.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "message": { + "description": "Encapsulates a message intended to be read by the end user.", + "type": "object", + "additionalProperties": false, + "properties": { + "text": { + "description": "A plain text message string.", + "type": "string" + }, + "markdown": { + "description": "A Markdown message string.", + "type": "string" + }, + "id": { + "description": "The identifier for this message.", + "type": "string" + }, + "arguments": { + "description": "An array of strings to substitute into the message string.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "type": "string" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the message.", + "$ref": "#/definitions/propertyBag" + } + }, + "anyOf": [ + { + "required": [ + "text" + ] + }, + { + "required": [ + "id" + ] + } + ] + }, + "multiformatMessageString": { + "description": "A message string or message format string rendered in multiple formats.", + "type": "object", + "additionalProperties": false, + "properties": { + "text": { + "description": "A plain text message string or format string.", + "type": "string" + }, + "markdown": { + "description": "A Markdown message string or format string.", + "type": "string" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the message.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "text" + ] + }, + "node": { + "description": "Represents a node in a graph.", + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "description": "A string that uniquely identifies the node within its graph.", + "type": "string" + }, + "label": { + "description": "A short description of the node.", + "$ref": "#/definitions/message" + }, + "location": { + "description": "A code location associated with the node.", + "$ref": "#/definitions/location" + }, + "children": { + "description": "Array of child nodes.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/node" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the node.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "id" + ] + }, + "notification": { + "description": "Describes a condition relevant to the tool itself, as opposed to being relevant to a target being analyzed by the tool.", + "type": "object", + "additionalProperties": false, + "properties": { + "locations": { + "description": "The locations relevant to this notification.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/location" + } + }, + "message": { + "description": "A message that describes the condition that was encountered.", + "$ref": "#/definitions/message" + }, + "level": { + "description": "A value specifying the severity level of the notification.", + "default": "warning", + "enum": [ + "none", + "note", + "warning", + "error" + ] + }, + "threadId": { + "description": "The thread identifier of the code that generated the notification.", + "type": "integer" + }, + "timeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the analysis tool generated the notification.", + "type": "string", + "format": "date-time" + }, + "exception": { + "description": "The runtime exception, if any, relevant to this notification.", + "$ref": "#/definitions/exception" + }, + "descriptor": { + "description": "A reference used to locate the descriptor relevant to this notification.", + "$ref": "#/definitions/reportingDescriptorReference" + }, + "associatedRule": { + "description": "A reference used to locate the rule descriptor associated with this notification.", + "$ref": "#/definitions/reportingDescriptorReference" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the notification.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "message" + ] + }, + "physicalLocation": { + "description": "A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.", + "additionalProperties": false, + "type": "object", + "properties": { + "address": { + "description": "The address of the location.", + "$ref": "#/definitions/address" + }, + "artifactLocation": { + "description": "The location of the artifact.", + "$ref": "#/definitions/artifactLocation" + }, + "region": { + "description": "Specifies a portion of the artifact.", + "$ref": "#/definitions/region" + }, + "contextRegion": { + "description": "Specifies a portion of the artifact that encloses the region. Allows a viewer to display additional context around the region.", + "$ref": "#/definitions/region" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the physical location.", + "$ref": "#/definitions/propertyBag" + } + }, + "anyOf": [ + { + "required": [ + "address" + ] + }, + { + "required": [ + "artifactLocation" + ] + } + ] + }, + "propertyBag": { + "description": "Key/value pairs that provide additional information about the object.", + "type": "object", + "additionalProperties": true, + "properties": { + "tags": { + "description": "A set of distinct strings that provide additional information.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "type": "string" + } + } + } + }, + "rectangle": { + "description": "An area within an image.", + "additionalProperties": false, + "type": "object", + "properties": { + "top": { + "description": "The Y coordinate of the top edge of the rectangle, measured in the image's natural units.", + "type": "number" + }, + "left": { + "description": "The X coordinate of the left edge of the rectangle, measured in the image's natural units.", + "type": "number" + }, + "bottom": { + "description": "The Y coordinate of the bottom edge of the rectangle, measured in the image's natural units.", + "type": "number" + }, + "right": { + "description": "The X coordinate of the right edge of the rectangle, measured in the image's natural units.", + "type": "number" + }, + "message": { + "description": "A message relevant to the rectangle.", + "$ref": "#/definitions/message" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the rectangle.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "region": { + "description": "A region within an artifact where a result was detected.", + "additionalProperties": false, + "type": "object", + "properties": { + "startLine": { + "description": "The line number of the first character in the region.", + "type": "integer", + "minimum": 1 + }, + "startColumn": { + "description": "The column number of the first character in the region.", + "type": "integer", + "minimum": 1 + }, + "endLine": { + "description": "The line number of the last character in the region.", + "type": "integer", + "minimum": 1 + }, + "endColumn": { + "description": "The column number of the character following the end of the region.", + "type": "integer", + "minimum": 1 + }, + "charOffset": { + "description": "The zero-based offset from the beginning of the artifact of the first character in the region.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "charLength": { + "description": "The length of the region in characters.", + "type": "integer", + "minimum": 0 + }, + "byteOffset": { + "description": "The zero-based offset from the beginning of the artifact of the first byte in the region.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "byteLength": { + "description": "The length of the region in bytes.", + "type": "integer", + "minimum": 0 + }, + "snippet": { + "description": "The portion of the artifact contents within the specified region.", + "$ref": "#/definitions/artifactContent" + }, + "message": { + "description": "A message relevant to the region.", + "$ref": "#/definitions/message" + }, + "sourceLanguage": { + "description": "Specifies the source language, if any, of the portion of the artifact specified by the region object.", + "type": "string" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the region.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "replacement": { + "description": "The replacement of a single region of an artifact.", + "additionalProperties": false, + "type": "object", + "properties": { + "deletedRegion": { + "description": "The region of the artifact to delete.", + "$ref": "#/definitions/region" + }, + "insertedContent": { + "description": "The content to insert at the location specified by the 'deletedRegion' property.", + "$ref": "#/definitions/artifactContent" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the replacement.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "deletedRegion" + ] + }, + "reportingDescriptor": { + "description": "Metadata that describes a specific report produced by the tool, as part of the analysis it provides or its runtime reporting.", + "additionalProperties": false, + "type": "object", + "properties": { + "id": { + "description": "A stable, opaque identifier for the report.", + "type": "string" + }, + "deprecatedIds": { + "description": "An array of stable, opaque identifiers by which this report was known in some previous version of the analysis tool.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "guid": { + "description": "A unique identifer for the reporting descriptor in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "deprecatedGuids": { + "description": "An array of unique identifies in the form of a GUID by which this report was known in some previous version of the analysis tool.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + } + }, + "name": { + "description": "A report identifier that is understandable to an end user.", + "type": "string" + }, + "deprecatedNames": { + "description": "An array of readable identifiers by which this report was known in some previous version of the analysis tool.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "shortDescription": { + "description": "A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of text.", + "$ref": "#/definitions/multiformatMessageString" + }, + "fullDescription": { + "description": "A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the result.", + "$ref": "#/definitions/multiformatMessageString" + }, + "messageStrings": { + "description": "A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + "defaultConfiguration": { + "description": "Default reporting configuration information.", + "$ref": "#/definitions/reportingConfiguration" + }, + "helpUri": { + "description": "A URI where the primary documentation for the report can be found.", + "type": "string", + "format": "uri" + }, + "help": { + "description": "Provides the primary documentation for the report, useful when there is no online documentation.", + "$ref": "#/definitions/multiformatMessageString" + }, + "relationships": { + "description": "An array of objects that describe relationships between this reporting descriptor and others.", + "type": "array", + "default": [], + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/reportingDescriptorRelationship" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the report.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "id" + ] + }, + "reportingConfiguration": { + "description": "Information about a rule or notification that can be configured at runtime.", + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "description": "Specifies whether the report may be produced during the scan.", + "type": "boolean", + "default": true + }, + "level": { + "description": "Specifies the failure level for the report.", + "default": "warning", + "enum": [ + "none", + "note", + "warning", + "error" + ] + }, + "rank": { + "description": "Specifies the relative priority of the report. Used for analysis output only.", + "type": "number", + "default": -1, + "minimum": -1, + "maximum": 100 + }, + "parameters": { + "description": "Contains configuration information specific to a report.", + "$ref": "#/definitions/propertyBag" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the reporting configuration.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "reportingDescriptorReference": { + "description": "Information about how to locate a relevant reporting descriptor.", + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "description": "The id of the descriptor.", + "type": "string" + }, + "index": { + "description": "The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "guid": { + "description": "A guid that uniquely identifies the descriptor.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "toolComponent": { + "description": "A reference used to locate the toolComponent associated with the descriptor.", + "$ref": "#/definitions/toolComponentReference" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the reporting descriptor reference.", + "$ref": "#/definitions/propertyBag" + } + }, + "anyOf": [ + { + "required": [ + "index" + ] + }, + { + "required": [ + "guid" + ] + }, + { + "required": [ + "id" + ] + } + ] + }, + "reportingDescriptorRelationship": { + "description": "Information about the relation of one reporting descriptor to another.", + "type": "object", + "additionalProperties": false, + "properties": { + "target": { + "description": "A reference to the related reporting descriptor.", + "$ref": "#/definitions/reportingDescriptorReference" + }, + "kinds": { + "description": "A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'.", + "type": "array", + "default": [ + "relevant" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "description": { + "description": "A description of the reporting descriptor relationship.", + "$ref": "#/definitions/message" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the reporting descriptor reference.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "target" + ] + }, + "result": { + "description": "A result produced by an analysis tool.", + "additionalProperties": false, + "type": "object", + "properties": { + "ruleId": { + "description": "The stable, unique identifier of the rule, if any, to which this result is relevant.", + "type": "string" + }, + "ruleIndex": { + "description": "The index within the tool component rules array of the rule object associated with this result.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "rule": { + "description": "A reference used to locate the rule descriptor relevant to this result.", + "$ref": "#/definitions/reportingDescriptorReference" + }, + "kind": { + "description": "A value that categorizes results by evaluation state.", + "default": "fail", + "enum": [ + "notApplicable", + "pass", + "fail", + "review", + "open", + "informational" + ] + }, + "level": { + "description": "A value specifying the severity level of the result.", + "default": "warning", + "enum": [ + "none", + "note", + "warning", + "error" + ] + }, + "message": { + "description": "A message that describes the result. The first sentence of the message only will be displayed when visible space is limited.", + "$ref": "#/definitions/message" + }, + "analysisTarget": { + "description": "Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually occurred.", + "$ref": "#/definitions/artifactLocation" + }, + "locations": { + "description": "The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/location" + } + }, + "guid": { + "description": "A stable, unique identifer for the result in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "correlationGuid": { + "description": "A stable, unique identifier for the equivalence class of logically identical results to which this result belongs, in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "occurrenceCount": { + "description": "A positive integer specifying the number of times this logically unique result was observed in this run.", + "type": "integer", + "minimum": 1 + }, + "partialFingerprints": { + "description": "A set of strings that contribute to the stable, unique identity of the result.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "fingerprints": { + "description": "A set of strings each of which individually defines a stable, unique identity for the result.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "stacks": { + "description": "An array of 'stack' objects relevant to the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/stack" + } + }, + "codeFlows": { + "description": "An array of 'codeFlow' objects relevant to the result.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/codeFlow" + } + }, + "graphs": { + "description": "An array of zero or more unique graph objects associated with the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/graph" + } + }, + "graphTraversals": { + "description": "An array of one or more unique 'graphTraversal' objects.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/graphTraversal" + } + }, + "relatedLocations": { + "description": "A set of locations relevant to this result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/location" + } + }, + "suppressions": { + "description": "A set of suppressions relevant to this result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/suppression" + } + }, + "baselineState": { + "description": "The state of a result relative to a baseline of a previous run.", + "enum": [ + "new", + "unchanged", + "updated", + "absent" + ] + }, + "rank": { + "description": "A number representing the priority or importance of the result.", + "type": "number", + "default": -1, + "minimum": -1, + "maximum": 100 + }, + "attachments": { + "description": "A set of artifacts relevant to the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/attachment" + } + }, + "hostedViewerUri": { + "description": "An absolute URI at which the result can be viewed.", + "type": "string", + "format": "uri" + }, + "workItemUris": { + "description": "The URIs of the work items associated with this result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "type": "string", + "format": "uri" + } + }, + "provenance": { + "description": "Information about how and when the result was detected.", + "$ref": "#/definitions/resultProvenance" + }, + "fixes": { + "description": "An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/fix" + } + }, + "taxa": { + "description": "An array of references to taxonomy reporting descriptors that are applicable to the result.", + "type": "array", + "default": [], + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/reportingDescriptorReference" + } + }, + "webRequest": { + "description": "A web request associated with this result.", + "$ref": "#/definitions/webRequest" + }, + "webResponse": { + "description": "A web response associated with this result.", + "$ref": "#/definitions/webResponse" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the result.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "message" + ] + }, + "resultProvenance": { + "description": "Contains information about how and when a result was detected.", + "additionalProperties": false, + "type": "object", + "properties": { + "firstDetectionTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the result was first detected. See \"Date/time properties\" in the SARIF spec for the required format.", + "type": "string", + "format": "date-time" + }, + "lastDetectionTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See \"Date/time properties\" in the SARIF spec for the required format.", + "type": "string", + "format": "date-time" + }, + "firstDetectionRunGuid": { + "description": "A GUID-valued string equal to the automationDetails.guid property of the run in which the result was first detected.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "lastDetectionRunGuid": { + "description": "A GUID-valued string equal to the automationDetails.guid property of the run in which the result was most recently detected.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "invocationIndex": { + "description": "The index within the run.invocations array of the invocation object which describes the tool invocation that detected the result.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "conversionSources": { + "description": "An array of physicalLocation objects which specify the portions of an analysis tool's output that a converter transformed into the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/physicalLocation" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the result.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "run": { + "description": "Describes a single run of an analysis tool, and contains the reported output of that run.", + "additionalProperties": false, + "type": "object", + "properties": { + "tool": { + "description": "Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and the like) is identical for all aggregated files.", + "$ref": "#/definitions/tool" + }, + "invocations": { + "description": "Describes the invocation of the analysis tool.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/invocation" + } + }, + "conversion": { + "description": "A conversion object that describes how a converter transformed an analysis tool's native reporting format into the SARIF format.", + "$ref": "#/definitions/conversion" + }, + "language": { + "description": "The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).", + "type": "string", + "default": "en-US", + "pattern": "^[a-zA-Z]{2}|^[a-zA-Z]{2}-[a-zA-Z]{2}?$" + }, + "versionControlProvenance": { + "description": "Specifies the revision in version control of the artifacts that were scanned.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/versionControlDetails" + } + }, + "originalUriBaseIds": { + "description": "The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/artifactLocation" + } + }, + "artifacts": { + "description": "An array of artifact objects relevant to the run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/artifact" + } + }, + "logicalLocations": { + "description": "An array of logical locations such as namespaces, types or functions.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/logicalLocation" + } + }, + "graphs": { + "description": "An array of zero or more unique graph objects associated with the run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/graph" + } + }, + "results": { + "description": "The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) if a log file represents an actual scan.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "items": { + "$ref": "#/definitions/result" + } + }, + "automationDetails": { + "description": "Automation details that describe this run.", + "$ref": "#/definitions/runAutomationDetails" + }, + "runAggregates": { + "description": "Automation details that describe the aggregate of runs to which this run belongs.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/runAutomationDetails" + } + }, + "baselineGuid": { + "description": "The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for the run.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "redactionTokens": { + "description": "An array of strings used to replace sensitive information in a redaction-aware property.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "type": "string" + } + }, + "defaultEncoding": { + "description": "Specifies the default encoding for any artifact object that refers to a text file.", + "type": "string" + }, + "defaultSourceLanguage": { + "description": "Specifies the default source language for any artifact object that refers to a text file that contains source code.", + "type": "string" + }, + "newlineSequences": { + "description": "An ordered list of character sequences that were treated as line breaks when computing region information for the run.", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "default": [ + "\r\n", + "\n" + ], + "items": { + "type": "string" + } + }, + "columnKind": { + "description": "Specifies the unit in which the tool measures columns.", + "enum": [ + "utf16CodeUnits", + "unicodeCodePoints" + ] + }, + "externalPropertyFileReferences": { + "description": "References to external property files that should be inlined with the content of a root log file.", + "$ref": "#/definitions/externalPropertyFileReferences" + }, + "threadFlowLocations": { + "description": "An array of threadFlowLocation objects cached at run level.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/threadFlowLocation" + } + }, + "taxonomies": { + "description": "An array of toolComponent objects relevant to a taxonomy in which results are categorized.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + "addresses": { + "description": "Addresses associated with this run instance, if any.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/address" + } + }, + "translations": { + "description": "The set of available translations of the localized data provided by the tool.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + "policies": { + "description": "Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities established at run-time from the command line).", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + "webRequests": { + "description": "An array of request objects cached at run level.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/webRequest" + } + }, + "webResponses": { + "description": "An array of response objects cached at run level.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/webResponse" + } + }, + "specialLocations": { + "description": "A specialLocations object that defines locations of special significance to SARIF consumers.", + "$ref": "#/definitions/specialLocations" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the run.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "tool" + ] + }, + "runAutomationDetails": { + "description": "Information that describes a run's identity and role within an engineering system process.", + "additionalProperties": false, + "type": "object", + "properties": { + "description": { + "description": "A description of the identity and role played within the engineering system by this object's containing run object.", + "$ref": "#/definitions/message" + }, + "id": { + "description": "A hierarchical string that uniquely identifies this object's containing run object.", + "type": "string" + }, + "guid": { + "description": "A stable, unique identifer for this object's containing run object in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "correlationGuid": { + "description": "A stable, unique identifier for the equivalence class of runs to which this object's containing run object belongs in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the run automation details.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "specialLocations": { + "description": "Defines locations of special significance to SARIF consumers.", + "type": "object", + "additionalProperties": false, + "properties": { + "displayBase": { + "description": "Provides a suggestion to SARIF consumers to display file paths relative to the specified location.", + "$ref": "#/definitions/artifactLocation" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the special locations.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "stack": { + "description": "A call stack that is relevant to a result.", + "additionalProperties": false, + "type": "object", + "properties": { + "message": { + "description": "A message relevant to this call stack.", + "$ref": "#/definitions/message" + }, + "frames": { + "description": "An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "items": { + "$ref": "#/definitions/stackFrame" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the stack.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "frames" + ] + }, + "stackFrame": { + "description": "A function call within a stack trace.", + "additionalProperties": false, + "type": "object", + "properties": { + "location": { + "description": "The location to which this stack frame refers.", + "$ref": "#/definitions/location" + }, + "module": { + "description": "The name of the module that contains the code of this stack frame.", + "type": "string" + }, + "threadId": { + "description": "The thread identifier of the stack frame.", + "type": "integer" + }, + "parameters": { + "description": "The parameters of the call that is executing.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "type": "string", + "default": [] + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the stack frame.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "suppression": { + "description": "A suppression that is relevant to a result.", + "additionalProperties": false, + "type": "object", + "properties": { + "guid": { + "description": "A stable, unique identifer for the suppression in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "kind": { + "description": "A string that indicates where the suppression is persisted.", + "enum": [ + "inSource", + "external" + ] + }, + "status": { + "description": "A string that indicates the review status of the suppression.", + "enum": [ + "accepted", + "underReview", + "rejected" + ] + }, + "justification": { + "description": "A string representing the justification for the suppression.", + "type": "string" + }, + "location": { + "description": "Identifies the location associated with the suppression.", + "$ref": "#/definitions/location" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the suppression.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "kind" + ] + }, + "threadFlow": { + "description": "Describes a sequence of code locations that specify a path through a single thread of execution such as an operating system or fiber.", + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "description": "An string that uniquely identifies the threadFlow within the codeFlow in which it occurs.", + "type": "string" + }, + "message": { + "description": "A message relevant to the thread flow.", + "$ref": "#/definitions/message" + }, + "initialState": { + "description": "Values of relevant expressions at the start of the thread flow that may change during thread flow execution.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + "immutableState": { + "description": "Values of relevant expressions at the start of the thread flow that remain constant.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + "locations": { + "description": "A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the result.", + "type": "array", + "minItems": 1, + "uniqueItems": false, + "items": { + "$ref": "#/definitions/threadFlowLocation" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the thread flow.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "locations" + ] + }, + "threadFlowLocation": { + "description": "A location visited by an analysis tool while simulating or monitoring the execution of a program.", + "additionalProperties": false, + "type": "object", + "properties": { + "index": { + "description": "The index within the run threadFlowLocations array.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "location": { + "description": "The code location.", + "$ref": "#/definitions/location" + }, + "stack": { + "description": "The call stack leading to this location.", + "$ref": "#/definitions/stack" + }, + "kinds": { + "description": "A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', 'memory', 'resource', 'scope' and 'value'.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "type": "string" + } + }, + "taxa": { + "description": "An array of references to rule or taxonomy reporting descriptors that are applicable to the thread flow location.", + "type": "array", + "default": [], + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/reportingDescriptorReference" + } + }, + "module": { + "description": "The name of the module that contains the code that is executing.", + "type": "string" + }, + "state": { + "description": "A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + "nestingLevel": { + "description": "An integer representing a containment hierarchy within the thread flow.", + "type": "integer", + "minimum": 0 + }, + "executionOrder": { + "description": "An integer representing the temporal order in which execution reached this location.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "executionTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which this location was executed.", + "type": "string", + "format": "date-time" + }, + "importance": { + "description": "Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is \"essential\", \"important\", \"unimportant\". Default: \"important\".", + "enum": [ + "important", + "essential", + "unimportant" + ], + "default": "important" + }, + "webRequest": { + "description": "A web request associated with this thread flow location.", + "$ref": "#/definitions/webRequest" + }, + "webResponse": { + "description": "A web response associated with this thread flow location.", + "$ref": "#/definitions/webResponse" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the threadflow location.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "tool": { + "description": "The analysis tool that was run.", + "additionalProperties": false, + "type": "object", + "properties": { + "driver": { + "description": "The analysis tool that was run.", + "$ref": "#/definitions/toolComponent" + }, + "extensions": { + "description": "Tool extensions that contributed to or reconfigured the analysis tool that was run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the tool.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "driver" + ] + }, + "toolComponent": { + "description": "A component, such as a plug-in or the driver, of the analysis tool that was run.", + "additionalProperties": false, + "type": "object", + "properties": { + "guid": { + "description": "A unique identifer for the tool component in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "name": { + "description": "The name of the tool component.", + "type": "string" + }, + "organization": { + "description": "The organization or company that produced the tool component.", + "type": "string" + }, + "product": { + "description": "A product suite to which the tool component belongs.", + "type": "string" + }, + "productSuite": { + "description": "A localizable string containing the name of the suite of products to which the tool component belongs.", + "type": "string" + }, + "shortDescription": { + "description": "A brief description of the tool component.", + "$ref": "#/definitions/multiformatMessageString" + }, + "fullDescription": { + "description": "A comprehensive description of the tool component.", + "$ref": "#/definitions/multiformatMessageString" + }, + "fullName": { + "description": "The name of the tool component along with its version and any other useful identifying information, such as its locale.", + "type": "string" + }, + "version": { + "description": "The tool component version, in whatever format the component natively provides.", + "type": "string" + }, + "semanticVersion": { + "description": "The tool component version in the format specified by Semantic Versioning 2.0.", + "type": "string" + }, + "dottedQuadFileVersion": { + "description": "The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for operating systems that express file versions in this way).", + "type": "string", + "pattern": "[0-9]+(\\.[0-9]+){3}" + }, + "releaseDateUtc": { + "description": "A string specifying the UTC date (and optionally, the time) of the component's release.", + "type": "string" + }, + "downloadUri": { + "description": "The absolute URI from which the tool component can be downloaded.", + "type": "string", + "format": "uri" + }, + "informationUri": { + "description": "The absolute URI at which information about this version of the tool component can be found.", + "type": "string", + "format": "uri" + }, + "globalMessageStrings": { + "description": "A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + "notifications": { + "description": "An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool component.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/reportingDescriptor" + } + }, + "rules": { + "description": "An array of reportingDescriptor objects relevant to the analysis performed by the tool component.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/reportingDescriptor" + } + }, + "taxa": { + "description": "An array of reportingDescriptor objects relevant to the definitions of both standalone and tool-defined taxonomies.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/reportingDescriptor" + } + }, + "locations": { + "description": "An array of the artifactLocation objects associated with the tool component.", + "type": "array", + "minItems": 0, + "default": [], + "items": { + "$ref": "#/definitions/artifactLocation" + } + }, + "language": { + "description": "The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).", + "type": "string", + "default": "en-US", + "pattern": "^[a-zA-Z]{2}|^[a-zA-Z]{2}-[a-zA-Z]{2}?$" + }, + "contents": { + "description": "The kinds of data contained in this object.", + "type": "array", + "uniqueItems": true, + "default": [ + "localizedData", + "nonLocalizedData" + ], + "items": { + "enum": [ + "localizedData", + "nonLocalizedData" + ] + } + }, + "isComprehensive": { + "description": "Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to this log file.", + "type": "boolean", + "default": false + }, + "localizedDataSemanticVersion": { + "description": "The semantic version of the localized strings defined in this component; maintained by components that provide translations.", + "type": "string" + }, + "minimumRequiredLocalizedDataSemanticVersion": { + "description": "The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that consume translations.", + "type": "string" + }, + "associatedComponent": { + "description": "The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's plugin model.", + "$ref": "#/definitions/toolComponentReference" + }, + "translationMetadata": { + "description": "Translation metadata, required for a translation, not populated by other component types.", + "$ref": "#/definitions/translationMetadata" + }, + "supportedTaxonomies": { + "description": "An array of toolComponentReference objects to declare the taxonomies supported by the tool component.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponentReference" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the tool component.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "name" + ] + }, + "toolComponentReference": { + "description": "Identifies a particular toolComponent object, either the driver or an extension.", + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "description": "The 'name' property of the referenced toolComponent.", + "type": "string" + }, + "index": { + "description": "An index into the referenced toolComponent in tool.extensions.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "guid": { + "description": "The 'guid' property of the referenced toolComponent.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the toolComponentReference.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "translationMetadata": { + "description": "Provides additional metadata related to translation.", + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "description": "The name associated with the translation metadata.", + "type": "string" + }, + "fullName": { + "description": "The full name associated with the translation metadata.", + "type": "string" + }, + "shortDescription": { + "description": "A brief description of the translation metadata.", + "$ref": "#/definitions/multiformatMessageString" + }, + "fullDescription": { + "description": "A comprehensive description of the translation metadata.", + "$ref": "#/definitions/multiformatMessageString" + }, + "downloadUri": { + "description": "The absolute URI from which the translation metadata can be downloaded.", + "type": "string", + "format": "uri" + }, + "informationUri": { + "description": "The absolute URI from which information related to the translation metadata can be downloaded.", + "type": "string", + "format": "uri" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the translation metadata.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "name" + ] + }, + "versionControlDetails": { + "description": "Specifies the information necessary to retrieve a desired revision from a version control system.", + "type": "object", + "additionalProperties": false, + "properties": { + "repositoryUri": { + "description": "The absolute URI of the repository.", + "type": "string", + "format": "uri" + }, + "revisionId": { + "description": "A string that uniquely and permanently identifies the revision within the repository.", + "type": "string" + }, + "branch": { + "description": "The name of a branch containing the revision.", + "type": "string" + }, + "revisionTag": { + "description": "A tag that has been applied to the revision.", + "type": "string" + }, + "asOfTimeUtc": { + "description": "A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of the repository at that time.", + "type": "string", + "format": "date-time" + }, + "mappedTo": { + "description": "The location in the local file system to which the root of the repository was mapped at the time of the analysis.", + "$ref": "#/definitions/artifactLocation" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the version control details.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "repositoryUri" + ] + }, + "webRequest": { + "description": "Describes an HTTP request.", + "type": "object", + "additionalProperties": false, + "properties": { + "index": { + "description": "The index within the run.webRequests array of the request object associated with this result.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "protocol": { + "description": "The request protocol. Example: 'http'.", + "type": "string" + }, + "version": { + "description": "The request version. Example: '1.1'.", + "type": "string" + }, + "target": { + "description": "The target of the request.", + "type": "string" + }, + "method": { + "description": "The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'.", + "type": "string" + }, + "headers": { + "description": "The request headers.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "parameters": { + "description": "The request parameters.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "body": { + "description": "The body of the request.", + "$ref": "#/definitions/artifactContent" + }, + "properties": { + "description": "Key/value pairs that provide additional information about the request.", + "$ref": "#/definitions/propertyBag" + } + } + }, + "webResponse": { + "description": "Describes the response to an HTTP request.", + "type": "object", + "additionalProperties": false, + "properties": { + "index": { + "description": "The index within the run.webResponses array of the response object associated with this result.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + "protocol": { + "description": "The response protocol. Example: 'http'.", + "type": "string" + }, + "version": { + "description": "The response version. Example: '1.1'.", + "type": "string" + }, + "statusCode": { + "description": "The response status code. Example: 451.", + "type": "integer" + }, + "reasonPhrase": { + "description": "The response reason. Example: 'Not found'.", + "type": "string" + }, + "headers": { + "description": "The response headers.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "body": { + "description": "The body of the response.", + "$ref": "#/definitions/artifactContent" + }, + "noResponseReceived": { + "description": "Specifies whether a response was received from the server.", + "type": "boolean", + "default": false + }, + "properties": { + "description": "Key/value pairs that provide additional information about the response.", + "$ref": "#/definitions/propertyBag" + } + } + } + }, + "description": "Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema: a standard format for the output of static analysis tools.", + "properties": { + "$schema": { + "description": "The URI of the JSON schema corresponding to the version.", + "type": "string", + "format": "uri" + }, + "version": { + "description": "The SARIF format version of this log file.", + "enum": [ + "2.1.0" + ] + }, + "runs": { + "description": "The set of runs contained in this log file.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "items": { + "$ref": "#/definitions/run" + } + }, + "inlineExternalProperties": { + "description": "References to external property files that share data between runs.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/externalProperties" + } + }, + "properties": { + "description": "Key/value pairs that provide additional information about the log file.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ + "version", + "runs" + ], + "title": "Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema", + "type": "object" +} \ No newline at end of file diff --git a/plugins/verifier/vulnerabilityreport/schemavalidation/schemavalidation_test.go b/plugins/verifier/vulnerabilityreport/schemavalidation/schemavalidation_test.go new file mode 100644 index 0000000000..4fd399bdd8 --- /dev/null +++ b/plugins/verifier/vulnerabilityreport/schemavalidation/schemavalidation_test.go @@ -0,0 +1,84 @@ +/* +Copyright The Ratify Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package schemavalidation + +import ( + "os" + "testing" +) + +var schemaURL = "https://json.schemastore.org/sarif-2.1.0-rtm.5.json" +var schemaFileBytes []byte +var schemaFileMismatchBytes []byte +var schemaFileBadBytes []byte +var trivyScanReport []byte + +func init() { + trivyScanReport, _ = os.ReadFile("./testdata/trivy_scan_report.json") + schemaFileBytes, _ = os.ReadFile("./schemas/sarif-2.1.0-rtm.5.json") + schemaFileMismatchBytes, _ = os.ReadFile("./testdata/mismatch_schema.json") + schemaFileBadBytes, _ = os.ReadFile("./testdata/bad_schema.json") +} + +func TestProperSchemaValidates(t *testing.T) { + expected := true + result := Validate(schemaURL, trivyScanReport) == nil + + if expected != result { + t.Logf("expected: %v, got: %v", expected, result) + t.FailNow() + } +} + +func TestInvalidSchemaFailsValidation(t *testing.T) { + expected := false + result := Validate("bad schema", trivyScanReport) == nil + + if expected != result { + t.Logf("expected: %v, got: %v", expected, result) + t.FailNow() + } +} + +func TestProperSchemaValidatesFromFile(t *testing.T) { + expected := true + result := ValidateAgainstOfflineSchema(schemaFileBytes, trivyScanReport) == nil + + if expected != result { + t.Logf("expected: %v, got: %v", expected, result) + t.FailNow() + } +} + +func TestSchemaMismatchFromFile(t *testing.T) { + expected := false + result := ValidateAgainstOfflineSchema(schemaFileMismatchBytes, trivyScanReport) == nil + + if expected != result { + t.Logf("expected: %v, got: %v", expected, result) + t.FailNow() + } +} + +func TestBadSchemaValidatesFromFile(t *testing.T) { + expected := false + result := ValidateAgainstOfflineSchema(schemaFileBadBytes, trivyScanReport) == nil + + if expected != result { + t.Logf("expected: %v, got: %v", expected, result) + t.FailNow() + } +} diff --git a/plugins/verifier/vulnerabilityreport/schemavalidation/schemavalidator.go b/plugins/verifier/vulnerabilityreport/schemavalidation/schemavalidator.go new file mode 100644 index 0000000000..74ab85ecba --- /dev/null +++ b/plugins/verifier/vulnerabilityreport/schemavalidation/schemavalidator.go @@ -0,0 +1,65 @@ +/* +Copyright The Ratify Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package schemavalidation + +import ( + "errors" + "fmt" + + "github.com/xeipuuv/gojsonschema" +) + +// Validates content from a byte array against a URL schema or from a canonical file path +func Validate(schema string, content []byte) error { + sl := gojsonschema.NewReferenceLoader(schema) + dl := gojsonschema.NewBytesLoader(content) + + result, err := gojsonschema.Validate(sl, dl) + + if err != nil { + return err + } + + if result.Valid() { + return nil + } + var e string + for _, desc := range result.Errors() { + e += fmt.Sprintf("%s:", desc.Description()) + } + return errors.New(e) +} + +// Validates content from a byte array against a schema from a byte array +// This is useful for testing and restricted environments as it allows loading of schemas from files +func ValidateAgainstOfflineSchema(schema []byte, content []byte) error { + sl := gojsonschema.NewBytesLoader(schema) + dl := gojsonschema.NewBytesLoader(content) + + result, err := gojsonschema.Validate(sl, dl) + if err != nil { + return err + } + + if result.Valid() { + return nil + } + var e string + for _, desc := range result.Errors() { + e += fmt.Sprintf("%s:", desc.Description()) + } + return errors.New(e) +} diff --git a/plugins/verifier/vulnerabilityreport/schemavalidation/testdata/bad_schema.json b/plugins/verifier/vulnerabilityreport/schemavalidation/testdata/bad_schema.json new file mode 100644 index 0000000000..ab5bd25891 --- /dev/null +++ b/plugins/verifier/vulnerabilityreport/schemavalidation/testdata/bad_schema.json @@ -0,0 +1,2 @@ +{ +bad schema diff --git a/plugins/verifier/vulnerabilityreport/schemavalidation/testdata/mismatch_schema.json b/plugins/verifier/vulnerabilityreport/schemavalidation/testdata/mismatch_schema.json new file mode 100644 index 0000000000..2ea742cfe0 --- /dev/null +++ b/plugins/verifier/vulnerabilityreport/schemavalidation/testdata/mismatch_schema.json @@ -0,0 +1,964 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://spdx.org/rdf/terms/2.3", + "title": "SPDX 2.3", + "type": "object", + "properties": { + "SPDXID": { + "type": "string", + "description": "Uniquely identify any element in an SPDX document which may be referenced by other elements." + }, + "annotations": { + "description": "Provide additional information about an SpdxElement.", + "type": "array", + "items": { + "type": "object", + "properties": { + "annotationDate": { + "description": "Identify when the comment was made. This is to be specified according to the combined date and time in the UTC format, as specified in the ISO 8601 standard.", + "type": "string" + }, + "annotationType": { + "description": "Type of the annotation.", + "type": "string", + "enum": [ + "OTHER", + "REVIEW" + ] + }, + "annotator": { + "description": "This field identifies the person, organization, or tool that has commented on a file, package, snippet, or the entire document.", + "type": "string" + }, + "comment": { + "type": "string" + } + }, + "required": [ + "annotationDate", + "annotationType", + "annotator", + "comment" + ], + "additionalProperties": false, + "description": "An Annotation is a comment on an SpdxItem by an agent." + } + }, + "comment": { + "type": "string" + }, + "creationInfo": { + "type": "object", + "properties": { + "comment": { + "type": "string" + }, + "created": { + "description": "Identify when the SPDX document was originally created. The date is to be specified according to combined date and time in UTC format as specified in ISO 8601 standard.", + "type": "string" + }, + "creators": { + "description": "Identify who (or what, in the case of a tool) created the SPDX document. If the SPDX document was created by an individual, indicate the person's name. If the SPDX document was created on behalf of a company or organization, indicate the entity name. If the SPDX document was created using a software tool, indicate the name and version for that tool. If multiple participants or tools were involved, use multiple instances of this field. Person name or organization name may be designated as “anonymous” if appropriate.", + "minItems": 1, + "type": "array", + "items": { + "description": "Identify who (or what, in the case of a tool) created the SPDX document. If the SPDX document was created by an individual, indicate the person's name. If the SPDX document was created on behalf of a company or organization, indicate the entity name. If the SPDX document was created using a software tool, indicate the name and version for that tool. If multiple participants or tools were involved, use multiple instances of this field. Person name or organization name may be designated as “anonymous” if appropriate.", + "type": "string" + } + }, + "licenseListVersion": { + "description": "An optional field for creators of the SPDX file to provide the version of the SPDX License List used when the SPDX file was created.", + "type": "string" + } + }, + "required": [ + "created", + "creators" + ], + "additionalProperties": false, + "description": "One instance is required for each SPDX file produced. It provides the necessary information for forward and backward compatibility for processing tools." + }, + "dataLicense": { + "description": "License expression for dataLicense. See SPDX Annex D for the license expression syntax. Compliance with the SPDX specification includes populating the SPDX fields therein with data related to such fields (\"SPDX-Metadata\"). The SPDX specification contains numerous fields where an SPDX document creator may provide relevant explanatory text in SPDX-Metadata. Without opining on the lawfulness of \"database rights\" (in jurisdictions where applicable), such explanatory text is copyrightable subject matter in most Berne Convention countries. By using the SPDX specification, or any portion hereof, you hereby agree that any copyright rights (as determined by your jurisdiction) in any SPDX-Metadata, including without limitation explanatory text, shall be subject to the terms of the Creative Commons CC0 1.0 Universal license. For SPDX-Metadata not containing any copyright rights, you hereby agree and acknowledge that the SPDX-Metadata is provided to you \"as-is\" and without any representations or warranties of any kind concerning the SPDX-Metadata, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non-infringement, or the absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.", + "type": "string" + }, + "externalDocumentRefs": { + "description": "Identify any external SPDX documents referenced within this SPDX document.", + "type": "array", + "items": { + "type": "object", + "properties": { + "checksum": { + "type": "object", + "properties": { + "algorithm": { + "description": "Identifies the algorithm used to produce the subject Checksum. Currently, SHA-1 is the only supported algorithm. It is anticipated that other algorithms will be supported at a later time.", + "type": "string", + "enum": [ + "SHA1", + "BLAKE3", + "SHA3-384", + "SHA256", + "SHA384", + "BLAKE2b-512", + "BLAKE2b-256", + "SHA3-512", + "MD2", + "ADLER32", + "MD4", + "SHA3-256", + "BLAKE2b-384", + "SHA512", + "MD6", + "MD5", + "SHA224" + ] + }, + "checksumValue": { + "description": "The checksumValue property provides a lower case hexidecimal encoded digest value produced using a specific algorithm.", + "type": "string" + } + }, + "required": [ + "algorithm", + "checksumValue" + ], + "additionalProperties": false, + "description": "A Checksum is value that allows the contents of a file to be authenticated. Even small changes to the content of the file will change its checksum. This class allows the results of a variety of checksum and cryptographic message digest algorithms to be represented." + }, + "externalDocumentId": { + "description": "externalDocumentId is a string containing letters, numbers, ., - and/or + which uniquely identifies an external document within this document.", + "type": "string" + }, + "spdxDocument": { + "description": "SPDX ID for SpdxDocument. A property containing an SPDX document.", + "type": "string" + } + }, + "required": [ + "checksum", + "externalDocumentId", + "spdxDocument" + ], + "additionalProperties": false, + "description": "Information about an external SPDX document reference including the checksum. This allows for verification of the external references." + } + }, + "hasExtractedLicensingInfos": { + "description": "Indicates that a particular ExtractedLicensingInfo was defined in the subject SpdxDocument.", + "type": "array", + "items": { + "type": "object", + "properties": { + "comment": { + "type": "string" + }, + "crossRefs": { + "description": "Cross Reference Detail for a license SeeAlso URL", + "type": "array", + "items": { + "type": "object", + "properties": { + "isLive": { + "description": "Indicate a URL is still a live accessible location on the public internet", + "type": "boolean" + }, + "isValid": { + "description": "True if the URL is a valid well formed URL", + "type": "boolean" + }, + "isWayBackLink": { + "description": "True if the License SeeAlso URL points to a Wayback archive", + "type": "boolean" + }, + "match": { + "description": "Status of a License List SeeAlso URL reference if it refers to a website that matches the license text.", + "type": "string" + }, + "order": { + "description": "The ordinal order of this element within a list", + "type": "integer" + }, + "timestamp": { + "description": "Timestamp", + "type": "string" + }, + "url": { + "description": "URL Reference", + "type": "string" + } + }, + "required": [ + "url" + ], + "additionalProperties": false, + "description": "Cross reference details for the a URL reference" + } + }, + "extractedText": { + "description": "Provide a copy of the actual text of the license reference extracted from the package, file or snippet that is associated with the License Identifier to aid in future analysis.", + "type": "string" + }, + "licenseId": { + "description": "A human readable short form license identifier for a license. The license ID is either on the standard license list or the form \"LicenseRef-[idString]\" where [idString] is a unique string containing letters, numbers, \".\" or \"-\". When used within a license expression, the license ID can optionally include a reference to an external document in the form \"DocumentRef-[docrefIdString]:LicenseRef-[idString]\" where docRefIdString is an ID for an external document reference.", + "type": "string" + }, + "name": { + "description": "Identify name of this SpdxElement.", + "type": "string" + }, + "seeAlsos": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "extractedText", + "licenseId" + ], + "additionalProperties": false, + "description": "An ExtractedLicensingInfo represents a license or licensing notice that was found in a package, file or snippet. Any license text that is recognized as a license may be represented as a License rather than an ExtractedLicensingInfo." + } + }, + "name": { + "description": "Identify name of this SpdxElement.", + "type": "string" + }, + "revieweds": { + "description": "Reviewed", + "type": "array", + "items": { + "type": "object", + "properties": { + "comment": { + "type": "string" + }, + "reviewDate": { + "description": "The date and time at which the SpdxDocument was reviewed. This value must be in UTC and have 'Z' as its timezone indicator.", + "type": "string" + }, + "reviewer": { + "description": "The name and, optionally, contact information of the person who performed the review. Values of this property must conform to the agent and tool syntax. The reviewer property is deprecated in favor of Annotation with an annotationType review.", + "type": "string" + } + }, + "required": [ + "reviewDate" + ], + "additionalProperties": false, + "description": "This class has been deprecated in favor of an Annotation with an Annotation type of review." + } + }, + "spdxVersion": { + "description": "Provide a reference number that can be used to understand how to parse and interpret the rest of the file. It will enable both future changes to the specification and to support backward compatibility. The version number consists of a major and minor version indicator. The major field will be incremented when incompatible changes between versions are made (one or more sections are created, modified or deleted). The minor field will be incremented when backwards compatible changes are made.", + "type": "string" + }, + "documentNamespace": { + "type": "string", + "description": "The URI provides an unambiguous mechanism for other SPDX documents to reference SPDX elements within this SPDX document." + }, + "documentDescribes": { + "description": "Packages, files and/or Snippets described by this SPDX document", + "type": "array", + "items": { + "type": "string", + "description": "SPDX ID for each Package, File, or Snippet." + } + }, + "packages": { + "description": "Packages referenced in the SPDX document", + "type": "array", + "items": { + "type": "object", + "properties": { + "SPDXID": { + "type": "string", + "description": "Uniquely identify any element in an SPDX document which may be referenced by other elements." + }, + "annotations": { + "description": "Provide additional information about an SpdxElement.", + "type": "array", + "items": { + "type": "object", + "properties": { + "annotationDate": { + "description": "Identify when the comment was made. This is to be specified according to the combined date and time in the UTC format, as specified in the ISO 8601 standard.", + "type": "string" + }, + "annotationType": { + "description": "Type of the annotation.", + "type": "string", + "enum": [ + "OTHER", + "REVIEW" + ] + }, + "annotator": { + "description": "This field identifies the person, organization, or tool that has commented on a file, package, snippet, or the entire document.", + "type": "string" + }, + "comment": { + "type": "string" + } + }, + "required": [ + "annotationDate", + "annotationType", + "annotator", + "comment" + ], + "additionalProperties": false, + "description": "An Annotation is a comment on an SpdxItem by an agent." + } + }, + "attributionTexts": { + "description": "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConculded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", + "type": "array", + "items": { + "description": "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConculded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", + "type": "string" + } + }, + "builtDate": { + "description": "This field provides a place for recording the actual date the package was built.", + "type": "string" + }, + "checksums": { + "description": "The checksum property provides a mechanism that can be used to verify that the contents of a File or Package have not changed.", + "type": "array", + "items": { + "type": "object", + "properties": { + "algorithm": { + "description": "Identifies the algorithm used to produce the subject Checksum. Currently, SHA-1 is the only supported algorithm. It is anticipated that other algorithms will be supported at a later time.", + "type": "string", + "enum": [ + "SHA1", + "BLAKE3", + "SHA3-384", + "SHA256", + "SHA384", + "BLAKE2b-512", + "BLAKE2b-256", + "SHA3-512", + "MD2", + "ADLER32", + "MD4", + "SHA3-256", + "BLAKE2b-384", + "SHA512", + "MD6", + "MD5", + "SHA224" + ] + }, + "checksumValue": { + "description": "The checksumValue property provides a lower case hexidecimal encoded digest value produced using a specific algorithm.", + "type": "string" + } + }, + "required": [ + "algorithm", + "checksumValue" + ], + "additionalProperties": false, + "description": "A Checksum is value that allows the contents of a file to be authenticated. Even small changes to the content of the file will change its checksum. This class allows the results of a variety of checksum and cryptographic message digest algorithms to be represented." + } + }, + "comment": { + "type": "string" + }, + "copyrightText": { + "description": "The text of copyright declarations recited in the package, file or snippet.\n\nIf the copyrightText field is not present, it implies an equivalent meaning to NOASSERTION.", + "type": "string" + }, + "description": { + "description": "Provides a detailed description of the package.", + "type": "string" + }, + "downloadLocation": { + "description": "The URI at which this package is available for download. Private (i.e., not publicly reachable) URIs are acceptable as values of this property. The values http://spdx.org/rdf/terms#none and http://spdx.org/rdf/terms#noassertion may be used to specify that the package is not downloadable or that no attempt was made to determine its download location, respectively.", + "type": "string" + }, + "externalRefs": { + "description": "An External Reference allows a Package to reference an external source of additional information, metadata, enumerations, asset identifiers, or downloadable content believed to be relevant to the Package.", + "type": "array", + "items": { + "type": "object", + "properties": { + "comment": { + "type": "string" + }, + "referenceCategory": { + "description": "Category for the external reference", + "type": "string", + "enum": [ + "OTHER", + "PERSISTENT-ID", + "PERSISTENT_ID", + "SECURITY", + "PACKAGE-MANAGER", + "PACKAGE_MANAGER" + ] + }, + "referenceLocator": { + "description": "The unique string with no spaces necessary to access the package-specific information, metadata, or content within the target location. The format of the locator is subject to constraints defined by the .", + "type": "string" + }, + "referenceType": { + "description": "Type of the external reference. These are defined in an appendix in the SPDX specification.", + "type": "string" + } + }, + "required": [ + "referenceCategory", + "referenceLocator", + "referenceType" + ], + "additionalProperties": false, + "description": "An External Reference allows a Package to reference an external source of additional information, metadata, enumerations, asset identifiers, or downloadable content believed to be relevant to the Package." + } + }, + "filesAnalyzed": { + "description": "Indicates whether the file content of this package has been available for or subjected to analysis when creating the SPDX document. If false indicates packages that represent metadata or URI references to a project, product, artifact, distribution or a component. If set to false, the package must not contain any files.", + "type": "boolean" + }, + "hasFiles": { + "description": "Indicates that a particular file belongs to a package.", + "type": "array", + "items": { + "description": "SPDX ID for File. Indicates that a particular file belongs to a package.", + "type": "string" + } + }, + "homepage": { + "type": "string" + }, + "licenseComments": { + "description": "The licenseComments property allows the preparer of the SPDX document to describe why the licensing in spdx:licenseConcluded was chosen.", + "type": "string" + }, + "licenseConcluded": { + "description": "License expression for licenseConcluded. See SPDX Annex D for the license expression syntax. The licensing that the preparer of this SPDX document has concluded, based on the evidence, actually applies to the SPDX Item.\n\nIf the licenseConcluded field is not present for an SPDX Item, it implies an equivalent meaning to NOASSERTION.", + "type": "string" + }, + "licenseDeclared": { + "description": "License expression for licenseDeclared. See SPDX Annex D for the license expression syntax. The licensing that the creators of the software in the package, or the packager, have declared. Declarations by the original software creator should be preferred, if they exist.", + "type": "string" + }, + "licenseInfoFromFiles": { + "description": "The licensing information that was discovered directly within the package. There will be an instance of this property for each distinct value of alllicenseInfoInFile properties of all files contained in the package.\n\nIf the licenseInfoFromFiles field is not present for a package and filesAnalyzed property for that same package is true or omitted, it implies an equivalent meaning to NOASSERTION.", + "type": "array", + "items": { + "description": "License expression for licenseInfoFromFiles. See SPDX Annex D for the license expression syntax. The licensing information that was discovered directly within the package. There will be an instance of this property for each distinct value of alllicenseInfoInFile properties of all files contained in the package.\n\nIf the licenseInfoFromFiles field is not present for a package and filesAnalyzed property for that same package is true or omitted, it implies an equivalent meaning to NOASSERTION.", + "type": "string" + } + }, + "name": { + "description": "Identify name of this SpdxElement.", + "type": "string" + }, + "originator": { + "description": "The name and, optionally, contact information of the person or organization that originally created the package. Values of this property must conform to the agent and tool syntax.", + "type": "string" + }, + "packageFileName": { + "description": "The base name of the package file name. For example, zlib-1.2.5.tar.gz.", + "type": "string" + }, + "packageVerificationCode": { + "type": "object", + "properties": { + "packageVerificationCodeExcludedFiles": { + "description": "A file that was excluded when calculating the package verification code. This is usually a file containing SPDX data regarding the package. If a package contains more than one SPDX file all SPDX files must be excluded from the package verification code. If this is not done it would be impossible to correctly calculate the verification codes in both files.", + "type": "array", + "items": { + "description": "A file that was excluded when calculating the package verification code. This is usually a file containing SPDX data regarding the package. If a package contains more than one SPDX file all SPDX files must be excluded from the package verification code. If this is not done it would be impossible to correctly calculate the verification codes in both files.", + "type": "string" + } + }, + "packageVerificationCodeValue": { + "description": "The actual package verification code as a hex encoded value.", + "type": "string" + } + }, + "required": [ + "packageVerificationCodeValue" + ], + "additionalProperties": false, + "description": "A manifest based verification code (the algorithm is defined in section 4.7 of the full specification) of the SPDX Item. This allows consumers of this data and/or database to determine if an SPDX item they have in hand is identical to the SPDX item from which the data was produced. This algorithm works even if the SPDX document is included in the SPDX item." + }, + "primaryPackagePurpose": { + "description": "This field provides information about the primary purpose of the identified package. Package Purpose is intrinsic to how the package is being used rather than the content of the package.", + "type": "string", + "enum": [ + "OTHER", + "INSTALL", + "ARCHIVE", + "FIRMWARE", + "APPLICATION", + "FRAMEWORK", + "LIBRARY", + "CONTAINER", + "SOURCE", + "DEVICE", + "OPERATING_SYSTEM", + "FILE" + ] + }, + "releaseDate": { + "description": "This field provides a place for recording the date the package was released.", + "type": "string" + }, + "sourceInfo": { + "description": "Allows the producer(s) of the SPDX document to describe how the package was acquired and/or changed from the original source.", + "type": "string" + }, + "summary": { + "description": "Provides a short description of the package.", + "type": "string" + }, + "supplier": { + "description": "The name and, optionally, contact information of the person or organization who was the immediate supplier of this package to the recipient. The supplier may be different than originator when the software has been repackaged. Values of this property must conform to the agent and tool syntax.", + "type": "string" + }, + "validUntilDate": { + "description": "This field provides a place for recording the end of the support period for a package from the supplier.", + "type": "string" + }, + "versionInfo": { + "description": "Provides an indication of the version of the package that is described by this SpdxDocument.", + "type": "string" + } + }, + "required": [ + "SPDXID", + "downloadLocation", + "name" + ], + "additionalProperties": false + } + }, + "files": { + "description": "Files referenced in the SPDX document", + "type": "array", + "items": { + "type": "object", + "properties": { + "SPDXID": { + "type": "string", + "description": "Uniquely identify any element in an SPDX document which may be referenced by other elements." + }, + "annotations": { + "description": "Provide additional information about an SpdxElement.", + "type": "array", + "items": { + "type": "object", + "properties": { + "annotationDate": { + "description": "Identify when the comment was made. This is to be specified according to the combined date and time in the UTC format, as specified in the ISO 8601 standard.", + "type": "string" + }, + "annotationType": { + "description": "Type of the annotation.", + "type": "string", + "enum": [ + "OTHER", + "REVIEW" + ] + }, + "annotator": { + "description": "This field identifies the person, organization, or tool that has commented on a file, package, snippet, or the entire document.", + "type": "string" + }, + "comment": { + "type": "string" + } + }, + "required": [ + "annotationDate", + "annotationType", + "annotator", + "comment" + ], + "additionalProperties": false, + "description": "An Annotation is a comment on an SpdxItem by an agent." + } + }, + "artifactOfs": { + "description": "Indicates the project in which the SpdxElement originated. Tools must preserve doap:homepage and doap:name properties and the URI (if one is known) of doap:Project resources that are values of this property. All other properties of doap:Projects are not directly supported by SPDX and may be dropped when translating to or from some SPDX formats.", + "type": "array", + "items": { + "type": "object" + } + }, + "attributionTexts": { + "description": "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConculded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", + "type": "array", + "items": { + "description": "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConculded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", + "type": "string" + } + }, + "checksums": { + "description": "The checksum property provides a mechanism that can be used to verify that the contents of a File or Package have not changed.", + "minItems": 1, + "type": "array", + "items": { + "type": "object", + "properties": { + "algorithm": { + "description": "Identifies the algorithm used to produce the subject Checksum. Currently, SHA-1 is the only supported algorithm. It is anticipated that other algorithms will be supported at a later time.", + "type": "string", + "enum": [ + "SHA1", + "BLAKE3", + "SHA3-384", + "SHA256", + "SHA384", + "BLAKE2b-512", + "BLAKE2b-256", + "SHA3-512", + "MD2", + "ADLER32", + "MD4", + "SHA3-256", + "BLAKE2b-384", + "SHA512", + "MD6", + "MD5", + "SHA224" + ] + }, + "checksumValue": { + "description": "The checksumValue property provides a lower case hexidecimal encoded digest value produced using a specific algorithm.", + "type": "string" + } + }, + "required": [ + "algorithm", + "checksumValue" + ], + "additionalProperties": false, + "description": "A Checksum is value that allows the contents of a file to be authenticated. Even small changes to the content of the file will change its checksum. This class allows the results of a variety of checksum and cryptographic message digest algorithms to be represented." + } + }, + "comment": { + "type": "string" + }, + "copyrightText": { + "description": "The text of copyright declarations recited in the package, file or snippet.\n\nIf the copyrightText field is not present, it implies an equivalent meaning to NOASSERTION.", + "type": "string" + }, + "fileContributors": { + "description": "This field provides a place for the SPDX file creator to record file contributors. Contributors could include names of copyright holders and/or authors who may not be copyright holders yet contributed to the file content.", + "type": "array", + "items": { + "description": "This field provides a place for the SPDX file creator to record file contributors. Contributors could include names of copyright holders and/or authors who may not be copyright holders yet contributed to the file content.", + "type": "string" + } + }, + "fileDependencies": { + "description": "This field is deprecated since SPDX 2.0 in favor of using Section 7 which provides more granularity about relationships.", + "type": "array", + "items": { + "description": "SPDX ID for File. This field is deprecated since SPDX 2.0 in favor of using Section 7 which provides more granularity about relationships.", + "type": "string" + } + }, + "fileName": { + "description": "The name of the file relative to the root of the package.", + "type": "string" + }, + "fileTypes": { + "description": "The type of the file.", + "type": "array", + "items": { + "description": "The type of the file.", + "type": "string", + "enum": [ + "OTHER", + "DOCUMENTATION", + "IMAGE", + "VIDEO", + "ARCHIVE", + "SPDX", + "APPLICATION", + "SOURCE", + "BINARY", + "TEXT", + "AUDIO" + ] + } + }, + "licenseComments": { + "description": "The licenseComments property allows the preparer of the SPDX document to describe why the licensing in spdx:licenseConcluded was chosen.", + "type": "string" + }, + "licenseConcluded": { + "description": "License expression for licenseConcluded. See SPDX Annex D for the license expression syntax. The licensing that the preparer of this SPDX document has concluded, based on the evidence, actually applies to the SPDX Item.\n\nIf the licenseConcluded field is not present for an SPDX Item, it implies an equivalent meaning to NOASSERTION.", + "type": "string" + }, + "licenseInfoInFiles": { + "description": "Licensing information that was discovered directly in the subject file. This is also considered a declared license for the file.\n\nIf the licenseInfoInFile field is not present for a file, it implies an equivalent meaning to NOASSERTION.", + "type": "array", + "items": { + "description": "License expression for licenseInfoInFile. See SPDX Annex D for the license expression syntax. Licensing information that was discovered directly in the subject file. This is also considered a declared license for the file.\n\nIf the licenseInfoInFile field is not present for a file, it implies an equivalent meaning to NOASSERTION.", + "type": "string" + } + }, + "noticeText": { + "description": "This field provides a place for the SPDX file creator to record potential legal notices found in the file. This may or may not include copyright statements.", + "type": "string" + } + }, + "required": [ + "SPDXID", + "checksums", + "fileName" + ], + "additionalProperties": false + } + }, + "snippets": { + "description": "Snippets referenced in the SPDX document", + "type": "array", + "items": { + "type": "object", + "properties": { + "SPDXID": { + "type": "string", + "description": "Uniquely identify any element in an SPDX document which may be referenced by other elements." + }, + "annotations": { + "description": "Provide additional information about an SpdxElement.", + "type": "array", + "items": { + "type": "object", + "properties": { + "annotationDate": { + "description": "Identify when the comment was made. This is to be specified according to the combined date and time in the UTC format, as specified in the ISO 8601 standard.", + "type": "string" + }, + "annotationType": { + "description": "Type of the annotation.", + "type": "string", + "enum": [ + "OTHER", + "REVIEW" + ] + }, + "annotator": { + "description": "This field identifies the person, organization, or tool that has commented on a file, package, snippet, or the entire document.", + "type": "string" + }, + "comment": { + "type": "string" + } + }, + "required": [ + "annotationDate", + "annotationType", + "annotator", + "comment" + ], + "additionalProperties": false, + "description": "An Annotation is a comment on an SpdxItem by an agent." + } + }, + "attributionTexts": { + "description": "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConculded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", + "type": "array", + "items": { + "description": "This field provides a place for the SPDX data creator to record acknowledgements that may be required to be communicated in some contexts. This is not meant to include the actual complete license text (see licenseConculded and licenseDeclared), and may or may not include copyright notices (see also copyrightText). The SPDX data creator may use this field to record other acknowledgements, such as particular clauses from license texts, which may be necessary or desirable to reproduce.", + "type": "string" + } + }, + "comment": { + "type": "string" + }, + "copyrightText": { + "description": "The text of copyright declarations recited in the package, file or snippet.\n\nIf the copyrightText field is not present, it implies an equivalent meaning to NOASSERTION.", + "type": "string" + }, + "licenseComments": { + "description": "The licenseComments property allows the preparer of the SPDX document to describe why the licensing in spdx:licenseConcluded was chosen.", + "type": "string" + }, + "licenseConcluded": { + "description": "License expression for licenseConcluded. See SPDX Annex D for the license expression syntax. The licensing that the preparer of this SPDX document has concluded, based on the evidence, actually applies to the SPDX Item.\n\nIf the licenseConcluded field is not present for an SPDX Item, it implies an equivalent meaning to NOASSERTION.", + "type": "string" + }, + "licenseInfoInSnippets": { + "description": "Licensing information that was discovered directly in the subject snippet. This is also considered a declared license for the snippet.\n\nIf the licenseInfoInSnippet field is not present for a snippet, it implies an equivalent meaning to NOASSERTION.", + "type": "array", + "items": { + "description": "License expression for licenseInfoInSnippet. See SPDX Annex D for the license expression syntax. Licensing information that was discovered directly in the subject snippet. This is also considered a declared license for the snippet.\n\nIf the licenseInfoInSnippet field is not present for a snippet, it implies an equivalent meaning to NOASSERTION.", + "type": "string" + } + }, + "name": { + "description": "Identify name of this SpdxElement.", + "type": "string" + }, + "ranges": { + "description": "This field defines the byte range in the original host file (in X.2) that the snippet information applies to", + "minItems": 1, + "type": "array", + "items": { + "type": "object", + "properties": { + "endPointer": { + "type": "object", + "properties": { + "reference": { + "description": "SPDX ID for File", + "type": "string" + }, + "offset": { + "type": "integer", + "description": "Byte offset in the file" + }, + "lineNumber": { + "type": "integer", + "description": "line number offset in the file" + } + }, + "required": [ + "reference" + ], + "additionalProperties": false + }, + "startPointer": { + "type": "object", + "properties": { + "reference": { + "description": "SPDX ID for File", + "type": "string" + }, + "offset": { + "type": "integer", + "description": "Byte offset in the file" + }, + "lineNumber": { + "type": "integer", + "description": "line number offset in the file" + } + }, + "required": [ + "reference" + ], + "additionalProperties": false + } + }, + "required": [ + "endPointer", + "startPointer" + ], + "additionalProperties": false + } + }, + "snippetFromFile": { + "description": "SPDX ID for File. File containing the SPDX element (e.g. the file contaning a snippet).", + "type": "string" + } + }, + "required": [ + "SPDXID", + "name", + "ranges", + "snippetFromFile" + ], + "additionalProperties": false + } + }, + "relationships": { + "description": "Relationships referenced in the SPDX document", + "type": "array", + "items": { + "type": "object", + "properties": { + "spdxElementId": { + "type": "string", + "description": "Id to which the SPDX element is related" + }, + "comment": { + "type": "string" + }, + "relatedSpdxElement": { + "description": "SPDX ID for SpdxElement. A related SpdxElement.", + "type": "string" + }, + "relationshipType": { + "description": "Describes the type of relationship between two SPDX elements.", + "type": "string", + "enum": [ + "VARIANT_OF", + "COPY_OF", + "PATCH_FOR", + "TEST_DEPENDENCY_OF", + "CONTAINED_BY", + "DATA_FILE_OF", + "OPTIONAL_COMPONENT_OF", + "ANCESTOR_OF", + "GENERATES", + "CONTAINS", + "OPTIONAL_DEPENDENCY_OF", + "FILE_ADDED", + "REQUIREMENT_DESCRIPTION_FOR", + "DEV_DEPENDENCY_OF", + "DEPENDENCY_OF", + "BUILD_DEPENDENCY_OF", + "DESCRIBES", + "PREREQUISITE_FOR", + "HAS_PREREQUISITE", + "PROVIDED_DEPENDENCY_OF", + "DYNAMIC_LINK", + "DESCRIBED_BY", + "METAFILE_OF", + "DEPENDENCY_MANIFEST_OF", + "PATCH_APPLIED", + "RUNTIME_DEPENDENCY_OF", + "TEST_OF", + "TEST_TOOL_OF", + "DEPENDS_ON", + "SPECIFICATION_FOR", + "FILE_MODIFIED", + "DISTRIBUTION_ARTIFACT", + "AMENDS", + "DOCUMENTATION_OF", + "GENERATED_FROM", + "STATIC_LINK", + "OTHER", + "BUILD_TOOL_OF", + "TEST_CASE_OF", + "PACKAGE_OF", + "DESCENDANT_OF", + "FILE_DELETED", + "EXPANDED_FROM_ARCHIVE", + "DEV_TOOL_OF", + "EXAMPLE_OF" + ] + } + }, + "required": [ + "spdxElementId", + "relatedSpdxElement", + "relationshipType" + ], + "additionalProperties": false + } + } + }, + "required": [ + "SPDXID", + "creationInfo", + "dataLicense", + "name", + "spdxVersion", + "documentNamespace" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/plugins/verifier/vulnerabilityreport/schemavalidation/testdata/trivy_scan_report.json b/plugins/verifier/vulnerabilityreport/schemavalidation/testdata/trivy_scan_report.json new file mode 100644 index 0000000000..92ee881f43 --- /dev/null +++ b/plugins/verifier/vulnerabilityreport/schemavalidation/testdata/trivy_scan_report.json @@ -0,0 +1,1889 @@ +{ + "version": "2.1.0", + "$schema": "https://json.schemastore.org/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "tool": { + "driver": { + "fullName": "Trivy Vulnerability Scanner", + "informationUri": "https://github.com/aquasecurity/trivy", + "name": "Trivy", + "rules": [ + { + "id": "CVE-2021-36159", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "" + }, + "fullDescription": { + "text": "libfetch before 2021-07-26, as used in apk-tools, xbps, and other products, mishandles numeric strings for the FTP and HTTP protocols. The FTP passive mode implementation allows an out-of-bounds read because strtol is used to parse the relevant numbers into address bytes. It does not check if the line ends prematurely. If it does, the for-loop condition checks for the '\\0' terminator one byte too late." + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-36159", + "help": { + "text": "Vulnerability CVE-2021-36159\nSeverity: CRITICAL\nPackage: apk-tools\nFixed Version: 2.10.7-r0\nLink: [CVE-2021-36159](https://avd.aquasec.com/nvd/cve-2021-36159)\nlibfetch before 2021-07-26, as used in apk-tools, xbps, and other products, mishandles numeric strings for the FTP and HTTP protocols. The FTP passive mode implementation allows an out-of-bounds read because strtol is used to parse the relevant numbers into address bytes. It does not check if the line ends prematurely. If it does, the for-loop condition checks for the '\\0' terminator one byte too late.", + "markdown": "**Vulnerability CVE-2021-36159**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|CRITICAL|apk-tools|2.10.7-r0|[CVE-2021-36159](https://avd.aquasec.com/nvd/cve-2021-36159)|\n\nlibfetch before 2021-07-26, as used in apk-tools, xbps, and other products, mishandles numeric strings for the FTP and HTTP protocols. The FTP passive mode implementation allows an out-of-bounds read because strtol is used to parse the relevant numbers into address bytes. It does not check if the line ends prematurely. If it does, the for-loop condition checks for the '\\0' terminator one byte too late." + }, + "properties": { + "precision": "very-high", + "security-severity": "9.1", + "tags": [ + "vulnerability", + "security", + "CRITICAL" + ] + } + }, + { + "id": "CVE-2021-30139", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "" + }, + "fullDescription": { + "text": "In Alpine Linux apk-tools before 2.12.5, the tarball parser allows a buffer overflow and crash." + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-30139", + "help": { + "text": "Vulnerability CVE-2021-30139\nSeverity: HIGH\nPackage: apk-tools\nFixed Version: 2.10.6-r0\nLink: [CVE-2021-30139](https://avd.aquasec.com/nvd/cve-2021-30139)\nIn Alpine Linux apk-tools before 2.12.5, the tarball parser allows a buffer overflow and crash.", + "markdown": "**Vulnerability CVE-2021-30139**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|HIGH|apk-tools|2.10.6-r0|[CVE-2021-30139](https://avd.aquasec.com/nvd/cve-2021-30139)|\n\nIn Alpine Linux apk-tools before 2.12.5, the tarball parser allows a buffer overflow and crash." + }, + "properties": { + "precision": "very-high", + "security-severity": "7.5", + "tags": [ + "vulnerability", + "security", + "HIGH" + ] + } + }, + { + "id": "CVE-2021-28831", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "busybox: invalid free or segmentation fault via malformed gzip data" + }, + "fullDescription": { + "text": "decompress_gunzip.c in BusyBox through 1.32.1 mishandles the error bit on the huft_build result pointer, with a resultant invalid free or segmentation fault, via malformed gzip data." + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-28831", + "help": { + "text": "Vulnerability CVE-2021-28831\nSeverity: HIGH\nPackage: ssl_client\nFixed Version: 1.31.1-r10\nLink: [CVE-2021-28831](https://avd.aquasec.com/nvd/cve-2021-28831)\ndecompress_gunzip.c in BusyBox through 1.32.1 mishandles the error bit on the huft_build result pointer, with a resultant invalid free or segmentation fault, via malformed gzip data.", + "markdown": "**Vulnerability CVE-2021-28831**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|HIGH|ssl_client|1.31.1-r10|[CVE-2021-28831](https://avd.aquasec.com/nvd/cve-2021-28831)|\n\ndecompress_gunzip.c in BusyBox through 1.32.1 mishandles the error bit on the huft_build result pointer, with a resultant invalid free or segmentation fault, via malformed gzip data." + }, + "properties": { + "precision": "very-high", + "security-severity": "7.5", + "tags": [ + "vulnerability", + "security", + "HIGH" + ] + } + }, + { + "id": "CVE-2021-42378", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "busybox: use-after-free in awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the getvar_i()" + }, + "fullDescription": { + "text": "A use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the getvar_i function" + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-42378", + "help": { + "text": "Vulnerability CVE-2021-42378\nSeverity: HIGH\nPackage: ssl_client\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42378](https://avd.aquasec.com/nvd/cve-2021-42378)\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the getvar_i function", + "markdown": "**Vulnerability CVE-2021-42378**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|HIGH|ssl_client|1.31.1-r11|[CVE-2021-42378](https://avd.aquasec.com/nvd/cve-2021-42378)|\n\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the getvar_i function" + }, + "properties": { + "precision": "very-high", + "security-severity": "7.2", + "tags": [ + "vulnerability", + "security", + "HIGH" + ] + } + }, + { + "id": "CVE-2021-42379", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "busybox: use-after-free in awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the next_input_file()" + }, + "fullDescription": { + "text": "A use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the next_input_file function" + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-42379", + "help": { + "text": "Vulnerability CVE-2021-42379\nSeverity: HIGH\nPackage: ssl_client\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42379](https://avd.aquasec.com/nvd/cve-2021-42379)\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the next_input_file function", + "markdown": "**Vulnerability CVE-2021-42379**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|HIGH|ssl_client|1.31.1-r11|[CVE-2021-42379](https://avd.aquasec.com/nvd/cve-2021-42379)|\n\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the next_input_file function" + }, + "properties": { + "precision": "very-high", + "security-severity": "7.2", + "tags": [ + "vulnerability", + "security", + "HIGH" + ] + } + }, + { + "id": "CVE-2021-42380", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "busybox: use-after-free in awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the clrvar()" + }, + "fullDescription": { + "text": "A use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the clrvar function" + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-42380", + "help": { + "text": "Vulnerability CVE-2021-42380\nSeverity: HIGH\nPackage: ssl_client\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42380](https://avd.aquasec.com/nvd/cve-2021-42380)\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the clrvar function", + "markdown": "**Vulnerability CVE-2021-42380**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|HIGH|ssl_client|1.31.1-r11|[CVE-2021-42380](https://avd.aquasec.com/nvd/cve-2021-42380)|\n\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the clrvar function" + }, + "properties": { + "precision": "very-high", + "security-severity": "7.2", + "tags": [ + "vulnerability", + "security", + "HIGH" + ] + } + }, + { + "id": "CVE-2021-42381", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "busybox: use-after-free in awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the hash_init()" + }, + "fullDescription": { + "text": "A use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the hash_init function" + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-42381", + "help": { + "text": "Vulnerability CVE-2021-42381\nSeverity: HIGH\nPackage: ssl_client\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42381](https://avd.aquasec.com/nvd/cve-2021-42381)\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the hash_init function", + "markdown": "**Vulnerability CVE-2021-42381**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|HIGH|ssl_client|1.31.1-r11|[CVE-2021-42381](https://avd.aquasec.com/nvd/cve-2021-42381)|\n\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the hash_init function" + }, + "properties": { + "precision": "very-high", + "security-severity": "7.2", + "tags": [ + "vulnerability", + "security", + "HIGH" + ] + } + }, + { + "id": "CVE-2021-42382", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "busybox: use-after-free in awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the getvar_s()" + }, + "fullDescription": { + "text": "A use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the getvar_s function" + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-42382", + "help": { + "text": "Vulnerability CVE-2021-42382\nSeverity: HIGH\nPackage: ssl_client\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42382](https://avd.aquasec.com/nvd/cve-2021-42382)\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the getvar_s function", + "markdown": "**Vulnerability CVE-2021-42382**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|HIGH|ssl_client|1.31.1-r11|[CVE-2021-42382](https://avd.aquasec.com/nvd/cve-2021-42382)|\n\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the getvar_s function" + }, + "properties": { + "precision": "very-high", + "security-severity": "7.2", + "tags": [ + "vulnerability", + "security", + "HIGH" + ] + } + }, + { + "id": "CVE-2021-42383", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "busybox: use-after-free in awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the evaluate()" + }, + "fullDescription": { + "text": "A use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the evaluate function" + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-42383", + "help": { + "text": "Vulnerability CVE-2021-42383\nSeverity: HIGH\nPackage: ssl_client\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42383](https://avd.aquasec.com/nvd/cve-2021-42383)\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the evaluate function", + "markdown": "**Vulnerability CVE-2021-42383**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|HIGH|ssl_client|1.31.1-r11|[CVE-2021-42383](https://avd.aquasec.com/nvd/cve-2021-42383)|\n\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the evaluate function" + }, + "properties": { + "precision": "very-high", + "security-severity": "7.2", + "tags": [ + "vulnerability", + "security", + "HIGH" + ] + } + }, + { + "id": "CVE-2021-42384", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "busybox: use-after-free in awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the handle_special()" + }, + "fullDescription": { + "text": "A use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the handle_special function" + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-42384", + "help": { + "text": "Vulnerability CVE-2021-42384\nSeverity: HIGH\nPackage: ssl_client\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42384](https://avd.aquasec.com/nvd/cve-2021-42384)\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the handle_special function", + "markdown": "**Vulnerability CVE-2021-42384**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|HIGH|ssl_client|1.31.1-r11|[CVE-2021-42384](https://avd.aquasec.com/nvd/cve-2021-42384)|\n\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the handle_special function" + }, + "properties": { + "precision": "very-high", + "security-severity": "7.2", + "tags": [ + "vulnerability", + "security", + "HIGH" + ] + } + }, + { + "id": "CVE-2021-42385", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "busybox: use-after-free in awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the evaluate()" + }, + "fullDescription": { + "text": "A use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the evaluate function" + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-42385", + "help": { + "text": "Vulnerability CVE-2021-42385\nSeverity: HIGH\nPackage: ssl_client\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42385](https://avd.aquasec.com/nvd/cve-2021-42385)\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the evaluate function", + "markdown": "**Vulnerability CVE-2021-42385**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|HIGH|ssl_client|1.31.1-r11|[CVE-2021-42385](https://avd.aquasec.com/nvd/cve-2021-42385)|\n\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the evaluate function" + }, + "properties": { + "precision": "very-high", + "security-severity": "7.2", + "tags": [ + "vulnerability", + "security", + "HIGH" + ] + } + }, + { + "id": "CVE-2021-42386", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "busybox: use-after-free in awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the nvalloc()" + }, + "fullDescription": { + "text": "A use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the nvalloc function" + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-42386", + "help": { + "text": "Vulnerability CVE-2021-42386\nSeverity: HIGH\nPackage: ssl_client\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42386](https://avd.aquasec.com/nvd/cve-2021-42386)\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the nvalloc function", + "markdown": "**Vulnerability CVE-2021-42386**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|HIGH|ssl_client|1.31.1-r11|[CVE-2021-42386](https://avd.aquasec.com/nvd/cve-2021-42386)|\n\nA use-after-free in Busybox's awk applet leads to denial of service and possibly code execution when processing a crafted awk pattern in the nvalloc function" + }, + "properties": { + "precision": "very-high", + "security-severity": "7.2", + "tags": [ + "vulnerability", + "security", + "HIGH" + ] + } + }, + { + "id": "CVE-2021-42374", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "busybox: out-of-bounds read in unlzma applet leads to information leak and denial of service when crafted LZMA-compressed input is decompressed" + }, + "fullDescription": { + "text": "An out-of-bounds heap read in Busybox's unlzma applet leads to information leak and denial of service when crafted LZMA-compressed input is decompressed. This can be triggered by any applet/format that" + }, + "defaultConfiguration": { + "level": "warning" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-42374", + "help": { + "text": "Vulnerability CVE-2021-42374\nSeverity: MEDIUM\nPackage: ssl_client\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42374](https://avd.aquasec.com/nvd/cve-2021-42374)\nAn out-of-bounds heap read in Busybox's unlzma applet leads to information leak and denial of service when crafted LZMA-compressed input is decompressed. This can be triggered by any applet/format that", + "markdown": "**Vulnerability CVE-2021-42374**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|MEDIUM|ssl_client|1.31.1-r11|[CVE-2021-42374](https://avd.aquasec.com/nvd/cve-2021-42374)|\n\nAn out-of-bounds heap read in Busybox's unlzma applet leads to information leak and denial of service when crafted LZMA-compressed input is decompressed. This can be triggered by any applet/format that" + }, + "properties": { + "precision": "very-high", + "security-severity": "5.3", + "tags": [ + "vulnerability", + "security", + "MEDIUM" + ] + } + }, + { + "id": "CVE-2021-3711", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "openssl: SM2 Decryption Buffer Overflow" + }, + "fullDescription": { + "text": "In order to decrypt SM2 encrypted data an application is expected to call the API function EVP_PKEY_decrypt(). Typically an application will call this function twice. The first time, on entry, the "out" parameter can be NULL and, on exit, the "outlen" parameter is populated with the buffer size required to hold the decrypted plaintext. The application can then allocate a sufficiently sized buffer and call EVP_PKEY_decrypt() again, but this time passing a non-NULL value for the "out" parameter. A bug in the implementation of the SM2 decryption code means that the calculation of the buffer size required to hold the plaintext returned by the first call to EVP_PKEY_decrypt() can be smaller than the actual size required by the second call. This can lead to a buffer overflow when EVP_PKEY_decrypt() is called by the application a second time with a buffer that is too small. A malicious attacker who is able present SM2 content for decryption to an application could cause attacker chosen data to overflow the buffer by up to a maximum of 62 bytes altering the contents of other data held after the buffer, possibly changing application behaviour or causing the application to crash. The location of the buffer is application dependent but is typically heap allocated. Fixed in OpenSSL 1.1.1l (Affected 1.1.1-1.1.1k)." + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-3711", + "help": { + "text": "Vulnerability CVE-2021-3711\nSeverity: CRITICAL\nPackage: libssl1.1\nFixed Version: 1.1.1l-r0\nLink: [CVE-2021-3711](https://avd.aquasec.com/nvd/cve-2021-3711)\nIn order to decrypt SM2 encrypted data an application is expected to call the API function EVP_PKEY_decrypt(). Typically an application will call this function twice. The first time, on entry, the \"out\" parameter can be NULL and, on exit, the \"outlen\" parameter is populated with the buffer size required to hold the decrypted plaintext. The application can then allocate a sufficiently sized buffer and call EVP_PKEY_decrypt() again, but this time passing a non-NULL value for the \"out\" parameter. A bug in the implementation of the SM2 decryption code means that the calculation of the buffer size required to hold the plaintext returned by the first call to EVP_PKEY_decrypt() can be smaller than the actual size required by the second call. This can lead to a buffer overflow when EVP_PKEY_decrypt() is called by the application a second time with a buffer that is too small. A malicious attacker who is able present SM2 content for decryption to an application could cause attacker chosen data to overflow the buffer by up to a maximum of 62 bytes altering the contents of other data held after the buffer, possibly changing application behaviour or causing the application to crash. The location of the buffer is application dependent but is typically heap allocated. Fixed in OpenSSL 1.1.1l (Affected 1.1.1-1.1.1k).", + "markdown": "**Vulnerability CVE-2021-3711**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|CRITICAL|libssl1.1|1.1.1l-r0|[CVE-2021-3711](https://avd.aquasec.com/nvd/cve-2021-3711)|\n\nIn order to decrypt SM2 encrypted data an application is expected to call the API function EVP_PKEY_decrypt(). Typically an application will call this function twice. The first time, on entry, the \"out\" parameter can be NULL and, on exit, the \"outlen\" parameter is populated with the buffer size required to hold the decrypted plaintext. The application can then allocate a sufficiently sized buffer and call EVP_PKEY_decrypt() again, but this time passing a non-NULL value for the \"out\" parameter. A bug in the implementation of the SM2 decryption code means that the calculation of the buffer size required to hold the plaintext returned by the first call to EVP_PKEY_decrypt() can be smaller than the actual size required by the second call. This can lead to a buffer overflow when EVP_PKEY_decrypt() is called by the application a second time with a buffer that is too small. A malicious attacker who is able present SM2 content for decryption to an application could cause attacker chosen data to overflow the buffer by up to a maximum of 62 bytes altering the contents of other data held after the buffer, possibly changing application behaviour or causing the application to crash. The location of the buffer is application dependent but is typically heap allocated. Fixed in OpenSSL 1.1.1l (Affected 1.1.1-1.1.1k)." + }, + "properties": { + "precision": "very-high", + "security-severity": "9.8", + "tags": [ + "vulnerability", + "security", + "CRITICAL" + ] + } + }, + { + "id": "CVE-2020-1967", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "openssl: Segmentation fault in SSL_check_chain causes denial of service" + }, + "fullDescription": { + "text": "Server or client applications that call the SSL_check_chain() function during or after a TLS 1.3 handshake may crash due to a NULL pointer dereference as a result of incorrect handling of the "signature_algorithms_cert" TLS extension. The crash occurs if an invalid or unrecognised signature algorithm is received from the peer. This could be exploited by a malicious peer in a Denial of Service attack. OpenSSL version 1.1.1d, 1.1.1e, and 1.1.1f are affected by this issue. This issue did not affect OpenSSL versions prior to 1.1.1d. Fixed in OpenSSL 1.1.1g (Affected 1.1.1d-1.1.1f)." + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2020-1967", + "help": { + "text": "Vulnerability CVE-2020-1967\nSeverity: HIGH\nPackage: libssl1.1\nFixed Version: 1.1.1g-r0\nLink: [CVE-2020-1967](https://avd.aquasec.com/nvd/cve-2020-1967)\nServer or client applications that call the SSL_check_chain() function during or after a TLS 1.3 handshake may crash due to a NULL pointer dereference as a result of incorrect handling of the \"signature_algorithms_cert\" TLS extension. The crash occurs if an invalid or unrecognised signature algorithm is received from the peer. This could be exploited by a malicious peer in a Denial of Service attack. OpenSSL version 1.1.1d, 1.1.1e, and 1.1.1f are affected by this issue. This issue did not affect OpenSSL versions prior to 1.1.1d. Fixed in OpenSSL 1.1.1g (Affected 1.1.1d-1.1.1f).", + "markdown": "**Vulnerability CVE-2020-1967**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|HIGH|libssl1.1|1.1.1g-r0|[CVE-2020-1967](https://avd.aquasec.com/nvd/cve-2020-1967)|\n\nServer or client applications that call the SSL_check_chain() function during or after a TLS 1.3 handshake may crash due to a NULL pointer dereference as a result of incorrect handling of the \"signature_algorithms_cert\" TLS extension. The crash occurs if an invalid or unrecognised signature algorithm is received from the peer. This could be exploited by a malicious peer in a Denial of Service attack. OpenSSL version 1.1.1d, 1.1.1e, and 1.1.1f are affected by this issue. This issue did not affect OpenSSL versions prior to 1.1.1d. Fixed in OpenSSL 1.1.1g (Affected 1.1.1d-1.1.1f)." + }, + "properties": { + "precision": "very-high", + "security-severity": "7.5", + "tags": [ + "vulnerability", + "security", + "HIGH" + ] + } + }, + { + "id": "CVE-2021-23840", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "openssl: integer overflow in CipherUpdate" + }, + "fullDescription": { + "text": "Calls to EVP_CipherUpdate, EVP_EncryptUpdate and EVP_DecryptUpdate may overflow the output length argument in some cases where the input length is close to the maximum permissible length for an integer on the platform. In such cases the return value from the function call will be 1 (indicating success), but the output length value will be negative. This could cause applications to behave incorrectly or crash. OpenSSL versions 1.1.1i and below are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1j. OpenSSL versions 1.0.2x and below are affected by this issue. However OpenSSL 1.0.2 is out of support and no longer receiving public updates. Premium support customers of OpenSSL 1.0.2 should upgrade to 1.0.2y. Other users should upgrade to 1.1.1j. Fixed in OpenSSL 1.1.1j (Affected 1.1.1-1.1.1i). Fixed in OpenSSL 1.0.2y (Affected 1.0.2-1.0.2x)." + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-23840", + "help": { + "text": "Vulnerability CVE-2021-23840\nSeverity: HIGH\nPackage: libssl1.1\nFixed Version: 1.1.1j-r0\nLink: [CVE-2021-23840](https://avd.aquasec.com/nvd/cve-2021-23840)\nCalls to EVP_CipherUpdate, EVP_EncryptUpdate and EVP_DecryptUpdate may overflow the output length argument in some cases where the input length is close to the maximum permissible length for an integer on the platform. In such cases the return value from the function call will be 1 (indicating success), but the output length value will be negative. This could cause applications to behave incorrectly or crash. OpenSSL versions 1.1.1i and below are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1j. OpenSSL versions 1.0.2x and below are affected by this issue. However OpenSSL 1.0.2 is out of support and no longer receiving public updates. Premium support customers of OpenSSL 1.0.2 should upgrade to 1.0.2y. Other users should upgrade to 1.1.1j. Fixed in OpenSSL 1.1.1j (Affected 1.1.1-1.1.1i). Fixed in OpenSSL 1.0.2y (Affected 1.0.2-1.0.2x).", + "markdown": "**Vulnerability CVE-2021-23840**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|HIGH|libssl1.1|1.1.1j-r0|[CVE-2021-23840](https://avd.aquasec.com/nvd/cve-2021-23840)|\n\nCalls to EVP_CipherUpdate, EVP_EncryptUpdate and EVP_DecryptUpdate may overflow the output length argument in some cases where the input length is close to the maximum permissible length for an integer on the platform. In such cases the return value from the function call will be 1 (indicating success), but the output length value will be negative. This could cause applications to behave incorrectly or crash. OpenSSL versions 1.1.1i and below are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1j. OpenSSL versions 1.0.2x and below are affected by this issue. However OpenSSL 1.0.2 is out of support and no longer receiving public updates. Premium support customers of OpenSSL 1.0.2 should upgrade to 1.0.2y. Other users should upgrade to 1.1.1j. Fixed in OpenSSL 1.1.1j (Affected 1.1.1-1.1.1i). Fixed in OpenSSL 1.0.2y (Affected 1.0.2-1.0.2x)." + }, + "properties": { + "precision": "very-high", + "security-severity": "7.5", + "tags": [ + "vulnerability", + "security", + "HIGH" + ] + } + }, + { + "id": "CVE-2021-3450", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "openssl: CA certificate check bypass with X509_V_FLAG_X509_STRICT" + }, + "fullDescription": { + "text": "The X509_V_FLAG_X509_STRICT flag enables additional security checks of the certificates present in a certificate chain. It is not set by default. Starting from OpenSSL version 1.1.1h a check to disallow certificates in the chain that have explicitly encoded elliptic curve parameters was added as an additional strict check. An error in the implementation of this check meant that the result of a previous check to confirm that certificates in the chain are valid CA certificates was overwritten. This effectively bypasses the check that non-CA certificates must not be able to issue other certificates. If a "purpose" has been configured then there is a subsequent opportunity for checks that the certificate is a valid CA. All of the named "purpose" values implemented in libcrypto perform this check. Therefore, where a purpose is set the certificate chain will still be rejected even when the strict flag has been used. A purpose is set by default in libssl client and server certificate verification routines, but it can be overridden or removed by an application. In order to be affected, an application must explicitly set the X509_V_FLAG_X509_STRICT verification flag and either not set a purpose for the certificate verification or, in the case of TLS client or server applications, override the default purpose. OpenSSL versions 1.1.1h and newer are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1k. OpenSSL 1.0.2 is not impacted by this issue. Fixed in OpenSSL 1.1.1k (Affected 1.1.1h-1.1.1j)." + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-3450", + "help": { + "text": "Vulnerability CVE-2021-3450\nSeverity: HIGH\nPackage: libssl1.1\nFixed Version: 1.1.1k-r0\nLink: [CVE-2021-3450](https://avd.aquasec.com/nvd/cve-2021-3450)\nThe X509_V_FLAG_X509_STRICT flag enables additional security checks of the certificates present in a certificate chain. It is not set by default. Starting from OpenSSL version 1.1.1h a check to disallow certificates in the chain that have explicitly encoded elliptic curve parameters was added as an additional strict check. An error in the implementation of this check meant that the result of a previous check to confirm that certificates in the chain are valid CA certificates was overwritten. This effectively bypasses the check that non-CA certificates must not be able to issue other certificates. If a \"purpose\" has been configured then there is a subsequent opportunity for checks that the certificate is a valid CA. All of the named \"purpose\" values implemented in libcrypto perform this check. Therefore, where a purpose is set the certificate chain will still be rejected even when the strict flag has been used. A purpose is set by default in libssl client and server certificate verification routines, but it can be overridden or removed by an application. In order to be affected, an application must explicitly set the X509_V_FLAG_X509_STRICT verification flag and either not set a purpose for the certificate verification or, in the case of TLS client or server applications, override the default purpose. OpenSSL versions 1.1.1h and newer are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1k. OpenSSL 1.0.2 is not impacted by this issue. Fixed in OpenSSL 1.1.1k (Affected 1.1.1h-1.1.1j).", + "markdown": "**Vulnerability CVE-2021-3450**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|HIGH|libssl1.1|1.1.1k-r0|[CVE-2021-3450](https://avd.aquasec.com/nvd/cve-2021-3450)|\n\nThe X509_V_FLAG_X509_STRICT flag enables additional security checks of the certificates present in a certificate chain. It is not set by default. Starting from OpenSSL version 1.1.1h a check to disallow certificates in the chain that have explicitly encoded elliptic curve parameters was added as an additional strict check. An error in the implementation of this check meant that the result of a previous check to confirm that certificates in the chain are valid CA certificates was overwritten. This effectively bypasses the check that non-CA certificates must not be able to issue other certificates. If a \"purpose\" has been configured then there is a subsequent opportunity for checks that the certificate is a valid CA. All of the named \"purpose\" values implemented in libcrypto perform this check. Therefore, where a purpose is set the certificate chain will still be rejected even when the strict flag has been used. A purpose is set by default in libssl client and server certificate verification routines, but it can be overridden or removed by an application. In order to be affected, an application must explicitly set the X509_V_FLAG_X509_STRICT verification flag and either not set a purpose for the certificate verification or, in the case of TLS client or server applications, override the default purpose. OpenSSL versions 1.1.1h and newer are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1k. OpenSSL 1.0.2 is not impacted by this issue. Fixed in OpenSSL 1.1.1k (Affected 1.1.1h-1.1.1j)." + }, + "properties": { + "precision": "very-high", + "security-severity": "7.4", + "tags": [ + "vulnerability", + "security", + "HIGH" + ] + } + }, + { + "id": "CVE-2021-3712", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "openssl: Read buffer overruns processing ASN.1 strings" + }, + "fullDescription": { + "text": "ASN.1 strings are represented internally within OpenSSL as an ASN1_STRING structure which contains a buffer holding the string data and a field holding the buffer length. This contrasts with normal C strings which are repesented as a buffer for the string data which is terminated with a NUL (0) byte. Although not a strict requirement, ASN.1 strings that are parsed using OpenSSL's own "d2i" functions (and other similar parsing functions) as well as any string whose value has been set with the ASN1_STRING_set() function will additionally NUL terminate the byte array in the ASN1_STRING structure. However, it is possible for applications to directly construct valid ASN1_STRING structures which do not NUL terminate the byte array by directly setting the "data" and "length" fields in the ASN1_STRING array. This can also happen by using the ASN1_STRING_set0() function. Numerous OpenSSL functions that print ASN.1 data have been found to assume that the ASN1_STRING byte array will be NUL terminated, even though this is not guaranteed for strings that have been directly constructed. Where an application requests an ASN.1 structure to be printed, and where that ASN.1 structure contains ASN1_STRINGs that have been directly constructed by the application without NUL terminating the "data" field, then a read buffer overrun can occur. The same thing can also occur during name constraints processing of certificates (for example if a certificate has been directly constructed by the application instead of loading it via the OpenSSL parsing functions, and the certificate contains non NUL terminated ASN1_STRING structures). It can also occur in the X509_get1_email(), X509_REQ_get1_email() and X509_get1_ocsp() functions. If a malicious actor can cause an application to directly construct an ASN1_STRING and then process it through one of the affected OpenSSL functions then this issue could be hit. This might result in a crash (causing a Denial of Service attack). It could also result in the disclosure of private memory contents (such as private keys, or sensitive plaintext). Fixed in OpenSSL 1.1.1l (Affected 1.1.1-1.1.1k). Fixed in OpenSSL 1.0.2za (Affected 1.0.2-1.0.2y)." + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-3712", + "help": { + "text": "Vulnerability CVE-2021-3712\nSeverity: HIGH\nPackage: libssl1.1\nFixed Version: 1.1.1l-r0\nLink: [CVE-2021-3712](https://avd.aquasec.com/nvd/cve-2021-3712)\nASN.1 strings are represented internally within OpenSSL as an ASN1_STRING structure which contains a buffer holding the string data and a field holding the buffer length. This contrasts with normal C strings which are repesented as a buffer for the string data which is terminated with a NUL (0) byte. Although not a strict requirement, ASN.1 strings that are parsed using OpenSSL's own \"d2i\" functions (and other similar parsing functions) as well as any string whose value has been set with the ASN1_STRING_set() function will additionally NUL terminate the byte array in the ASN1_STRING structure. However, it is possible for applications to directly construct valid ASN1_STRING structures which do not NUL terminate the byte array by directly setting the \"data\" and \"length\" fields in the ASN1_STRING array. This can also happen by using the ASN1_STRING_set0() function. Numerous OpenSSL functions that print ASN.1 data have been found to assume that the ASN1_STRING byte array will be NUL terminated, even though this is not guaranteed for strings that have been directly constructed. Where an application requests an ASN.1 structure to be printed, and where that ASN.1 structure contains ASN1_STRINGs that have been directly constructed by the application without NUL terminating the \"data\" field, then a read buffer overrun can occur. The same thing can also occur during name constraints processing of certificates (for example if a certificate has been directly constructed by the application instead of loading it via the OpenSSL parsing functions, and the certificate contains non NUL terminated ASN1_STRING structures). It can also occur in the X509_get1_email(), X509_REQ_get1_email() and X509_get1_ocsp() functions. If a malicious actor can cause an application to directly construct an ASN1_STRING and then process it through one of the affected OpenSSL functions then this issue could be hit. This might result in a crash (causing a Denial of Service attack). It could also result in the disclosure of private memory contents (such as private keys, or sensitive plaintext). Fixed in OpenSSL 1.1.1l (Affected 1.1.1-1.1.1k). Fixed in OpenSSL 1.0.2za (Affected 1.0.2-1.0.2y).", + "markdown": "**Vulnerability CVE-2021-3712**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|HIGH|libssl1.1|1.1.1l-r0|[CVE-2021-3712](https://avd.aquasec.com/nvd/cve-2021-3712)|\n\nASN.1 strings are represented internally within OpenSSL as an ASN1_STRING structure which contains a buffer holding the string data and a field holding the buffer length. This contrasts with normal C strings which are repesented as a buffer for the string data which is terminated with a NUL (0) byte. Although not a strict requirement, ASN.1 strings that are parsed using OpenSSL's own \"d2i\" functions (and other similar parsing functions) as well as any string whose value has been set with the ASN1_STRING_set() function will additionally NUL terminate the byte array in the ASN1_STRING structure. However, it is possible for applications to directly construct valid ASN1_STRING structures which do not NUL terminate the byte array by directly setting the \"data\" and \"length\" fields in the ASN1_STRING array. This can also happen by using the ASN1_STRING_set0() function. Numerous OpenSSL functions that print ASN.1 data have been found to assume that the ASN1_STRING byte array will be NUL terminated, even though this is not guaranteed for strings that have been directly constructed. Where an application requests an ASN.1 structure to be printed, and where that ASN.1 structure contains ASN1_STRINGs that have been directly constructed by the application without NUL terminating the \"data\" field, then a read buffer overrun can occur. The same thing can also occur during name constraints processing of certificates (for example if a certificate has been directly constructed by the application instead of loading it via the OpenSSL parsing functions, and the certificate contains non NUL terminated ASN1_STRING structures). It can also occur in the X509_get1_email(), X509_REQ_get1_email() and X509_get1_ocsp() functions. If a malicious actor can cause an application to directly construct an ASN1_STRING and then process it through one of the affected OpenSSL functions then this issue could be hit. This might result in a crash (causing a Denial of Service attack). It could also result in the disclosure of private memory contents (such as private keys, or sensitive plaintext). Fixed in OpenSSL 1.1.1l (Affected 1.1.1-1.1.1k). Fixed in OpenSSL 1.0.2za (Affected 1.0.2-1.0.2y)." + }, + "properties": { + "precision": "very-high", + "security-severity": "7.4", + "tags": [ + "vulnerability", + "security", + "HIGH" + ] + } + }, + { + "id": "CVE-2020-1971", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "openssl: EDIPARTYNAME NULL pointer de-reference" + }, + "fullDescription": { + "text": "The X.509 GeneralName type is a generic type for representing different types of names. One of those name types is known as EDIPartyName. OpenSSL provides a function GENERAL_NAME_cmp which compares different instances of a GENERAL_NAME to see if they are equal or not. This function behaves incorrectly when both GENERAL_NAMEs contain an EDIPARTYNAME. A NULL pointer dereference and a crash may occur leading to a possible denial of service attack. OpenSSL itself uses the GENERAL_NAME_cmp function for two purposes: 1) Comparing CRL distribution point names between an available CRL and a CRL distribution point embedded in an X509 certificate 2) When verifying that a timestamp response token signer matches the timestamp authority name (exposed via the API functions TS_RESP_verify_response and TS_RESP_verify_token) If an attacker can control both items being compared then that attacker could trigger a crash. For example if the attacker can trick a client or server into checking a malicious certificate against a malicious CRL then this may occur. Note that some applications automatically download CRLs based on a URL embedded in a certificate. This checking happens prior to the signatures on the certificate and CRL being verified. OpenSSL's s_server, s_client and verify tools have support for the "-crl_download" option which implements automatic CRL downloading and this attack has been demonstrated to work against those tools. Note that an unrelated bug means that affected versions of OpenSSL cannot parse or construct correct encodings of EDIPARTYNAME. However it is possible to construct a malformed EDIPARTYNAME that OpenSSL's parser will accept and hence trigger this attack. All OpenSSL 1.1.1 and 1.0.2 versions are affected by this issue. Other OpenSSL releases are out of support and have not been checked. Fixed in OpenSSL 1.1.1i (Affected 1.1.1-1.1.1h). Fixed in OpenSSL 1.0.2x (Affected 1.0.2-1.0.2w)." + }, + "defaultConfiguration": { + "level": "warning" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2020-1971", + "help": { + "text": "Vulnerability CVE-2020-1971\nSeverity: MEDIUM\nPackage: libssl1.1\nFixed Version: 1.1.1i-r0\nLink: [CVE-2020-1971](https://avd.aquasec.com/nvd/cve-2020-1971)\nThe X.509 GeneralName type is a generic type for representing different types of names. One of those name types is known as EDIPartyName. OpenSSL provides a function GENERAL_NAME_cmp which compares different instances of a GENERAL_NAME to see if they are equal or not. This function behaves incorrectly when both GENERAL_NAMEs contain an EDIPARTYNAME. A NULL pointer dereference and a crash may occur leading to a possible denial of service attack. OpenSSL itself uses the GENERAL_NAME_cmp function for two purposes: 1) Comparing CRL distribution point names between an available CRL and a CRL distribution point embedded in an X509 certificate 2) When verifying that a timestamp response token signer matches the timestamp authority name (exposed via the API functions TS_RESP_verify_response and TS_RESP_verify_token) If an attacker can control both items being compared then that attacker could trigger a crash. For example if the attacker can trick a client or server into checking a malicious certificate against a malicious CRL then this may occur. Note that some applications automatically download CRLs based on a URL embedded in a certificate. This checking happens prior to the signatures on the certificate and CRL being verified. OpenSSL's s_server, s_client and verify tools have support for the \"-crl_download\" option which implements automatic CRL downloading and this attack has been demonstrated to work against those tools. Note that an unrelated bug means that affected versions of OpenSSL cannot parse or construct correct encodings of EDIPARTYNAME. However it is possible to construct a malformed EDIPARTYNAME that OpenSSL's parser will accept and hence trigger this attack. All OpenSSL 1.1.1 and 1.0.2 versions are affected by this issue. Other OpenSSL releases are out of support and have not been checked. Fixed in OpenSSL 1.1.1i (Affected 1.1.1-1.1.1h). Fixed in OpenSSL 1.0.2x (Affected 1.0.2-1.0.2w).", + "markdown": "**Vulnerability CVE-2020-1971**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|MEDIUM|libssl1.1|1.1.1i-r0|[CVE-2020-1971](https://avd.aquasec.com/nvd/cve-2020-1971)|\n\nThe X.509 GeneralName type is a generic type for representing different types of names. One of those name types is known as EDIPartyName. OpenSSL provides a function GENERAL_NAME_cmp which compares different instances of a GENERAL_NAME to see if they are equal or not. This function behaves incorrectly when both GENERAL_NAMEs contain an EDIPARTYNAME. A NULL pointer dereference and a crash may occur leading to a possible denial of service attack. OpenSSL itself uses the GENERAL_NAME_cmp function for two purposes: 1) Comparing CRL distribution point names between an available CRL and a CRL distribution point embedded in an X509 certificate 2) When verifying that a timestamp response token signer matches the timestamp authority name (exposed via the API functions TS_RESP_verify_response and TS_RESP_verify_token) If an attacker can control both items being compared then that attacker could trigger a crash. For example if the attacker can trick a client or server into checking a malicious certificate against a malicious CRL then this may occur. Note that some applications automatically download CRLs based on a URL embedded in a certificate. This checking happens prior to the signatures on the certificate and CRL being verified. OpenSSL's s_server, s_client and verify tools have support for the \"-crl_download\" option which implements automatic CRL downloading and this attack has been demonstrated to work against those tools. Note that an unrelated bug means that affected versions of OpenSSL cannot parse or construct correct encodings of EDIPARTYNAME. However it is possible to construct a malformed EDIPARTYNAME that OpenSSL's parser will accept and hence trigger this attack. All OpenSSL 1.1.1 and 1.0.2 versions are affected by this issue. Other OpenSSL releases are out of support and have not been checked. Fixed in OpenSSL 1.1.1i (Affected 1.1.1-1.1.1h). Fixed in OpenSSL 1.0.2x (Affected 1.0.2-1.0.2w)." + }, + "properties": { + "precision": "very-high", + "security-severity": "5.9", + "tags": [ + "vulnerability", + "security", + "MEDIUM" + ] + } + }, + { + "id": "CVE-2021-23841", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "openssl: NULL pointer dereference in X509_issuer_and_serial_hash()" + }, + "fullDescription": { + "text": "The OpenSSL public API function X509_issuer_and_serial_hash() attempts to create a unique hash value based on the issuer and serial number data contained within an X509 certificate. However it fails to correctly handle any errors that may occur while parsing the issuer field (which might occur if the issuer field is maliciously constructed). This may subsequently result in a NULL pointer deref and a crash leading to a potential denial of service attack. The function X509_issuer_and_serial_hash() is never directly called by OpenSSL itself so applications are only vulnerable if they use this function directly and they use it on certificates that may have been obtained from untrusted sources. OpenSSL versions 1.1.1i and below are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1j. OpenSSL versions 1.0.2x and below are affected by this issue. However OpenSSL 1.0.2 is out of support and no longer receiving public updates. Premium support customers of OpenSSL 1.0.2 should upgrade to 1.0.2y. Other users should upgrade to 1.1.1j. Fixed in OpenSSL 1.1.1j (Affected 1.1.1-1.1.1i). Fixed in OpenSSL 1.0.2y (Affected 1.0.2-1.0.2x)." + }, + "defaultConfiguration": { + "level": "warning" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-23841", + "help": { + "text": "Vulnerability CVE-2021-23841\nSeverity: MEDIUM\nPackage: libssl1.1\nFixed Version: 1.1.1j-r0\nLink: [CVE-2021-23841](https://avd.aquasec.com/nvd/cve-2021-23841)\nThe OpenSSL public API function X509_issuer_and_serial_hash() attempts to create a unique hash value based on the issuer and serial number data contained within an X509 certificate. However it fails to correctly handle any errors that may occur while parsing the issuer field (which might occur if the issuer field is maliciously constructed). This may subsequently result in a NULL pointer deref and a crash leading to a potential denial of service attack. The function X509_issuer_and_serial_hash() is never directly called by OpenSSL itself so applications are only vulnerable if they use this function directly and they use it on certificates that may have been obtained from untrusted sources. OpenSSL versions 1.1.1i and below are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1j. OpenSSL versions 1.0.2x and below are affected by this issue. However OpenSSL 1.0.2 is out of support and no longer receiving public updates. Premium support customers of OpenSSL 1.0.2 should upgrade to 1.0.2y. Other users should upgrade to 1.1.1j. Fixed in OpenSSL 1.1.1j (Affected 1.1.1-1.1.1i). Fixed in OpenSSL 1.0.2y (Affected 1.0.2-1.0.2x).", + "markdown": "**Vulnerability CVE-2021-23841**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|MEDIUM|libssl1.1|1.1.1j-r0|[CVE-2021-23841](https://avd.aquasec.com/nvd/cve-2021-23841)|\n\nThe OpenSSL public API function X509_issuer_and_serial_hash() attempts to create a unique hash value based on the issuer and serial number data contained within an X509 certificate. However it fails to correctly handle any errors that may occur while parsing the issuer field (which might occur if the issuer field is maliciously constructed). This may subsequently result in a NULL pointer deref and a crash leading to a potential denial of service attack. The function X509_issuer_and_serial_hash() is never directly called by OpenSSL itself so applications are only vulnerable if they use this function directly and they use it on certificates that may have been obtained from untrusted sources. OpenSSL versions 1.1.1i and below are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1j. OpenSSL versions 1.0.2x and below are affected by this issue. However OpenSSL 1.0.2 is out of support and no longer receiving public updates. Premium support customers of OpenSSL 1.0.2 should upgrade to 1.0.2y. Other users should upgrade to 1.1.1j. Fixed in OpenSSL 1.1.1j (Affected 1.1.1-1.1.1i). Fixed in OpenSSL 1.0.2y (Affected 1.0.2-1.0.2x)." + }, + "properties": { + "precision": "very-high", + "security-severity": "5.9", + "tags": [ + "vulnerability", + "security", + "MEDIUM" + ] + } + }, + { + "id": "CVE-2021-3449", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "openssl: NULL pointer dereference in signature_algorithms processing" + }, + "fullDescription": { + "text": "An OpenSSL TLS server may crash if sent a maliciously crafted renegotiation ClientHello message from a client. If a TLSv1.2 renegotiation ClientHello omits the signature_algorithms extension (where it was present in the initial ClientHello), but includes a signature_algorithms_cert extension then a NULL pointer dereference will result, leading to a crash and a denial of service attack. A server is only vulnerable if it has TLSv1.2 and renegotiation enabled (which is the default configuration). OpenSSL TLS clients are not impacted by this issue. All OpenSSL 1.1.1 versions are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1k. OpenSSL 1.0.2 is not impacted by this issue. Fixed in OpenSSL 1.1.1k (Affected 1.1.1-1.1.1j)." + }, + "defaultConfiguration": { + "level": "warning" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-3449", + "help": { + "text": "Vulnerability CVE-2021-3449\nSeverity: MEDIUM\nPackage: libssl1.1\nFixed Version: 1.1.1k-r0\nLink: [CVE-2021-3449](https://avd.aquasec.com/nvd/cve-2021-3449)\nAn OpenSSL TLS server may crash if sent a maliciously crafted renegotiation ClientHello message from a client. If a TLSv1.2 renegotiation ClientHello omits the signature_algorithms extension (where it was present in the initial ClientHello), but includes a signature_algorithms_cert extension then a NULL pointer dereference will result, leading to a crash and a denial of service attack. A server is only vulnerable if it has TLSv1.2 and renegotiation enabled (which is the default configuration). OpenSSL TLS clients are not impacted by this issue. All OpenSSL 1.1.1 versions are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1k. OpenSSL 1.0.2 is not impacted by this issue. Fixed in OpenSSL 1.1.1k (Affected 1.1.1-1.1.1j).", + "markdown": "**Vulnerability CVE-2021-3449**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|MEDIUM|libssl1.1|1.1.1k-r0|[CVE-2021-3449](https://avd.aquasec.com/nvd/cve-2021-3449)|\n\nAn OpenSSL TLS server may crash if sent a maliciously crafted renegotiation ClientHello message from a client. If a TLSv1.2 renegotiation ClientHello omits the signature_algorithms extension (where it was present in the initial ClientHello), but includes a signature_algorithms_cert extension then a NULL pointer dereference will result, leading to a crash and a denial of service attack. A server is only vulnerable if it has TLSv1.2 and renegotiation enabled (which is the default configuration). OpenSSL TLS clients are not impacted by this issue. All OpenSSL 1.1.1 versions are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1k. OpenSSL 1.0.2 is not impacted by this issue. Fixed in OpenSSL 1.1.1k (Affected 1.1.1-1.1.1j)." + }, + "properties": { + "precision": "very-high", + "security-severity": "5.9", + "tags": [ + "vulnerability", + "security", + "MEDIUM" + ] + } + }, + { + "id": "CVE-2021-23839", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "openssl: incorrect SSLv2 rollback protection" + }, + "fullDescription": { + "text": "OpenSSL 1.0.2 supports SSLv2. If a client attempts to negotiate SSLv2 with a server that is configured to support both SSLv2 and more recent SSL and TLS versions then a check is made for a version rollback attack when unpadding an RSA signature. Clients that support SSL or TLS versions greater than SSLv2 are supposed to use a special form of padding. A server that supports greater than SSLv2 is supposed to reject connection attempts from a client where this special form of padding is present, because this indicates that a version rollback has occurred (i.e. both client and server support greater than SSLv2, and yet this is the version that is being requested). The implementation of this padding check inverted the logic so that the connection attempt is accepted if the padding is present, and rejected if it is absent. This means that such as server will accept a connection if a version rollback attack has occurred. Further the server will erroneously reject a connection if a normal SSLv2 connection attempt is made. Only OpenSSL 1.0.2 servers from version 1.0.2s to 1.0.2x are affected by this issue. In order to be vulnerable a 1.0.2 server must: 1) have configured SSLv2 support at compile time (this is off by default), 2) have configured SSLv2 support at runtime (this is off by default), 3) have configured SSLv2 ciphersuites (these are not in the default ciphersuite list) OpenSSL 1.1.1 does not have SSLv2 support and therefore is not vulnerable to this issue. The underlying error is in the implementation of the RSA_padding_check_SSLv23() function. This also affects the RSA_SSLV23_PADDING padding mode used by various other functions. Although 1.1.1 does not support SSLv2 the RSA_padding_check_SSLv23() function still exists, as does the RSA_SSLV23_PADDING padding mode. Applications that directly call that function or use that padding mode will encounter this issue. However since there is no support for the SSLv2 protocol in 1.1.1 this is considered a bug and not a security issue in that version. OpenSSL 1.0.2 is out of support and no longer receiving public updates. Premium support customers of OpenSSL 1.0.2 should upgrade to 1.0.2y. Other users should upgrade to 1.1.1j. Fixed in OpenSSL 1.0.2y (Affected 1.0.2s-1.0.2x)." + }, + "defaultConfiguration": { + "level": "note" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2021-23839", + "help": { + "text": "Vulnerability CVE-2021-23839\nSeverity: LOW\nPackage: libssl1.1\nFixed Version: 1.1.1j-r0\nLink: [CVE-2021-23839](https://avd.aquasec.com/nvd/cve-2021-23839)\nOpenSSL 1.0.2 supports SSLv2. If a client attempts to negotiate SSLv2 with a server that is configured to support both SSLv2 and more recent SSL and TLS versions then a check is made for a version rollback attack when unpadding an RSA signature. Clients that support SSL or TLS versions greater than SSLv2 are supposed to use a special form of padding. A server that supports greater than SSLv2 is supposed to reject connection attempts from a client where this special form of padding is present, because this indicates that a version rollback has occurred (i.e. both client and server support greater than SSLv2, and yet this is the version that is being requested). The implementation of this padding check inverted the logic so that the connection attempt is accepted if the padding is present, and rejected if it is absent. This means that such as server will accept a connection if a version rollback attack has occurred. Further the server will erroneously reject a connection if a normal SSLv2 connection attempt is made. Only OpenSSL 1.0.2 servers from version 1.0.2s to 1.0.2x are affected by this issue. In order to be vulnerable a 1.0.2 server must: 1) have configured SSLv2 support at compile time (this is off by default), 2) have configured SSLv2 support at runtime (this is off by default), 3) have configured SSLv2 ciphersuites (these are not in the default ciphersuite list) OpenSSL 1.1.1 does not have SSLv2 support and therefore is not vulnerable to this issue. The underlying error is in the implementation of the RSA_padding_check_SSLv23() function. This also affects the RSA_SSLV23_PADDING padding mode used by various other functions. Although 1.1.1 does not support SSLv2 the RSA_padding_check_SSLv23() function still exists, as does the RSA_SSLV23_PADDING padding mode. Applications that directly call that function or use that padding mode will encounter this issue. However since there is no support for the SSLv2 protocol in 1.1.1 this is considered a bug and not a security issue in that version. OpenSSL 1.0.2 is out of support and no longer receiving public updates. Premium support customers of OpenSSL 1.0.2 should upgrade to 1.0.2y. Other users should upgrade to 1.1.1j. Fixed in OpenSSL 1.0.2y (Affected 1.0.2s-1.0.2x).", + "markdown": "**Vulnerability CVE-2021-23839**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|LOW|libssl1.1|1.1.1j-r0|[CVE-2021-23839](https://avd.aquasec.com/nvd/cve-2021-23839)|\n\nOpenSSL 1.0.2 supports SSLv2. If a client attempts to negotiate SSLv2 with a server that is configured to support both SSLv2 and more recent SSL and TLS versions then a check is made for a version rollback attack when unpadding an RSA signature. Clients that support SSL or TLS versions greater than SSLv2 are supposed to use a special form of padding. A server that supports greater than SSLv2 is supposed to reject connection attempts from a client where this special form of padding is present, because this indicates that a version rollback has occurred (i.e. both client and server support greater than SSLv2, and yet this is the version that is being requested). The implementation of this padding check inverted the logic so that the connection attempt is accepted if the padding is present, and rejected if it is absent. This means that such as server will accept a connection if a version rollback attack has occurred. Further the server will erroneously reject a connection if a normal SSLv2 connection attempt is made. Only OpenSSL 1.0.2 servers from version 1.0.2s to 1.0.2x are affected by this issue. In order to be vulnerable a 1.0.2 server must: 1) have configured SSLv2 support at compile time (this is off by default), 2) have configured SSLv2 support at runtime (this is off by default), 3) have configured SSLv2 ciphersuites (these are not in the default ciphersuite list) OpenSSL 1.1.1 does not have SSLv2 support and therefore is not vulnerable to this issue. The underlying error is in the implementation of the RSA_padding_check_SSLv23() function. This also affects the RSA_SSLV23_PADDING padding mode used by various other functions. Although 1.1.1 does not support SSLv2 the RSA_padding_check_SSLv23() function still exists, as does the RSA_SSLV23_PADDING padding mode. Applications that directly call that function or use that padding mode will encounter this issue. However since there is no support for the SSLv2 protocol in 1.1.1 this is considered a bug and not a security issue in that version. OpenSSL 1.0.2 is out of support and no longer receiving public updates. Premium support customers of OpenSSL 1.0.2 should upgrade to 1.0.2y. Other users should upgrade to 1.1.1j. Fixed in OpenSSL 1.0.2y (Affected 1.0.2s-1.0.2x)." + }, + "properties": { + "precision": "very-high", + "security-severity": "3.7", + "tags": [ + "vulnerability", + "security", + "LOW" + ] + } + }, + { + "id": "CVE-2020-28928", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "In musl libc through 1.2.1, wcsnrtombs mishandles particular combinati ..." + }, + "fullDescription": { + "text": "In musl libc through 1.2.1, wcsnrtombs mishandles particular combinations of destination buffer size and source character limit, as demonstrated by an invalid write access (buffer overflow)." + }, + "defaultConfiguration": { + "level": "warning" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2020-28928", + "help": { + "text": "Vulnerability CVE-2020-28928\nSeverity: MEDIUM\nPackage: musl-utils\nFixed Version: 1.1.24-r3\nLink: [CVE-2020-28928](https://avd.aquasec.com/nvd/cve-2020-28928)\nIn musl libc through 1.2.1, wcsnrtombs mishandles particular combinations of destination buffer size and source character limit, as demonstrated by an invalid write access (buffer overflow).", + "markdown": "**Vulnerability CVE-2020-28928**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|MEDIUM|musl-utils|1.1.24-r3|[CVE-2020-28928](https://avd.aquasec.com/nvd/cve-2020-28928)|\n\nIn musl libc through 1.2.1, wcsnrtombs mishandles particular combinations of destination buffer size and source character limit, as demonstrated by an invalid write access (buffer overflow)." + }, + "properties": { + "precision": "very-high", + "security-severity": "5.5", + "tags": [ + "vulnerability", + "security", + "MEDIUM" + ] + } + }, + { + "id": "CVE-2022-37434", + "name": "OsPackageVulnerability", + "shortDescription": { + "text": "zlib: heap-based buffer over-read and overflow in inflate() in inflate.c via a large gzip header extra field" + }, + "fullDescription": { + "text": "zlib through 1.2.12 has a heap-based buffer over-read or buffer overflow in inflate in inflate.c via a large gzip header extra field. NOTE: only applications that call inflateGetHeader are affected. Some common applications bundle the affected zlib source code but may be unable to call inflateGetHeader (e.g., see the nodejs/node reference)." + }, + "defaultConfiguration": { + "level": "error" + }, + "helpUri": "https://avd.aquasec.com/nvd/cve-2022-37434", + "help": { + "text": "Vulnerability CVE-2022-37434\nSeverity: CRITICAL\nPackage: zlib\nFixed Version: 1.2.11-r4\nLink: [CVE-2022-37434](https://avd.aquasec.com/nvd/cve-2022-37434)\nzlib through 1.2.12 has a heap-based buffer over-read or buffer overflow in inflate in inflate.c via a large gzip header extra field. NOTE: only applications that call inflateGetHeader are affected. Some common applications bundle the affected zlib source code but may be unable to call inflateGetHeader (e.g., see the nodejs/node reference).", + "markdown": "**Vulnerability CVE-2022-37434**\n| Severity | Package | Fixed Version | Link |\n| --- | --- | --- | --- |\n|CRITICAL|zlib|1.2.11-r4|[CVE-2022-37434](https://avd.aquasec.com/nvd/cve-2022-37434)|\n\nzlib through 1.2.12 has a heap-based buffer over-read or buffer overflow in inflate in inflate.c via a large gzip header extra field. NOTE: only applications that call inflateGetHeader are affected. Some common applications bundle the affected zlib source code but may be unable to call inflateGetHeader (e.g., see the nodejs/node reference)." + }, + "properties": { + "precision": "very-high", + "security-severity": "9.8", + "tags": [ + "vulnerability", + "security", + "CRITICAL" + ] + } + } + ], + "version": "0.35.0" + } + }, + "results": [ + { + "ruleId": "CVE-2021-36159", + "ruleIndex": 0, + "level": "error", + "message": { + "text": "Package: apk-tools\nInstalled Version: 2.10.4-r3\nVulnerability CVE-2021-36159\nSeverity: CRITICAL\nFixed Version: 2.10.7-r0\nLink: [CVE-2021-36159](https://avd.aquasec.com/nvd/cve-2021-36159)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: apk-tools@2.10.4-r3" + } + } + ] + }, + { + "ruleId": "CVE-2021-30139", + "ruleIndex": 1, + "level": "error", + "message": { + "text": "Package: apk-tools\nInstalled Version: 2.10.4-r3\nVulnerability CVE-2021-30139\nSeverity: HIGH\nFixed Version: 2.10.6-r0\nLink: [CVE-2021-30139](https://avd.aquasec.com/nvd/cve-2021-30139)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: apk-tools@2.10.4-r3" + } + } + ] + }, + { + "ruleId": "CVE-2021-28831", + "ruleIndex": 2, + "level": "error", + "message": { + "text": "Package: busybox\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-28831\nSeverity: HIGH\nFixed Version: 1.31.1-r10\nLink: [CVE-2021-28831](https://avd.aquasec.com/nvd/cve-2021-28831)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: busybox@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42378", + "ruleIndex": 3, + "level": "error", + "message": { + "text": "Package: busybox\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42378\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42378](https://avd.aquasec.com/nvd/cve-2021-42378)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: busybox@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42379", + "ruleIndex": 4, + "level": "error", + "message": { + "text": "Package: busybox\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42379\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42379](https://avd.aquasec.com/nvd/cve-2021-42379)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: busybox@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42380", + "ruleIndex": 5, + "level": "error", + "message": { + "text": "Package: busybox\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42380\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42380](https://avd.aquasec.com/nvd/cve-2021-42380)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: busybox@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42381", + "ruleIndex": 6, + "level": "error", + "message": { + "text": "Package: busybox\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42381\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42381](https://avd.aquasec.com/nvd/cve-2021-42381)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: busybox@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42382", + "ruleIndex": 7, + "level": "error", + "message": { + "text": "Package: busybox\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42382\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42382](https://avd.aquasec.com/nvd/cve-2021-42382)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: busybox@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42383", + "ruleIndex": 8, + "level": "error", + "message": { + "text": "Package: busybox\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42383\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42383](https://avd.aquasec.com/nvd/cve-2021-42383)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: busybox@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42384", + "ruleIndex": 9, + "level": "error", + "message": { + "text": "Package: busybox\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42384\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42384](https://avd.aquasec.com/nvd/cve-2021-42384)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: busybox@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42385", + "ruleIndex": 10, + "level": "error", + "message": { + "text": "Package: busybox\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42385\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42385](https://avd.aquasec.com/nvd/cve-2021-42385)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: busybox@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42386", + "ruleIndex": 11, + "level": "error", + "message": { + "text": "Package: busybox\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42386\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42386](https://avd.aquasec.com/nvd/cve-2021-42386)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: busybox@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42374", + "ruleIndex": 12, + "level": "warning", + "message": { + "text": "Package: busybox\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42374\nSeverity: MEDIUM\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42374](https://avd.aquasec.com/nvd/cve-2021-42374)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: busybox@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-3711", + "ruleIndex": 13, + "level": "error", + "message": { + "text": "Package: libcrypto1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2021-3711\nSeverity: CRITICAL\nFixed Version: 1.1.1l-r0\nLink: [CVE-2021-3711](https://avd.aquasec.com/nvd/cve-2021-3711)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libcrypto1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2020-1967", + "ruleIndex": 14, + "level": "error", + "message": { + "text": "Package: libcrypto1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2020-1967\nSeverity: HIGH\nFixed Version: 1.1.1g-r0\nLink: [CVE-2020-1967](https://avd.aquasec.com/nvd/cve-2020-1967)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libcrypto1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2021-23840", + "ruleIndex": 15, + "level": "error", + "message": { + "text": "Package: libcrypto1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2021-23840\nSeverity: HIGH\nFixed Version: 1.1.1j-r0\nLink: [CVE-2021-23840](https://avd.aquasec.com/nvd/cve-2021-23840)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libcrypto1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2021-3450", + "ruleIndex": 16, + "level": "error", + "message": { + "text": "Package: libcrypto1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2021-3450\nSeverity: HIGH\nFixed Version: 1.1.1k-r0\nLink: [CVE-2021-3450](https://avd.aquasec.com/nvd/cve-2021-3450)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libcrypto1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2021-3712", + "ruleIndex": 17, + "level": "error", + "message": { + "text": "Package: libcrypto1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2021-3712\nSeverity: HIGH\nFixed Version: 1.1.1l-r0\nLink: [CVE-2021-3712](https://avd.aquasec.com/nvd/cve-2021-3712)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libcrypto1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2020-1971", + "ruleIndex": 18, + "level": "warning", + "message": { + "text": "Package: libcrypto1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2020-1971\nSeverity: MEDIUM\nFixed Version: 1.1.1i-r0\nLink: [CVE-2020-1971](https://avd.aquasec.com/nvd/cve-2020-1971)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libcrypto1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2021-23841", + "ruleIndex": 19, + "level": "warning", + "message": { + "text": "Package: libcrypto1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2021-23841\nSeverity: MEDIUM\nFixed Version: 1.1.1j-r0\nLink: [CVE-2021-23841](https://avd.aquasec.com/nvd/cve-2021-23841)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libcrypto1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2021-3449", + "ruleIndex": 20, + "level": "warning", + "message": { + "text": "Package: libcrypto1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2021-3449\nSeverity: MEDIUM\nFixed Version: 1.1.1k-r0\nLink: [CVE-2021-3449](https://avd.aquasec.com/nvd/cve-2021-3449)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libcrypto1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2021-23839", + "ruleIndex": 21, + "level": "note", + "message": { + "text": "Package: libcrypto1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2021-23839\nSeverity: LOW\nFixed Version: 1.1.1j-r0\nLink: [CVE-2021-23839](https://avd.aquasec.com/nvd/cve-2021-23839)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libcrypto1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2021-3711", + "ruleIndex": 13, + "level": "error", + "message": { + "text": "Package: libssl1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2021-3711\nSeverity: CRITICAL\nFixed Version: 1.1.1l-r0\nLink: [CVE-2021-3711](https://avd.aquasec.com/nvd/cve-2021-3711)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libssl1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2020-1967", + "ruleIndex": 14, + "level": "error", + "message": { + "text": "Package: libssl1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2020-1967\nSeverity: HIGH\nFixed Version: 1.1.1g-r0\nLink: [CVE-2020-1967](https://avd.aquasec.com/nvd/cve-2020-1967)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libssl1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2021-23840", + "ruleIndex": 15, + "level": "error", + "message": { + "text": "Package: libssl1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2021-23840\nSeverity: HIGH\nFixed Version: 1.1.1j-r0\nLink: [CVE-2021-23840](https://avd.aquasec.com/nvd/cve-2021-23840)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libssl1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2021-3450", + "ruleIndex": 16, + "level": "error", + "message": { + "text": "Package: libssl1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2021-3450\nSeverity: HIGH\nFixed Version: 1.1.1k-r0\nLink: [CVE-2021-3450](https://avd.aquasec.com/nvd/cve-2021-3450)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libssl1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2021-3712", + "ruleIndex": 17, + "level": "error", + "message": { + "text": "Package: libssl1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2021-3712\nSeverity: HIGH\nFixed Version: 1.1.1l-r0\nLink: [CVE-2021-3712](https://avd.aquasec.com/nvd/cve-2021-3712)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libssl1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2020-1971", + "ruleIndex": 18, + "level": "warning", + "message": { + "text": "Package: libssl1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2020-1971\nSeverity: MEDIUM\nFixed Version: 1.1.1i-r0\nLink: [CVE-2020-1971](https://avd.aquasec.com/nvd/cve-2020-1971)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libssl1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2021-23841", + "ruleIndex": 19, + "level": "warning", + "message": { + "text": "Package: libssl1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2021-23841\nSeverity: MEDIUM\nFixed Version: 1.1.1j-r0\nLink: [CVE-2021-23841](https://avd.aquasec.com/nvd/cve-2021-23841)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libssl1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2021-3449", + "ruleIndex": 20, + "level": "warning", + "message": { + "text": "Package: libssl1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2021-3449\nSeverity: MEDIUM\nFixed Version: 1.1.1k-r0\nLink: [CVE-2021-3449](https://avd.aquasec.com/nvd/cve-2021-3449)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libssl1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2021-23839", + "ruleIndex": 21, + "level": "note", + "message": { + "text": "Package: libssl1.1\nInstalled Version: 1.1.1d-r3\nVulnerability CVE-2021-23839\nSeverity: LOW\nFixed Version: 1.1.1j-r0\nLink: [CVE-2021-23839](https://avd.aquasec.com/nvd/cve-2021-23839)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: libssl1.1@1.1.1d-r3" + } + } + ] + }, + { + "ruleId": "CVE-2020-28928", + "ruleIndex": 22, + "level": "warning", + "message": { + "text": "Package: musl\nInstalled Version: 1.1.24-r0\nVulnerability CVE-2020-28928\nSeverity: MEDIUM\nFixed Version: 1.1.24-r3\nLink: [CVE-2020-28928](https://avd.aquasec.com/nvd/cve-2020-28928)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: musl@1.1.24-r0" + } + } + ] + }, + { + "ruleId": "CVE-2020-28928", + "ruleIndex": 22, + "level": "warning", + "message": { + "text": "Package: musl-utils\nInstalled Version: 1.1.24-r0\nVulnerability CVE-2020-28928\nSeverity: MEDIUM\nFixed Version: 1.1.24-r3\nLink: [CVE-2020-28928](https://avd.aquasec.com/nvd/cve-2020-28928)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: musl-utils@1.1.24-r0" + } + } + ] + }, + { + "ruleId": "CVE-2021-28831", + "ruleIndex": 2, + "level": "error", + "message": { + "text": "Package: ssl_client\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-28831\nSeverity: HIGH\nFixed Version: 1.31.1-r10\nLink: [CVE-2021-28831](https://avd.aquasec.com/nvd/cve-2021-28831)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: ssl_client@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42378", + "ruleIndex": 3, + "level": "error", + "message": { + "text": "Package: ssl_client\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42378\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42378](https://avd.aquasec.com/nvd/cve-2021-42378)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: ssl_client@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42379", + "ruleIndex": 4, + "level": "error", + "message": { + "text": "Package: ssl_client\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42379\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42379](https://avd.aquasec.com/nvd/cve-2021-42379)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: ssl_client@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42380", + "ruleIndex": 5, + "level": "error", + "message": { + "text": "Package: ssl_client\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42380\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42380](https://avd.aquasec.com/nvd/cve-2021-42380)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: ssl_client@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42381", + "ruleIndex": 6, + "level": "error", + "message": { + "text": "Package: ssl_client\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42381\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42381](https://avd.aquasec.com/nvd/cve-2021-42381)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: ssl_client@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42382", + "ruleIndex": 7, + "level": "error", + "message": { + "text": "Package: ssl_client\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42382\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42382](https://avd.aquasec.com/nvd/cve-2021-42382)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: ssl_client@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42383", + "ruleIndex": 8, + "level": "error", + "message": { + "text": "Package: ssl_client\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42383\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42383](https://avd.aquasec.com/nvd/cve-2021-42383)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: ssl_client@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42384", + "ruleIndex": 9, + "level": "error", + "message": { + "text": "Package: ssl_client\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42384\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42384](https://avd.aquasec.com/nvd/cve-2021-42384)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: ssl_client@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42385", + "ruleIndex": 10, + "level": "error", + "message": { + "text": "Package: ssl_client\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42385\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42385](https://avd.aquasec.com/nvd/cve-2021-42385)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: ssl_client@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42386", + "ruleIndex": 11, + "level": "error", + "message": { + "text": "Package: ssl_client\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42386\nSeverity: HIGH\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42386](https://avd.aquasec.com/nvd/cve-2021-42386)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: ssl_client@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2021-42374", + "ruleIndex": 12, + "level": "warning", + "message": { + "text": "Package: ssl_client\nInstalled Version: 1.31.1-r9\nVulnerability CVE-2021-42374\nSeverity: MEDIUM\nFixed Version: 1.31.1-r11\nLink: [CVE-2021-42374](https://avd.aquasec.com/nvd/cve-2021-42374)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: ssl_client@1.31.1-r9" + } + } + ] + }, + { + "ruleId": "CVE-2022-37434", + "ruleIndex": 23, + "level": "error", + "message": { + "text": "Package: zlib\nInstalled Version: 1.2.11-r3\nVulnerability CVE-2022-37434\nSeverity: CRITICAL\nFixed Version: 1.2.11-r4\nLink: [CVE-2022-37434](https://avd.aquasec.com/nvd/cve-2022-37434)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "helloworld", + "uriBaseId": "ROOTPATH" + }, + "region": { + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 1 + } + }, + "message": { + "text": "helloworld: zlib@1.2.11-r3" + } + } + ] + } + ], + "columnKind": "utf16CodeUnits", + "originalUriBaseIds": { + "ROOTPATH": { + "uri": "file:///" + } + } + } + ] +} \ No newline at end of file diff --git a/plugins/verifier/vulnerabilityreport/vulnerability_report.go b/plugins/verifier/vulnerabilityreport/vulnerability_report.go new file mode 100644 index 0000000000..f0b0d6e4bc --- /dev/null +++ b/plugins/verifier/vulnerabilityreport/vulnerability_report.go @@ -0,0 +1,400 @@ +/* +Copyright The Ratify Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "context" + "embed" + "encoding/json" + "fmt" + "regexp" + "strings" + "time" + + "github.com/deislabs/ratify/pkg/common" + "github.com/deislabs/ratify/pkg/ocispecs" + "github.com/deislabs/ratify/pkg/referrerstore" + _ "github.com/deislabs/ratify/pkg/referrerstore/oras" + "github.com/deislabs/ratify/pkg/verifier" + "github.com/deislabs/ratify/pkg/verifier/plugin/skel" + "github.com/deislabs/ratify/plugins/verifier/vulnerabilityreport/schemavalidation" + imagespec "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/owenrumney/go-sarif/v2/sarif" +) + +//go:embed schemavalidation/schemas +var embeddedFS embed.FS + +const ( + SarifMediaType string = "application/sarif+json" + SarifOfflineFilePath string = "schemavalidation/schemas/sarif-2.1.0.json" + TrivyScannerName string = "trivy" + GrypeScannerName string = "grype" + CreatedAnnotation string = imagespec.AnnotationCreated + SeverityRegex = `Severity:\s*(\w+)` +) + +type PluginConfig struct { + Name string `json:"name"` + SchemaURL string `json:"schemaURL,omitempty"` + MaximumAge string `json:"maximumAge,omitempty"` + DisallowedSeverity []string `json:"disallowedSeverity,omitempty"` + Passthrough bool `json:"passthrough,omitempty"` + DenylistCVEs []string `json:"denylistCVEs,omitempty"` +} + +type PluginInputConfig struct { + Config PluginConfig `json:"config"` +} + +func main() { + skel.PluginMain("vulnerabilityreport", "1.0.0", VerifyReference, []string{"1.0.0"}) +} + +func parseInput(stdin []byte) (*PluginConfig, error) { + conf := PluginInputConfig{} + + if err := json.Unmarshal(stdin, &conf); err != nil { + return nil, fmt.Errorf("failed to parse stdin for the input: %w", err) + } + + return &conf.Config, nil +} + +func VerifyReference(args *skel.CmdArgs, subjectReference common.Reference, referenceDescriptor ocispecs.ReferenceDescriptor, referrerStore referrerstore.ReferrerStore) (*verifier.VerifierResult, error) { + input, err := parseInput(args.StdinData) + if err != nil { + return nil, err + } + + // check report is newer than allowed maximum age + if input.MaximumAge != "" { + ok, created, err := validateMaximumAge(input.MaximumAge, referenceDescriptor) + if err != nil { + return &verifier.VerifierResult{ + Name: input.Name, + IsSuccess: false, + Message: fmt.Sprintf("vulnerability report validation failed: error validating maximum age:[%v]", err.Error()), + }, nil + } + if !ok { + return &verifier.VerifierResult{ + Name: input.Name, + IsSuccess: false, + Message: fmt.Sprintf("vulnerability report validation failed: report is older than maximum age:[%s]", input.MaximumAge), + Extensions: map[string]interface{}{ + CreatedAnnotation: created, + }, + }, nil + } + } + + ctx := context.Background() + + referenceManifest, err := referrerStore.GetReferenceManifest(ctx, subjectReference, referenceDescriptor) + if err != nil { + return nil, fmt.Errorf("error fetching reference manifest for subject: %s reference descriptor: %v", subjectReference, referenceDescriptor.Descriptor) + } + + if len(referenceManifest.Blobs) == 0 { + return &verifier.VerifierResult{ + Name: input.Name, + IsSuccess: false, + Message: fmt.Sprintf("vulnerability report validation failed: no blobs found for referrer %s@%s", subjectReference.Path, referenceDescriptor.Digest.String()), + }, nil + } + + blobDesc := referenceManifest.Blobs[0] + refBlob, err := referrerStore.GetBlobContent(ctx, subjectReference, blobDesc.Digest) + if err != nil { + return nil, fmt.Errorf("error fetching blob for subject:[%s] digest:[%s]", subjectReference, blobDesc.Digest) + } + + // skip all validation if passthrough is enabled + if input.Passthrough { + return &verifier.VerifierResult{ + Name: input.Name, + IsSuccess: true, + Message: "vulnerability report validation skipped", + Extensions: map[string]interface{}{ + "passthrough": true, + "report": string(refBlob), + }, + }, nil + } + + // validate json schema + err = verifyJSONSchema(blobDesc.MediaType, refBlob, input.SchemaURL) + if err != nil { + return &verifier.VerifierResult{ + Name: input.Name, + IsSuccess: false, + Message: fmt.Sprintf("vulnerability report validation failed: schema validation failed for digest:[%s],media type:[%s],parse errors:[%v]", blobDesc.Digest, blobDesc.MediaType, err.Error()), + }, nil + } + + if blobDesc.MediaType == SarifMediaType { + return processSarifReport(input, input.Name, refBlob) + } + + return &verifier.VerifierResult{ + Name: input.Name, + IsSuccess: true, + Message: "vulnerability report validation succeeded", + }, nil +} + +// verifyJSONSchema validates the json schema of the report +// if schemaURL is empty, it will use the offline schema embedded in binary +// currently only support for sarif reports +func verifyJSONSchema(mediaType string, refBlob []byte, schemaURL string) error { + if mediaType == SarifMediaType { + // decide online or offline schema type + if schemaURL != "" { + return schemavalidation.Validate(schemaURL, refBlob) + } + schemaFileBytes, err := embeddedFS.ReadFile(SarifOfflineFilePath) + if err != nil { + return fmt.Errorf("error reading offline schema file:[%s]", SarifOfflineFilePath) + } + return schemavalidation.ValidateAgainstOfflineSchema(schemaFileBytes, refBlob) + } + return fmt.Errorf("media type not configured for plugin:[%s]", mediaType) +} + +// processSarifReport processes the sarif report running individual validations as configured +func processSarifReport(input *PluginConfig, verifierName string, blob []byte) (*verifier.VerifierResult, error) { + sarifReport, err := sarif.FromBytes(blob) + if err != nil { + return &verifier.VerifierResult{ + Name: verifierName, + IsSuccess: false, + Message: fmt.Sprintf("vulnerability report validation failed: error parsing sarif report:[%v]", err.Error()), + }, nil + } + // verify that there is at least one run in the report + if len(sarifReport.Runs) < 1 { + return &verifier.VerifierResult{ + Name: verifierName, + IsSuccess: false, + Message: "vulnerability report validation failed: no runs found in sarif report", + }, nil + } + scannerName := strings.ToLower(sarifReport.Runs[0].Tool.Driver.Name) + if len(input.DenylistCVEs) > 0 { + verifierReport, err := verifyDenyListCVEs(input.Name, scannerName, sarifReport, input.DenylistCVEs) + if err != nil { + return nil, err + } + if !verifierReport.IsSuccess { + return verifierReport, nil + } + } + if len(input.DisallowedSeverity) > 0 { + verifierReport, err := verifyDisallowedSeverities(input.Name, scannerName, sarifReport, input.DisallowedSeverity) + if err != nil { + return nil, err + } + if !verifierReport.IsSuccess { + return verifierReport, nil + } + } + + return &verifier.VerifierResult{ + Name: verifierName, + IsSuccess: true, + Message: "vulnerability report validation succeeded", + Extensions: map[string]interface{}{ + "scanner": scannerName, + }, + }, nil +} + +// verifyDenyListCVEs verifies that the report does not contain any deny-listed CVEs +func verifyDenyListCVEs(verifierName string, scannerName string, sarifReport *sarif.Report, denylistCVEs []string) (*verifier.VerifierResult, error) { + denylistCVESet := make(map[string]bool) + denylistViolations := []string{} + + // convert denylistCVEs to a set for easy lookup + for _, cve := range denylistCVEs { + denylistCVESet[strings.ToLower(cve)] = false + } + + // iterate over the results and check which cves are deny-listed + for _, result := range sarifReport.Runs[0].Results { + if result.RuleID == nil || *result.RuleID == "" { + return &verifier.VerifierResult{ + Name: verifierName, + IsSuccess: false, + Message: fmt.Sprintf("vulnerability report validation failed: rule id not found for result:[%v]", result), + Extensions: map[string]interface{}{ + "scanner": scannerName, + }, + }, nil + } + ruleIDLower := strings.ToLower(*result.RuleID) + if _, ok := denylistCVESet[ruleIDLower]; ok { + denylistCVESet[ruleIDLower] = true + } + } + + // iterate over the denylistCVESet and add the deny-listed cves to the list of violations + for cve, isDenylisted := range denylistCVESet { + if isDenylisted { + denylistViolations = append(denylistViolations, cve) + } + } + + if len(denylistViolations) > 0 { + return &verifier.VerifierResult{ + Name: verifierName, + IsSuccess: false, + Extensions: map[string]interface{}{ + "scanner": scannerName, + "denylistCVEs": denylistViolations, + }, + Message: "vulnerability report validation failed", + }, nil + } + + return &verifier.VerifierResult{ + Name: verifierName, + IsSuccess: true, + Message: "vulnerability report validation succeeded", + Extensions: map[string]interface{}{ + "scanner": scannerName, + }, + }, nil +} + +// verifyDisallowedSeverities verifies that the report does not contain any disallowed severity levels +func verifyDisallowedSeverities(verifierName string, scannerName string, sarifReport *sarif.Report, disallowedSeverity []string) (*verifier.VerifierResult, error) { + ruleMap := make(map[string]*sarif.ReportingDescriptor) + violatingRules := make([]sarif.ReportingDescriptor, 0) + // create a map of rule id to rule for easy lookup + for _, rule := range sarifReport.Runs[0].Tool.Driver.Rules { + ruleMap[rule.ID] = rule + } + // iterate over the results and check if the severity is disallowed + for _, result := range sarifReport.Runs[0].Results { + if result.RuleID == nil || *result.RuleID == "" { + return &verifier.VerifierResult{ + Name: verifierName, + IsSuccess: false, + Message: fmt.Sprintf("vulnerability report validation failed: rule id not found for result:[%v]", result), + Extensions: map[string]interface{}{ + "scanner": scannerName, + }, + }, nil + } + rule, ok := ruleMap[*result.RuleID] + if !ok { + return &verifier.VerifierResult{ + Name: verifierName, + IsSuccess: false, + Message: fmt.Sprintf("vulnerability report validation failed: rule not found for result:[%v]", result), + Extensions: map[string]interface{}{ + "scanner": scannerName, + }, + }, nil + } + severity, err := extractSeverity(scannerName, *rule) + if err != nil { + return &verifier.VerifierResult{ + Name: verifierName, + IsSuccess: false, + Message: fmt.Sprintf("vulnerability report validation failed: error extracting severity:[%v]", err.Error()), + Extensions: map[string]interface{}{ + "scanner": scannerName, + }, + }, nil + } + // check if the severity is disallowed and add it to the list of violating rules + for _, disallowed := range disallowedSeverity { + if strings.EqualFold(severity, disallowed) { + violatingRules = append(violatingRules, *rule) + } + } + } + // if there are violating rules, return them as custom extension field + if len(violatingRules) > 0 { + return &verifier.VerifierResult{ + Name: verifierName, + IsSuccess: false, + Extensions: map[string]interface{}{ + "scanner": scannerName, + "severityViolations": violatingRules, + }, + Message: "vulnerability report validation failed", + }, nil + } + return &verifier.VerifierResult{ + Name: verifierName, + IsSuccess: true, + Message: "vulnerability report validation succeeded", + Extensions: map[string]interface{}{ + "scanner": scannerName, + }, + }, nil +} + +// extractSeverity extracts the severity from the rule help text using regex +// relies on the help text being in the format "Severity: " +// currently only supports trivy and grype scanners +func extractSeverity(scannerName string, rule sarif.ReportingDescriptor) (string, error) { + if scannerName == TrivyScannerName || scannerName == GrypeScannerName { + if rule.Help == nil || rule.Help.Text == nil || *rule.Help.Text == "" { + return "", fmt.Errorf("help text not found for rule:[%s]", rule.ID) + } + re := regexp.MustCompile(SeverityRegex) + match := re.FindStringSubmatch(*rule.Help.Text) + if len(match) < 2 { + return "", fmt.Errorf("severity not found in help text:[%s]", *rule.Help.Text) + } + return strings.ToLower(match[1]), nil + } + return "", fmt.Errorf("scanner not supported:[%s]", scannerName) +} + +// validateMaximumAge validates that the report is newer than the allowed maximum age +// extracts the created timestamp from the descriptor annotations +func validateMaximumAge(maximumAge string, descriptor ocispecs.ReferenceDescriptor) (bool, string, error) { + // check if annotations exist + if descriptor.Annotations == nil { + return false, "", fmt.Errorf("no annotations found for descriptor:[%v]", descriptor) + } + // check if created annotation exists + created, ok := descriptor.Annotations[CreatedAnnotation] + if !ok { + return false, "", fmt.Errorf("created annotation not found for descriptor:[%v]", descriptor) + } + // check if created annotation is a valid timestamp + createdTime, err := time.Parse(time.RFC3339, created) + if err != nil { + return false, "", fmt.Errorf("error parsing created timestamp:[%s]", created) + } + // check if maxium age is a valid duration + duration, err := time.ParseDuration(maximumAge) + if err != nil { + return false, "", fmt.Errorf("error parsing maximum age:[%s]", maximumAge) + } + // check if created timestamp is older than maximum age + if time.Since(createdTime) > duration { + return false, created, nil + } + + return true, created, nil +} diff --git a/plugins/verifier/vulnerabilityreport/vulnerability_report_test.go b/plugins/verifier/vulnerabilityreport/vulnerability_report_test.go new file mode 100644 index 0000000000..41113af3c6 --- /dev/null +++ b/plugins/verifier/vulnerabilityreport/vulnerability_report_test.go @@ -0,0 +1,783 @@ +/* +Copyright The Ratify Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "fmt" + "testing" + "time" + + "github.com/deislabs/ratify/pkg/ocispecs" + oci "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/owenrumney/go-sarif/v2/sarif" +) + +const sampleSarifReport string = `{ + "version": "2.1.0", + "$schema": "https://json.schemastore.org/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "tool": { + "driver": { + "name": "grype", + "version": "0.71.0", + "informationUri": "https://github.com/anchore/grype", + "rules": [ + { + "id": "CVE-2022-48174-busybox", + "name": "ApkMatcherExactDirectMatch", + "help": { + "text": "Vulnerability CVE-2022-48174\nSeverity: critical\nPackage: busybox\nVersion: 1.36.1-r0\nFix Version: 1.36.1-r1\nType: apk\nLocation: /lib/apk/db/installed\nData Namespace: alpine:distro:alpine:3.18\nLink: [CVE-2022-48174](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-48174)", + "markdown": "**Vulnerability CVE-2022-48174**\n| Severity | Package | Version | Fix Version | Type | Location | Data Namespace | Link |\n| --- | --- | --- | --- | --- | --- | --- | --- |\n| critical | busybox | 1.36.1-r0 | 1.36.1-r1 | apk | /lib/apk/db/installed | alpine:distro:alpine:3.18 | [CVE-2022-48174](http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-48174) |\n" + }, + "properties": { + "security-severity": "9.8" + } + } + ] + } + }, + "results": [ + { + "ruleId": "CVE-2022-48174-busybox", + "message": { + "text": "The path /lib/apk/db/installed reports busybox at version 1.36.1-r0 which is a vulnerable (apk) package installed in the container" + } + } + ] + } + ] +}` + +// TestVerifyJSONSchema tests the verifyJSONSchema function +func TestVerifyJSONSchema(t *testing.T) { + type args struct { + mediaType string + refBlobContent string + schemaURL string + } + type want struct { + err error + } + tests := []struct { + name string + args args + want want + }{ + { + name: "unsupported media type", + args: args{ + mediaType: "unsupported", + }, + want: want{ + err: fmt.Errorf("media type not configured for plugin:[%s]", "unsupported"), + }, + }, + { + name: "online verification success", + args: args{ + mediaType: SarifMediaType, + refBlobContent: sampleSarifReport, + schemaURL: "https://json.schemastore.org/sarif-2.1.0-rtm.5.json", + }, + want: want{ + err: nil, + }, + }, + { + name: "offline verification success", + args: args{ + mediaType: SarifMediaType, + refBlobContent: sampleSarifReport, + }, + want: want{ + err: nil, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := verifyJSONSchema(tt.args.mediaType, []byte(tt.args.refBlobContent), tt.args.schemaURL) + if err != nil && err.Error() != tt.want.err.Error() { + t.Errorf("verifyJSONSchema() error = %v, wantErr %v", err, tt.want.err) + return + } + }) + } +} + +// TestProcessSarifReport tests the processSarifReport function +func TestProcessSarifReport(t *testing.T) { + type args struct { + input PluginConfig + blobContent string + } + type want struct { + message string + err error + } + tests := []struct { + name string + args args + want want + }{ + { + name: "invalid blob", + args: args{ + input: PluginConfig{}, + blobContent: "invalid", + }, + want: want{ + message: fmt.Sprintf("vulnerability report validation failed: error parsing sarif report:[%s]", "invalid character 'i' looking for beginning of value"), + err: nil, + }, + }, + { + name: "no runs in sarif report", + args: args{ + input: PluginConfig{}, + blobContent: `{ + "version": "2.1.0", + "$schema": "https://json.schemastore.org/sarif-2.1.0-rtm.5.json", + "runs": [] +}`, + }, + want: want{ + message: "vulnerability report validation failed: no runs found in sarif report", + err: nil, + }, + }, + { + name: "deny list CVE found", + args: args{ + input: PluginConfig{ + Name: "test_verifier", + DenylistCVEs: []string{"CVE-2022-48174-busybox"}, + }, + blobContent: sampleSarifReport, + }, + want: want{ + message: "vulnerability report validation failed", + err: nil, + }, + }, + { + name: "disallowed severity CVE found", + args: args{ + input: PluginConfig{ + Name: "test_verifier", + DenylistCVEs: []string{"CVE-2022-48174"}, + DisallowedSeverity: []string{ + "critical", + }, + }, + blobContent: sampleSarifReport, + }, + want: want{ + message: "vulnerability report validation failed", + err: nil, + }, + }, + { + name: "vulnerability report validation succeeded", + args: args{ + input: PluginConfig{ + Name: "test_verifier", + DenylistCVEs: []string{"CVE-2022-48174"}, + DisallowedSeverity: []string{ + "high", + }, + }, + blobContent: sampleSarifReport, + }, + want: want{ + message: "vulnerability report validation succeeded", + err: nil, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + verifierReport, err := processSarifReport(&tt.args.input, "sample_verifier", []byte(tt.args.blobContent)) + if err != nil && err.Error() != tt.want.err.Error() { + t.Errorf("processSarifReport() error = %v, wantErr %v", err, tt.want.err) + return + } + if verifierReport.Message != tt.want.message { + t.Errorf("processSarifReport() verifier report message = %s, want %s", verifierReport.Message, tt.want.message) + return + } + }) + } +} + +// TestVerifyDenyListCVEs tests the verifyDenyListCVEs function +func TestVerifyDenyListCVEs(t *testing.T) { + validRuleID := "CVE-2021-1234" + type args struct { + denyListCVEs []string + sarifReport sarif.Report + } + type want struct { + message string + err error + } + tests := []struct { + name string + args args + want want + }{ + { + name: "rule ID does not exist for result", + args: args{ + denyListCVEs: []string{validRuleID}, + sarifReport: sarif.Report{ + Runs: []*sarif.Run{ + { + Tool: sarif.Tool{ + Driver: &sarif.ToolComponent{ + Name: TrivyScannerName, + Rules: []*sarif.ReportingDescriptor{ + { + ID: validRuleID, + }, + }, + }, + }, + Results: []*sarif.Result{ + {}, + }, + }, + }, + }, + }, + want: want{ + message: fmt.Sprintf("vulnerability report validation failed: rule id not found for result:[%v]", &sarif.Result{}), + err: nil, + }, + }, + { + name: "deny list CVEs found", + args: args{ + denyListCVEs: []string{validRuleID}, + sarifReport: sarif.Report{ + Runs: []*sarif.Run{ + { + Tool: sarif.Tool{ + Driver: &sarif.ToolComponent{ + Name: TrivyScannerName, + Rules: []*sarif.ReportingDescriptor{ + { + ID: validRuleID, + }, + }, + }, + }, + Results: []*sarif.Result{ + { + RuleID: &validRuleID, + }, + }, + }, + }, + }, + }, + want: want{ + message: "vulnerability report validation failed", + err: nil, + }, + }, + { + name: "no deny list CVEs found", + args: args{ + denyListCVEs: []string{"CVE-2021-123456"}, + sarifReport: sarif.Report{ + Runs: []*sarif.Run{ + { + Tool: sarif.Tool{ + Driver: &sarif.ToolComponent{ + Name: TrivyScannerName, + Rules: []*sarif.ReportingDescriptor{ + { + ID: validRuleID, + }, + }, + }, + }, + Results: []*sarif.Result{ + { + RuleID: &validRuleID, + }, + }, + }, + }, + }, + }, + want: want{ + message: "vulnerability report validation succeeded", + err: nil, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + verifierReport, err := verifyDenyListCVEs("test_verifier", TrivyScannerName, &tt.args.sarifReport, tt.args.denyListCVEs) + if err != nil && err.Error() != tt.want.err.Error() { + t.Errorf("verifyDenyListCVEs() error = %v, wantErr %v", err, tt.want.err) + return + } + if verifierReport.Message != tt.want.message { + t.Errorf("verifyDenyListCVEs() verifier report message = %s, want %s", verifierReport.Message, tt.want.message) + return + } + }) + } +} + +// TestVerifyDisallowedSeverities tests the verifyDisallowedSeverities function +func TestVerifyDisallowedSeverities(t *testing.T) { + validSeverityText := "Severity: HIGH" + invalidSeverityText := "invalid severity text" + validRuleID := "RULEID" + invalidRuleID := "invalid_rule_id" + type args struct { + disallowedSeverities []string + sarifReport sarif.Report + } + type want struct { + message string + err error + } + tests := []struct { + name string + args args + want want + }{ + { + name: "rule ID does not exist for result", + args: args{ + disallowedSeverities: []string{"high"}, + sarifReport: sarif.Report{ + Runs: []*sarif.Run{ + { + Tool: sarif.Tool{ + Driver: &sarif.ToolComponent{ + Name: "scanner_name", + Rules: []*sarif.ReportingDescriptor{ + { + ID: validRuleID, + Help: &sarif.MultiformatMessageString{ + Text: &validSeverityText, + PropertyBag: *sarif.NewPropertyBag(), + }, + }, + }, + }, + }, + Results: []*sarif.Result{ + {}, + }, + }, + }, + }, + }, + want: want{ + message: fmt.Sprintf("vulnerability report validation failed: rule id not found for result:[%v]", &sarif.Result{}), + err: nil, + }, + }, + { + name: "rule ID not found for result", + args: args{ + disallowedSeverities: []string{"high"}, + sarifReport: sarif.Report{ + Runs: []*sarif.Run{ + { + Tool: sarif.Tool{ + Driver: &sarif.ToolComponent{ + Name: "scanner_name", + Rules: []*sarif.ReportingDescriptor{ + { + ID: validRuleID, + Help: &sarif.MultiformatMessageString{ + Text: &validSeverityText, + PropertyBag: *sarif.NewPropertyBag(), + }, + }, + }, + }, + }, + Results: []*sarif.Result{ + { + RuleID: &invalidRuleID, + }, + }, + }, + }, + }, + }, + want: want{ + message: fmt.Sprintf("vulnerability report validation failed: rule not found for result:[%v]", &sarif.Result{RuleID: &invalidRuleID}), + err: nil, + }, + }, + { + name: "invalid severity extraction", + args: args{ + disallowedSeverities: []string{"high"}, + sarifReport: sarif.Report{ + Runs: []*sarif.Run{ + { + Tool: sarif.Tool{ + Driver: &sarif.ToolComponent{ + Name: TrivyScannerName, + Rules: []*sarif.ReportingDescriptor{ + { + ID: validRuleID, + Help: &sarif.MultiformatMessageString{ + Text: &invalidSeverityText, + PropertyBag: *sarif.NewPropertyBag(), + }, + }, + }, + }, + }, + Results: []*sarif.Result{ + { + RuleID: &validRuleID, + }, + }, + }, + }, + }, + }, + want: want{ + message: fmt.Sprintf("vulnerability report validation failed: error extracting severity:[severity not found in help text:[%s]]", invalidSeverityText), + err: nil, + }, + }, + { + name: "disallowed severities found", + args: args{ + disallowedSeverities: []string{"high"}, + sarifReport: sarif.Report{ + Runs: []*sarif.Run{ + { + Tool: sarif.Tool{ + Driver: &sarif.ToolComponent{ + Name: TrivyScannerName, + Rules: []*sarif.ReportingDescriptor{ + { + ID: validRuleID, + Help: &sarif.MultiformatMessageString{ + Text: &validSeverityText, + PropertyBag: *sarif.NewPropertyBag(), + }, + }, + }, + }, + }, + Results: []*sarif.Result{ + { + RuleID: &validRuleID, + }, + }, + }, + }, + }, + }, + want: want{ + message: "vulnerability report validation failed", + err: nil, + }, + }, + { + name: "vulnerability report validation succeeded", + args: args{ + disallowedSeverities: []string{"critical"}, + sarifReport: sarif.Report{ + Runs: []*sarif.Run{ + { + Tool: sarif.Tool{ + Driver: &sarif.ToolComponent{ + Name: TrivyScannerName, + Rules: []*sarif.ReportingDescriptor{ + { + ID: validRuleID, + Help: &sarif.MultiformatMessageString{ + Text: &validSeverityText, + PropertyBag: *sarif.NewPropertyBag(), + }, + }, + }, + }, + }, + Results: []*sarif.Result{ + { + RuleID: &validRuleID, + }, + }, + }, + }, + }, + }, + want: want{ + message: "vulnerability report validation succeeded", + err: nil, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + verifierReport, err := verifyDisallowedSeverities("test_verifier", TrivyScannerName, &tt.args.sarifReport, tt.args.disallowedSeverities) + if err != nil && err.Error() != tt.want.err.Error() { + t.Errorf("verifyDisallowedSeverities() error = %v, wantErr %v", err, tt.want.err) + return + } + if verifierReport.Message != tt.want.message { + t.Errorf("verifyDisallowedSeverities() verifier report message = %s, want %s", verifierReport.Message, tt.want.message) + return + } + }) + } +} + +// TestExtractSeverity tests the extractSeverity function +func TestExtractSeverity(t *testing.T) { + validSeverityText := "Severity: HIGH" + invalidSeverityText := "invalid severity text" + type args struct { + scannerName string + rule sarif.ReportingDescriptor + } + type want struct { + severity string + err error + } + tests := []struct { + name string + args args + want want + }{ + { + name: "unsupported scanner", + args: args{ + scannerName: "unsupported", + rule: sarif.ReportingDescriptor{}, + }, + want: want{ + severity: "", + err: fmt.Errorf("scanner not supported:[%s]", "unsupported"), + }, + }, + { + name: "no rule help text", + args: args{ + scannerName: TrivyScannerName, + rule: sarif.ReportingDescriptor{ + ID: "RULEID", + }, + }, + want: want{ + severity: "", + err: fmt.Errorf("help text not found for rule:[%s]", "RULEID"), + }, + }, + { + name: "severity not found in help text", + args: args{ + scannerName: TrivyScannerName, + rule: sarif.ReportingDescriptor{ + ID: "RULEID", + Help: &sarif.MultiformatMessageString{ + Text: &invalidSeverityText, + PropertyBag: *sarif.NewPropertyBag(), + }, + }, + }, + want: want{ + severity: "", + err: fmt.Errorf("severity not found in help text:[%s]", invalidSeverityText), + }, + }, + { + name: "severity not found in help text", + args: args{ + scannerName: TrivyScannerName, + rule: sarif.ReportingDescriptor{ + ID: "RULEID", + Help: &sarif.MultiformatMessageString{ + Text: &validSeverityText, + PropertyBag: *sarif.NewPropertyBag(), + }, + }, + }, + want: want{ + severity: "high", + err: nil, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + severity, err := extractSeverity(tt.args.scannerName, tt.args.rule) + if err != nil && err.Error() != tt.want.err.Error() { + t.Errorf("extractSeverity() error = %v, wantErr %v", err, tt.want.err) + return + } + if severity != tt.want.severity { + t.Errorf("extractSeverity() severity = %v, want %v", severity, tt.want.severity) + } + }) + } +} + +// TestValidateMaxiumAge tests the validateMaximumAge function +func TestValidateMaxiumAge(t *testing.T) { + timeNow := time.Now().Format(time.RFC3339) + type args struct { + maximumAge string + desc ocispecs.ReferenceDescriptor + } + type want struct { + valid bool + created string + err error + } + tests := []struct { + name string + args args + want want + }{ + { + name: "valid maximum age, no annotations", + args: args{ + maximumAge: "24h", + desc: ocispecs.ReferenceDescriptor{ + Descriptor: oci.Descriptor{}, + }, + }, + want: want{ + valid: false, + err: fmt.Errorf("no annotations found for descriptor:[%v]", ocispecs.ReferenceDescriptor{Descriptor: oci.Descriptor{}}), + created: "", + }, + }, + { + name: "valid maximum age, empty annotations", + args: args{ + maximumAge: "24h", + desc: ocispecs.ReferenceDescriptor{ + Descriptor: oci.Descriptor{ + Annotations: map[string]string{}, + }, + }, + }, + want: want{ + valid: false, + err: fmt.Errorf("created annotation not found for descriptor:[%v]", ocispecs.ReferenceDescriptor{Descriptor: oci.Descriptor{Annotations: map[string]string{}}}), + created: "", + }, + }, + { + name: "valid maximum age, invalid created annotation", + args: args{ + maximumAge: "24h", + desc: ocispecs.ReferenceDescriptor{ + Descriptor: oci.Descriptor{ + Annotations: map[string]string{ + "org.opencontainers.image.created": "invalid", + }, + }, + }, + }, + want: want{ + valid: false, + err: fmt.Errorf("error parsing created timestamp:[%s]", "invalid"), + created: "", + }, + }, + { + name: "invalid maximum age, valid created annotation", + args: args{ + maximumAge: "1d", + desc: ocispecs.ReferenceDescriptor{ + Descriptor: oci.Descriptor{ + Annotations: map[string]string{ + "org.opencontainers.image.created": "2021-01-01T00:00:00Z", + }, + }, + }, + }, + want: want{ + valid: false, + err: fmt.Errorf("error parsing maximum age:[%s]", "1d"), + created: "", + }, + }, + { + name: "valid maximum age, valid created annotation, created is older than maximum age", + args: args{ + maximumAge: "24h", + desc: ocispecs.ReferenceDescriptor{ + Descriptor: oci.Descriptor{ + Annotations: map[string]string{ + "org.opencontainers.image.created": "2021-01-05T00:00:00Z", + }, + }, + }, + }, + want: want{ + valid: false, + err: nil, + created: "2021-01-05T00:00:00Z", + }, + }, + { + name: "valid maximum age, valid created annotation, created is newer than maximum age", + args: args{ + maximumAge: "24h", + desc: ocispecs.ReferenceDescriptor{ + Descriptor: oci.Descriptor{ + Annotations: map[string]string{ + "org.opencontainers.image.created": timeNow, + }, + }, + }, + }, + want: want{ + valid: true, + err: nil, + created: timeNow, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + valid, created, err := validateMaximumAge(tt.args.maximumAge, tt.args.desc) + if err != nil && err.Error() != tt.want.err.Error() { + t.Errorf("validateMaxiumAge() error = %v, wantErr %v", err, tt.want.err) + return + } + if valid != tt.want.valid { + t.Errorf("validateMaxiumAge() valid = %v, want %v", valid, tt.want.valid) + } + if created != tt.want.created { + t.Errorf("validateMaxiumAge() created = %v, want %v", created, tt.want.created) + } + }) + } +} diff --git a/scripts/azure-ci-test.sh b/scripts/azure-ci-test.sh index 3e6be78a31..b652f1cd77 100755 --- a/scripts/azure-ci-test.sh +++ b/scripts/azure-ci-test.sh @@ -40,7 +40,7 @@ REGISTRY="${ACR_NAME}.azurecr.io" build_push_to_acr() { echo "Building and pushing images to ACR" - docker build --progress=plain --no-cache --build-arg build_cosign=true --build-arg build_sbom=true --build-arg build_licensechecker=true --build-arg build_schemavalidator=true -f ./httpserver/Dockerfile -t "${ACR_NAME}.azurecr.io/test/localbuild:${TAG}" . + docker build --progress=plain --no-cache --build-arg build_cosign=true --build-arg build_sbom=true --build-arg build_licensechecker=true --build-arg build_schemavalidator=true --build-arg build_vulnerabilityreport=true -f ./httpserver/Dockerfile -t "${ACR_NAME}.azurecr.io/test/localbuild:${TAG}" . docker push "${REGISTRY}/test/localbuild:${TAG}" docker build --progress=plain --no-cache --build-arg KUBE_VERSION=${KUBERNETES_VERSION} --build-arg TARGETOS="linux" --build-arg TARGETARCH="amd64" -f crd.Dockerfile -t "${ACR_NAME}.azurecr.io/test/localbuildcrd:${TAG}" ./charts/ratify/crds