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

add rule for enforcing terrascan pre-commit hook #240

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kantord
Copy link
Contributor

@kantord kantord commented Dec 19, 2024

Co-authored-by: Giuseppe Scuglia [email protected]

@kantord kantord marked this pull request as ready for review December 19, 2024 14:52
@kantord kantord requested a review from a team as a code owner December 19, 2024 14:52
@kantord kantord force-pushed the add-terrascan-pre-commit-enforcement branch from 51ffe55 to b720254 Compare December 19, 2024 15:05
@kantord kantord force-pushed the add-terrascan-pre-commit-enforcement branch from b720254 to 4b29121 Compare December 19, 2024 15:21
Copy link
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar comments to #241

@@ -0,0 +1,19 @@
tests:
- name: "Should have Talisman pre-commit hook configured"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: "Should have Talisman pre-commit hook configured"
- name: "Should have Terrascan pre-commit hook configured"

expect: "pass"
git:
repo_base: correct
- name: "Should fail Talisman pre-commit hook is not configured"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: "Should fail Talisman pre-commit hook is not configured"
- name: "Should fail Terrascan pre-commit hook is not configured"

Comment on lines +40 to +41
import future.keywords.if
import future.keywords.every
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import future.keywords.if
import future.keywords.every
import rego.v1

hooks[hook_id].id == "terraform-pre-commit"
}

message := "" if allow
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
message := "" if allow
message := "Terrascan pre-commit hook is not configured for the repository"

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

Successfully merging this pull request may close these issues.

3 participants