From d8fa998e45183a4773786bfdcb8122b085d954be Mon Sep 17 00:00:00 2001 From: Kevin-CB Date: Fri, 14 Oct 2022 11:29:23 +0200 Subject: [PATCH 1/2] feat: add tfsec on all platforms --- provisioning/test.sh | 0 provisioning/tools-versions.yml | 1 + provisioning/ubuntu-provision.sh | 12 ++++++++++++ provisioning/windows-provision.ps1 | 2 ++ 4 files changed, 15 insertions(+) create mode 100644 provisioning/test.sh diff --git a/provisioning/test.sh b/provisioning/test.sh new file mode 100644 index 000000000..e69de29bb diff --git a/provisioning/tools-versions.yml b/provisioning/tools-versions.yml index 31286202a..56a2903fc 100644 --- a/provisioning/tools-versions.yml +++ b/provisioning/tools-versions.yml @@ -19,5 +19,6 @@ maven_version: "3.8.6" openssh_authorized_keys_url: "https://raw.githubusercontent.com/jenkins-infra/aws/main/ec2_agents_authorized_keys" packer_version: "1.8.2" ruby_version: "2.6.10" +tfsec_version: "1.28.0" vagrant_version: "2.3.1" yq_version: "4.25.3" diff --git a/provisioning/ubuntu-provision.sh b/provisioning/ubuntu-provision.sh index 871fa0b97..7618b319d 100755 --- a/provisioning/ubuntu-provision.sh +++ b/provisioning/ubuntu-provision.sh @@ -426,6 +426,16 @@ function install_datadog() { systemctl disable datadog-agent } +## Install Tfsec with ASDF +function install_tfsec() { + # Ensure that ASDF is installed + install_asdf + + # Install tfsec with ASDF and set it as default installation + install_asdf_plugin tfsec https://github.com/woneill/asdf-tfsec.git + install_asdf_package tfsec "${TFSEC_VERSION}" +} + ## Ensure that the VM is cleaned up function cleanup() { export HISTSIZE=0 @@ -457,6 +467,7 @@ function sanity_check() { && parallel --version \ && python3 --version \ && ruby -v \ + && tfsec --version \ && unzip -v \ && vagrant -v \ && yq --version \ @@ -493,6 +504,7 @@ function main() { install_ruby install_yq install_packer + install_tfsec cleanup } diff --git a/provisioning/windows-provision.ps1 b/provisioning/windows-provision.ps1 index 6179b3d2d..01cc13d98 100644 --- a/provisioning/windows-provision.ps1 +++ b/provisioning/windows-provision.ps1 @@ -261,6 +261,7 @@ $downloads = [ordered]@{ & "choco.exe" install packer --yes --no-progress --limit-output --fail-on-error-output --version "${env:PACKER_VERSION}"; & "choco.exe" install datadog-agent --yes --no-progress --limit-output --fail-on-error-output; & "choco.exe" install vcredist2015 --yes --no-progress --limit-output --fail-on-error-output; + & "choco.exe" install tfsec --yes --no-progress --limit-output --fail-on-error-output --version "${env:TFSEC_VERSION}"; }; 'sanityCheck'= { & "choco.exe"; @@ -269,6 +270,7 @@ $downloads = [ordered]@{ & "$baseDir\ruby26\bin\bundle" -v; & "yq.exe" --version; & "packer.exe" --version; + & "tfsec.exe" --version; } }; } From 4e530932196b69f360add5a8b8cdcee28fe841b0 Mon Sep 17 00:00:00 2001 From: Kevin Guerroudj <91883215+Kevin-CB@users.noreply.github.com> Date: Fri, 14 Oct 2022 15:34:01 +0200 Subject: [PATCH 2/2] Delete test.sh Oops, this empty file have nothing to do here --- provisioning/test.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 provisioning/test.sh diff --git a/provisioning/test.sh b/provisioning/test.sh deleted file mode 100644 index e69de29bb..000000000