From 2001b9f54226f13136bde2b15c07ff8be42508d2 Mon Sep 17 00:00:00 2001 From: rachit89 <115970922+rachit89@users.noreply.github.com> Date: Tue, 23 May 2023 10:53:06 +0530 Subject: [PATCH 1/4] Update .pre-commit-config.yaml for tfsec file format. --- .pre-commit-config.yaml | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2dec635..f86c068 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,32 @@ repos: - - repo: https://github.com/squareops/pre-commit - rev: v0.1.12 - hooks: - - id: terraform-fmt - - id: terraform-validate - - id: tflint - - repo: https://github.com/squareops/pre-commit-terraform - rev: v1.47.0 - hooks: - - id: terraform_docs - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.1.0 hooks: + - id: trailing-whitespace + args: ['--markdown-linebreak-ext=md'] + - id: end-of-file-fixer - id: check-merge-conflict - # - id: end-of-file-fixer \ No newline at end of file + - id: detect-private-key + - id: detect-aws-credentials + args: ['--allow-missing-credentials'] + - repo: https://github.com/antonbabenko/pre-commit-terraform + rev: v1.77.0 + hooks: + - id: terraform_fmt + - id: terraform_docs + args: + - '--args=--lockfile=false' + - --hook-config=--add-to-existing-file=true + - --hook-config=--create-file-if-not-exist=true + + - id: terraform_tflint + args: + - --args=--config=.tflint.hcl + - id: terraform_tfsec + files: ^examples/ # only scan `examples/*` which are the implementation + args: + - --args=--config-file=__GIT_WORKING_DIR__/tfsec.yaml + - --args=--format + - --args=html + - --args=--out + - --args=https://github.com/sq-ia/terraform-aws-rds-postgresql/result.html From 7d68b5aa1061c93ae09202c9fe15c9b1797ebbf4 Mon Sep 17 00:00:00 2001 From: rachit89 <115970922+rachit89@users.noreply.github.com> Date: Tue, 30 May 2023 18:32:59 +0530 Subject: [PATCH 2/4] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f86c068..7856915 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,4 +29,4 @@ repos: - --args=--format - --args=html - --args=--out - - --args=https://github.com/sq-ia/terraform-aws-rds-postgresql/result.html + - --args=../result.html From c777619ce2a263ebdb3fc41fb8286f9d3f313f67 Mon Sep 17 00:00:00 2001 From: rachit89 <115970922+rachit89@users.noreply.github.com> Date: Tue, 30 May 2023 18:51:36 +0530 Subject: [PATCH 3/4] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7856915..2755ba1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,4 +29,4 @@ repos: - --args=--format - --args=html - --args=--out - - --args=../result.html + - --args=../../../result.html From 3ab75cc8ae698ea88e546255a6e8a7a409e7156a Mon Sep 17 00:00:00 2001 From: rachit89 <115970922+rachit89@users.noreply.github.com> Date: Tue, 30 May 2023 19:02:46 +0530 Subject: [PATCH 4/4] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2755ba1..3a012c9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,4 +29,4 @@ repos: - --args=--format - --args=html - --args=--out - - --args=../../../result.html + - --args=../../../tfsec.html