-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e97c684
commit a32ad01
Showing
23 changed files
with
99 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @JamesWoolfenden |
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 |
---|---|---|
|
@@ -7,7 +7,6 @@ on: | |
workflow_dispatch: | ||
|
||
env: | ||
terraform: 0.15.0 | ||
tf_target_dir: example/examplea | ||
branch: master | ||
jobs: | ||
|
@@ -21,11 +20,10 @@ jobs: | |
token: ${{ github.token }} | ||
- name: tfsec | ||
run: | | ||
pip3 install lastversion | ||
now=$(lastversion tfsec/tfsec) | ||
wget https://github.com/tfsec/tfsec/releases/download/v${now}/tfsec-linux-amd64 | ||
chmod +x tfsec-linux-amd64 | ||
./tfsec-linux-amd64 ${{ env.tf_target_dir }} -f json --out tfsec.json | ||
pip3 install lastversion | ||
lastversion tfsec/tfsec --assets -d | ||
chmod +x tfsec-linux-amd64 | ||
./tfsec-linux-amd64 ${{ env.tf_target_dir }} -f json --out tfsec.json | ||
continue-on-error: true | ||
- name: store | ||
uses: actions/upload-artifact@v2 | ||
|
@@ -67,18 +65,20 @@ jobs: | |
- name: install terrascan | ||
run: | | ||
pip3 install lastversion | ||
now=$(lastversion accurics/terrascan) | ||
curl --location https://github.com/accurics/terrascan/releases/download/v${now}/terrascan_${now}_Linux_x86_64.tar.gz --output terrascan.tar.gz | ||
tar -xvf terrascan.tar.gz | ||
lastversion accurics/terrascan --assets -d --verbose | ||
tar -xvf terrascan*.tar.gz | ||
chmod +x ./terrascan | ||
- name: run terrascan | ||
run: ./terrascan scan -d ${{ env.tf_target_dir }} -o json -x json >terrascan.json | ||
run: | | ||
./terrascan init | ||
./terrascan scan -d ${{ env.tf_target_dir }} -o json -x json | tee terrascan.json | ||
continue-on-error: true | ||
- name: store | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: terrascan | ||
path: terrascan.json | ||
if-no-files-found: error | ||
if-no-files-found: warn | ||
kics: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -87,18 +87,20 @@ jobs: | |
with: | ||
ref: ${{ env.branch }} | ||
token: ${{ github.token }} | ||
- name: run kics Scan | ||
uses: checkmarx/[email protected] | ||
with: | ||
path: ${{ env.tf_target_dir }} | ||
output_path: "kics.json" | ||
- name: install kics | ||
run: | | ||
pip3 install lastversion | ||
lastversion Checkmarx/kics --assets -d --verbose | ||
tar -xvf kics*.tar.gz | ||
- name: run kics | ||
run: ./kics scan -p ${{ env.tf_target_dir }} -o kics.json --report-formats json | ||
continue-on-error: true | ||
- name: store | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: kics | ||
path: kics.json | ||
if-no-files-found: error | ||
if-no-files-found: warn | ||
|
||
upload: | ||
needs: [kics, terrascan, checkov, tfsec] | ||
|
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 |
---|---|---|
|
@@ -33,6 +33,28 @@ jobs: | |
tf_actions_version: ${{ env.terraform }} | ||
tf_actions_subcommand: validate | ||
tf_actions_working_dir: ${{ env.tf_target_dir }} | ||
- name: Terraform Plan | ||
uses: hashicorp/terraform-github-actions@master | ||
with: | ||
tf_actions_version: ${{ env.terraform }} | ||
tf_actions_subcommand: plan | ||
tf_actions_working_dir: ${{ env.tf_target_dir }} | ||
env: | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_KEY }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
- name: Bills | ||
run: | | ||
pip3 install lastversion | ||
lastversion infracost --assets -d --verbose | ||
mkdir $GITHUB_WORKSPACE/bin | ||
tar -xvf infracost*.tar.gz --directory $GITHUB_WORKSPACE/bin | ||
chmod +x $GITHUB_WORKSPACE/bin/infracost-linux-amd64 | ||
$GITHUB_WORKSPACE/bin/infracost-linux-amd64 breakdown --path ${{ env.tf_target_dir }} --usage-file ${{ env.tf_target_dir }}/infracost-usage.yml | ||
env: | ||
INFRACOST_API_KEY: ${{ secrets.INFRACOST_API_KEY }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Do not change | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_KEY }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
security: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -46,10 +68,9 @@ jobs: | |
python-version: 3.8 | ||
- run: | | ||
pip3 install lastversion | ||
now=$(lastversion terraform-docs) | ||
lastversion terraform-docs --assets -d --verbose | ||
mkdir $GITHUB_WORKSPACE/bin | ||
curl -L https://github.com/terraform-docs/terraform-docs/releases/download/v${now}/terraform-docs-v${now}-$(uname)-amd64.tar.gz -o terraform-docs.tar.gz | ||
tar -xvf terraform-docs.tar.gz --directory $GITHUB_WORKSPACE/bin | ||
tar -xvf terraform-docs*.tar.gz --directory $GITHUB_WORKSPACE/bin | ||
chmod +x $GITHUB_WORKSPACE/bin/terraform-docs | ||
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH | ||
- uses: pre-commit/[email protected] | ||
|
@@ -59,7 +80,6 @@ jobs: | |
steps: | ||
- uses: actions/checkout@master | ||
- name: Bump version and push tag | ||
if: ${{ !env.ACT }} | ||
uses: anothrNick/github-tag-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
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 |
---|---|---|
|
@@ -29,6 +29,15 @@ jobs: | |
tf_actions_version: ${{ env.terraform }} | ||
tf_actions_subcommand: validate | ||
tf_actions_working_dir: ${{ env.tf_target_dir }} | ||
- name: Terraform Plan | ||
uses: hashicorp/terraform-github-actions@master | ||
with: | ||
tf_actions_version: ${{ env.terraform }} | ||
tf_actions_subcommand: plan | ||
tf_actions_working_dir: ${{ env.tf_target_dir }} | ||
env: | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_KEY }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
security: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -41,10 +50,28 @@ jobs: | |
python-version: 3.8 | ||
- run: | | ||
pip3 install lastversion | ||
now=$(lastversion terraform-docs) | ||
lastversion terraform-docs --assets -d --verbose | ||
mkdir $GITHUB_WORKSPACE/bin | ||
curl -L https://github.com/terraform-docs/terraform-docs/releases/download/v${now}/terraform-docs-v${now}-$(uname)-amd64.tar.gz -o terraform-docs.tar.gz | ||
tar -xvf terraform-docs.tar.gz --directory $GITHUB_WORKSPACE/bin | ||
tar -xvf terraform-docs*.tar.gz --directory $GITHUB_WORKSPACE/bin | ||
chmod +x $GITHUB_WORKSPACE/bin/terraform-docs | ||
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH | ||
- uses: pre-commit/[email protected] | ||
infracost: | ||
runs-on: ubuntu-latest | ||
name: Show infracost diff | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
- name: Run infracost diff | ||
uses: infracost/infracost-gh-action@master # Use a specific version instead of master if locking is preferred | ||
env: | ||
INFRACOST_API_KEY: ${{ secrets.INFRACOST_API_KEY }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Do not change | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_KEY }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
# See the cloud credentials section for the options | ||
with: | ||
entrypoint: /scripts/ci/diff.sh # Do not change | ||
path: ${{ env.tf_target_dir }} | ||
usage_file: ${{ env.tf_target_dir }}/infracost-usage.yml | ||
#terraform_plan_flags: -var-file=my.tfvars |
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
This file was deleted.
Oops, something went wrong.
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,2 @@ | ||
version: 0.1 | ||
resource_usage: {} |
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,7 @@ | ||
|
||
locals { | ||
ami = { | ||
filter = ["cassandra-BASE-v*"] | ||
owners = [data.aws_caller_identity.current.account_id] | ||
} | ||
} |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
version = "3.35.0" | ||
version = "3.39.0" | ||
source = "hashicorp/aws" | ||
} | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1 @@ | ||
instance_type = "t3.micro" | ||
|
||
common_tags = { | ||
"name" = "cassandra" | ||
"Environment" = "Development" } |
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 |
---|---|---|
@@ -1,5 +1,2 @@ | ||
instance_type = "t3.micro" | ||
private_ips = ["172.31.0.5", "172.31.0.6", "172.31.0.7", "172.31.0.8", "172.31.0.9"] | ||
common_tags = { | ||
"name" = "cassandra" | ||
"Environment" = "Development" } |
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
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