Super-linter: terrascan not honouring ts:skip

Created on 29 Jan 2021  路  5Comments  路  Source: github/super-linter

Describe the bug

TERRAFORM_TERRASCAN not honouring ts:skip

Expected behavior

Terrascan to skip on violations and not error on them.

Steps to Reproduce

Snippet of Terraform code:

resource "github_repository" "this_repo" {
  #ts:skip=accurics.gcp.IAM.145 We skip this as we are not using GCP IAM 
  #ts:skip=accurics.github.IAM.1 We skip this as repository to be public
  name               = "test-github-repo"
  private            = false
}
docker run -e RUN_LOCAL=true \
 -e FILTER_REGEX_EXCLUDE='(.*(terraform|\.tfstate*|.super-linter/).*)' \
 -e OUTPUT_FORMAT=tap \
 -e OUTPUT_DETAILS=detailed \
 -e OUTPUT_FOLDER=.super-linter \
 -e VALIDATE_ALL_CODEBASE=true \
 -v "${PWD}":/tmp/lint github/super-linter:latest

Logs

2021-01-29 13:24:14 [INFO]   Linting [TERRAFORM_TERRASCAN] files...
2021-01-29 13:24:14 [INFO]   ----------------------------------------------
2021-01-29 13:24:14 [INFO]   ----------------------------------------------
2021-01-29 13:24:14 [INFO]   ---------------------------
2021-01-29 13:24:14 [INFO]   File:[/tmp/lint/outputs.tf]
2021-01-29 13:24:16 [INFO]    - File:[outputs.tf] was linted with [terrascan] successfully
2021-01-29 13:24:16 [INFO]   ---------------------------
2021-01-29 13:24:16 [INFO]   File:[/tmp/lint/providers.tf]
2021-01-29 13:24:17 [INFO]    - File:[providers.tf] was linted with [terrascan] successfully
2021-01-29 13:24:17 [INFO]   ---------------------------
2021-01-29 13:24:17 [INFO]   File:[/tmp/lint/repo.tf]
2021-01-29 13:24:18 [ERROR]   Found errors in [terrascan] linter!
2021-01-29 13:24:18 [ERROR]   Error code: 3. Command output:
------
results:
    violations:
        - rule_name: privateRepoEnabled
          description: Repository is Not Private.
          rule_id: accurics.gcp.IAM.145
          severity: MEDIUM
          category: Identity & Access Management
          resource_name: this_repo
          resource_type: github_repository
          file: repo.tf
          line: 21
        - rule_name: privateRepoEnabled
          description: Repository is Not Private.
          rule_id: accurics.github.IAM.1
          severity: MEDIUM
          category: Identity & Access Management
          resource_name: this_repo
          resource_type: github_repository
          file: repo.tf
          line: 21
    count:
        low: 0
        medium: 2
        high: 0
        total: 2
------
bug

Most helpful comment

@jimsmith super-linter is not using the latest version of Terrascan yet. #1157 should fix the issue

All 5 comments

@jimsmith super-linter is not using the latest version of Terrascan yet. #1157 should fix the issue

@jimsmith @cesar-rodriguez Im trying to get this version in, it just breaking our TAP scan and need to update some additional code to make sure all works as expected

sorry for the delay, been a real week out here

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 馃 label or comment on the issue.

+1 to stay open

+1 to stay open as well
Rule skipping was introduced in terrascan 1.3. super-linter currently runs 1.2 (image ref: accurics/terrascan:2d1374b). Current terrascan version is 1.4. Thanks to the folks that are on it to upgrading the version #1157

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brunomartinspro picture brunomartinspro  路  4Comments

lechen26 picture lechen26  路  5Comments

thehesiod picture thehesiod  路  4Comments

DawidJanczak picture DawidJanczak  路  5Comments

sergey-muntyanu picture sergey-muntyanu  路  4Comments