-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: generate sarif report using ansible-lint
- Loading branch information
1 parent
1db8109
commit 6743152
Showing
4 changed files
with
293 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,242 @@ | ||
{ | ||
"$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", | ||
"version": "2.1.0", | ||
"runs": [ | ||
{ | ||
"tool": { | ||
"driver": { | ||
"name": "ansible-lint", | ||
"version": "24.9.2", | ||
"informationUri": "https://github.com/ansible/ansible-lint", | ||
"rules": [ | ||
{ | ||
"id": "name[play]", | ||
"name": "name[play]", | ||
"shortDescription": { | ||
"text": "All plays should be named." | ||
}, | ||
"defaultConfiguration": { | ||
"level": "warning" | ||
}, | ||
"help": { | ||
"text": "All tasks and plays should have a distinct name for readability and for ``--start-at-task`` to work" | ||
}, | ||
"helpUri": "https://ansible.readthedocs.io/projects/lint/rules/name/", | ||
"properties": { | ||
"tags": [ | ||
"idiom" | ||
] | ||
} | ||
}, | ||
{ | ||
"id": "yaml[indentation]", | ||
"name": "yaml[indentation]", | ||
"shortDescription": { | ||
"text": "Wrong indentation: expected at least 3" | ||
}, | ||
"defaultConfiguration": { | ||
"level": "warning" | ||
}, | ||
"help": { | ||
"text": "" | ||
}, | ||
"helpUri": "https://ansible.readthedocs.io/projects/lint/rules/yaml/", | ||
"properties": { | ||
"tags": [ | ||
"formatting", | ||
"yaml" | ||
] | ||
} | ||
}, | ||
{ | ||
"id": "yaml[truthy]", | ||
"name": "yaml[truthy]", | ||
"shortDescription": { | ||
"text": "Truthy value should be one of [false, true]" | ||
}, | ||
"defaultConfiguration": { | ||
"level": "warning" | ||
}, | ||
"help": { | ||
"text": "" | ||
}, | ||
"helpUri": "https://ansible.readthedocs.io/projects/lint/rules/yaml/", | ||
"properties": { | ||
"tags": [ | ||
"formatting", | ||
"yaml" | ||
] | ||
} | ||
}, | ||
{ | ||
"id": "fqcn[action-core]", | ||
"name": "fqcn[action-core]", | ||
"shortDescription": { | ||
"text": "Use FQCN for builtin module actions (command)." | ||
}, | ||
"defaultConfiguration": { | ||
"level": "warning" | ||
}, | ||
"help": { | ||
"text": "Check whether actions are using using full qualified collection names." | ||
}, | ||
"helpUri": "https://ansible.readthedocs.io/projects/lint/rules/fqcn/", | ||
"properties": { | ||
"tags": [ | ||
"formatting" | ||
] | ||
} | ||
}, | ||
{ | ||
"id": "yaml[trailing-spaces]", | ||
"name": "yaml[trailing-spaces]", | ||
"shortDescription": { | ||
"text": "Trailing spaces" | ||
}, | ||
"defaultConfiguration": { | ||
"level": "warning" | ||
}, | ||
"help": { | ||
"text": "" | ||
}, | ||
"helpUri": "https://ansible.readthedocs.io/projects/lint/rules/yaml/", | ||
"properties": { | ||
"tags": [ | ||
"formatting", | ||
"yaml" | ||
] | ||
} | ||
}, | ||
{ | ||
"id": "no-free-form", | ||
"name": "no-free-form", | ||
"shortDescription": { | ||
"text": "Avoid using free-form when calling module actions. (yum)" | ||
}, | ||
"defaultConfiguration": { | ||
"level": "warning" | ||
}, | ||
"help": { | ||
"text": "Avoid free-form inside files as it can produce subtle bugs." | ||
}, | ||
"helpUri": "https://ansible.readthedocs.io/projects/lint/rules/no-free-form/", | ||
"properties": { | ||
"tags": [ | ||
"syntax", | ||
"risk" | ||
] | ||
} | ||
}, | ||
{ | ||
"id": "syntax-check[unknown-module]", | ||
"name": "syntax-check[unknown-module]", | ||
"shortDescription": { | ||
"text": "couldn't resolve module/action 'firewalld'. This often indicates a misspelling, missing collection, or incorrect module path." | ||
}, | ||
"defaultConfiguration": { | ||
"level": "error" | ||
}, | ||
"help": { | ||
"text": "" | ||
}, | ||
"helpUri": "https://ansible.readthedocs.io/projects/lint/rules/syntax-check/", | ||
"properties": { | ||
"tags": [ | ||
"core", | ||
"unskippable" | ||
] | ||
} | ||
}, | ||
{ | ||
"id": "no-changed-when", | ||
"name": "no-changed-when", | ||
"shortDescription": { | ||
"text": "Commands should not change things if nothing needs doing." | ||
}, | ||
"defaultConfiguration": { | ||
"level": "error" | ||
}, | ||
"help": { | ||
"text": "" | ||
}, | ||
"helpUri": "https://ansible.readthedocs.io/projects/lint/rules/no-changed-when/", | ||
"properties": { | ||
"tags": [ | ||
"command-shell", | ||
"idempotency" | ||
] | ||
} | ||
}, | ||
{ | ||
"id": "risky-file-permissions", | ||
"name": "risky-file-permissions", | ||
"shortDescription": { | ||
"text": "File permissions unset or incorrect." | ||
}, | ||
"defaultConfiguration": { | ||
"level": "error" | ||
}, | ||
"help": { | ||
"text": "Missing or unsupported mode parameter can cause unexpected file permissions based on version of Ansible being used. Be explicit, like `mode: 0644` to avoid hitting this rule. Special `preserve` value is accepted only by `copy`, `template` modules." | ||
}, | ||
"helpUri": "https://ansible.readthedocs.io/projects/lint/rules/risky-file-permissions/", | ||
"properties": { | ||
"tags": [ | ||
"unpredictability" | ||
] | ||
} | ||
}, | ||
{ | ||
"id": "yaml[line-length]", | ||
"name": "yaml[line-length]", | ||
"shortDescription": { | ||
"text": "Line too long (170 > 160 characters)" | ||
}, | ||
"defaultConfiguration": { | ||
"level": "warning" | ||
}, | ||
"help": { | ||
"text": "" | ||
}, | ||
"helpUri": "https://ansible.readthedocs.io/projects/lint/rules/yaml/", | ||
"properties": { | ||
"tags": [ | ||
"formatting", | ||
"yaml" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"columnKind": "utf16CodeUnits", | ||
"results": [ | ||
{ | ||
"ruleId": "yaml[line-length]", | ||
"level": "error", | ||
"message": { | ||
"text": "Line too long (170 > 160 characters)" | ||
}, | ||
"locations": [ | ||
{ | ||
"physicalLocation": { | ||
"artifactLocation": { | ||
"uri": "roles/example/tasks/main.yml", | ||
"uriBaseId": "SRCROOT" | ||
}, | ||
"region": { | ||
"startLine": 53 | ||
} | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"originalUriBaseIds": { | ||
"SRCROOT": { | ||
"uri": "file:///my-project/" | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters