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

New rule: Ensure $schema exists and it always point to current version. #1890

Closed
harleenkohli opened this issue Jun 1, 2020 · 0 comments · Fixed by #1892
Closed

New rule: Ensure $schema exists and it always point to current version. #1890

harleenkohli opened this issue Jun 1, 2020 · 0 comments · Fixed by #1892

Comments

@harleenkohli
Copy link
Contributor

harleenkohli commented Jun 1, 2020

Write a new validation rule to ensure:

  1. $schema tag is always present in a sarif file.
  2. $schema value should point to the latest version. acceptable versions are either:
  • sarif-2.1.0
  • latest RTM (e.g. currently we are at sarif-2.1.0-rtm.5)

desirable examples:

{
  "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json",
  "version": "2.1.0",
  "runs": [
    ...
]
{
  "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0.json",
  "version": "2.1.0",
  "runs": [
    ...
]

undesirable examples:

{
  "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.4.json",
  "version": "2.1.0",
  "runs": [
    ...
]
{
  "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.0.0.json",
  "version": "2.1.0",
  "runs": [
    ...
]
@harleenkohli harleenkohli changed the title New rule: Ensure $schema exists and $schema.id should always point to current version. New rule: Ensure $schema exists and id should always point to current version. Jun 2, 2020
@harleenkohli harleenkohli changed the title New rule: Ensure $schema exists and id should always point to current version. New rule: Ensure $schema exists and it always point to current version. Jun 2, 2020
@ghost ghost closed this as completed in #1892 Jun 2, 2020
ghost pushed a commit that referenced this issue Jun 2, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants