Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sarif output should use the final schema version #2017

Open
1 of 3 tasks
C-Side opened this issue Apr 10, 2024 · 2 comments
Open
1 of 3 tasks

Sarif output should use the final schema version #2017

C-Side opened this issue Apr 10, 2024 · 2 comments

Comments

@C-Side
Copy link

C-Side commented Apr 10, 2024

Summary

When the sarif output is used it will use the schema https://json.schemastore.org/sarif-2.1.0-rtm.5.json which is apparently now deprecated because a final version was released. The correct schema should be https://json.schemastore.org/sarif-2.1.0.json.

Steps to reproduce:

  1. run tflint anywhere with the -f=sarif flag set
  2. See the output use the schema "$schema": "https://json.schemastore.org/sarif-2.1.0-rtm.5.json"

I got the info from this validator which prints:
SARIF1011: The '$schema' property must refer to the final version of the SARIF 2.1.0 schema. This enables IDEs to provide Intellisense for SARIF log files. The SARIF standard was developed over several years, and many intermediate versions of the schema were produced. Now that the standard is final, only the OASIS standard version of the schema is valid.

Command

tflint -f=sarif

Terraform Configuration

TFLint Configuration

Output

{
  "version": "2.1.0",
  "$schema": "https://json.schemastore.org/sarif-2.1.0-rtm.5.json",
  "runs": [
    {
      "tool": {
        "driver": {
          "name": "tflint",
          "version": "0.50.3",
          "informationUri": "https://github.com/terraform-linters/tflint"
        }
      },
      "results": []
    },
    {
      "tool": {
        "driver": {
          "name": "tflint-errors",
          "version": "0.50.3",
          "informationUri": "https://github.com/terraform-linters/tflint"
        }
      },
      "results": []
    }
  ]
}

TFLint Version

0.50.3

Terraform Version

No response

Operating System

  • Linux
  • macOS
  • Windows
@C-Side C-Side added the bug label Apr 10, 2024
@wata727
Copy link
Member

wata727 commented Apr 10, 2024

Thank you for raising this issue. This seems to be fixed in go-sarif v2.
owenrumney/go-sarif#59

TFLint uses go-sarif v1, so we will need to update it.

@C-Side
Copy link
Author

C-Side commented Apr 11, 2024

I guess this doesn't have super high priority, I'm not eagerly awaiting this. I just came across it and thought it would maybe be nice to let you know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants