Skip to content

Conversation

@senglezou
Copy link
Contributor

@senglezou senglezou commented Sep 11, 2025

Osv Scanner currently reports raw findings in the following example format:

          {
            "ruleId": "CVE-2025-22869",
            "ruleIndex": 0,
            "level": "warning",
            "message": {
              "text": .......')."
            },
            "locations": [
              {
                "physicalLocation": {
                  "artifactLocation": {
                    "uri": "file:///code/sample/go.mod"
                  }
                }
              }
            ]
          },

This the translate to the following log which is not ideal

{
        "activityId": "ACTIVITY_ID_CREATE",
        "activityName": "ACTIVITY_ID_CREATE",
        "categoryName": "CATEGORY_UID_FINDINGS",
        "categoryUid": "CATEGORY_UID_FINDINGS",
        "className": "CLASS_UID_VULNERABILITY_FINDING",
        "classUid": "CLASS_UID_VULNERABILITY_FINDING",
        "confidence": "CONFIDENCE_ID_UNKNOWN",
        "confidenceId": "CONFIDENCE_ID_UNKNOWN",
        "count": 1,
        "findingInfo": {
            "createdTime": "1757519922",
            "createdTimeDt": "2025-09-10T15:58:42.728397885Z",
            "dataSources": [
                "{\"targetType\":\"TARGET_TYPE_REPOSITORY\",\"uri\":{\"uriSchema\":\"URI_SCHEMA_FILE\",\"path\":\"file://file:///workspace/source-code/repo/go.sum\"},\"sourceCodeMetadata\":{\"repositoryUrl\":\"https://github.com/smithy-security/go-dvwa\"}}"
            ],
            "firstSeenTime": "1757519922",
            "firstSeenTimeDt": "2025-09-10T15:58:42.728397885Z",
            "lastSeenTime": "1757519922",
            "lastSeenTimeDt": "2025-09-10T15:58:42.728397885Z",
            "modifiedTime": "1757519922",
            "modifiedTimeDt": "2025-09-10T15:58:42.728397885Z",
            "productUid": "osv-scanner",
            "title": "CVE-2023-3978: Improper rendering of text nodes in golang.org/x/net/html",
            "uid": "CVE-2023-3978"
        },
        "metadata": {
            "eventCode": "CVE-2023-3978",
            "product": {
                "name": "osv-scanner"
            },
            "uid": "45a6439f-280d-5eff-9917-4790beb3084a"
        },
        "severity": "SEVERITY_ID_MEDIUM",
        "severityId": "SEVERITY_ID_MEDIUM",
        "startTime": "1757519922",
        "status": "STATUS_ID_NEW",
        "statusId": "STATUS_ID_NEW",
        "time": "1757519922",
        "timeDt": "2025-09-10T15:58:42.728397885Z",
        "typeName": "Create",
        "typeUid": "200201",
        "vulnerabilities": [
            {
                "affectedCode": [
                    {
                        "file": {
                            "name": "file:///workspace/source-code/repo/go.sum",
                            "path": "file://file:///workspace/source-code/repo/go.sum"
                        }
                    }
                ],
    },

The aim of this PR will be to fix this

@northdpole northdpole force-pushed the SAAS-7700-add-prefix-check branch from 7cdf365 to 782ac36 Compare September 12, 2025 14:55
@northdpole northdpole force-pushed the SAAS-7700-add-prefix-check branch from 782ac36 to e00a7d9 Compare September 12, 2025 15:30
@northdpole northdpole force-pushed the SAAS-7700-add-prefix-check branch 3 times, most recently from 0d0aa21 to da27375 Compare September 12, 2025 17:08
@ptzianos ptzianos force-pushed the SAAS-7700-add-prefix-check branch 2 times, most recently from f1d5f62 to 446fd90 Compare September 15, 2025 17:14
@ptzianos ptzianos changed the title very wip for adding prefix checks Add stricter checks and normalisation of source code paths (Fixes SaaS-7700) Sep 15, 2025
@ptzianos ptzianos force-pushed the SAAS-7700-add-prefix-check branch from 446fd90 to 93371fd Compare September 15, 2025 17:36
@ptzianos ptzianos force-pushed the SAAS-7700-add-prefix-check branch from 93371fd to 28208af Compare September 16, 2025 09:47
path is of the form "file://<relative path to an option workspace root>"
@ptzianos ptzianos force-pushed the SAAS-7700-add-prefix-check branch from 28208af to 20b3566 Compare September 16, 2025 09:57
@ptzianos ptzianos merged commit 9add00e into main Sep 16, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants