Skip to content

Commit 10f3c5c

Browse files
m-houstongithub-actions[bot]
authored andcommitted
Drift from template
1 parent 0828a09 commit 10f3c5c

18 files changed

Lines changed: 179 additions & 55 deletions

File tree

.github/actions/create-lines-of-code-report/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ runs:
4444
echo "secrets_exist=${{ inputs.idp_aws_report_upload_role_name != '' && inputs.idp_aws_report_upload_bucket_endpoint != '' }}" >> $GITHUB_OUTPUT
4545
- name: "Authenticate to send the report"
4646
if: steps.check.outputs.secrets_exist == 'true'
47-
uses: aws-actions/configure-aws-credentials@v2
47+
uses: aws-actions/configure-aws-credentials@v4
4848
with:
4949
role-to-assume: arn:aws:iam::${{ inputs.idp_aws_report_upload_account_id }}:role/${{ inputs.idp_aws_report_upload_role_name }}
5050
aws-region: ${{ inputs.idp_aws_report_upload_region }}

.github/actions/scan-dependencies/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ runs:
5858
run: echo "secrets_exist=${{ inputs.idp_aws_report_upload_role_name != '' && inputs.idp_aws_report_upload_bucket_endpoint != '' }}" >> $GITHUB_OUTPUT
5959
- name: "Authenticate to send the reports"
6060
if: steps.check.outputs.secrets_exist == 'true'
61-
uses: aws-actions/configure-aws-credentials@v2
61+
uses: aws-actions/configure-aws-credentials@v4
6262
with:
6363
role-to-assume: arn:aws:iam::${{ inputs.idp_aws_report_upload_account_id }}:role/${{ inputs.idp_aws_report_upload_role_name }}
6464
aws-region: ${{ inputs.idp_aws_report_upload_region }}

.github/actions/trivy/action.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Trivy Scan"
2+
runs:
3+
using: "composite"
4+
steps:
5+
- name: "Trivy Terraform IAC Scan"
6+
shell: bash
7+
run: |
8+
components_exit_code=0
9+
modules_exit_code=0
10+
11+
./scripts/terraform/trivy.sh ./infrastructure/terraform/components || components_exit_code=$?
12+
./scripts/terraform/trivy.sh ./infrastructure/terraform/modules || modules_exit_code=$?
13+
14+
if [ $components_exit_code -ne 0 ] || [ $modules_exit_code -ne 0 ]; then
15+
echo "Trivy misconfigurations detected."
16+
exit 1
17+
fi

.gitleaksignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# SEE: https://github.com/gitleaks/gitleaks/blob/master/README.md#gitleaksignore
22

33
cd9c0efec38c5d63053dd865e5d4e207c0760d91:docs/guides/Perform_static_analysis.md:generic-api-key:37
4+
cd9c0efec38c5d63053dd865e5d4e207c0760d91:docs/guides/Perform_static_analysis.md:sonar-api-token:37
45
96096685ab3d6876671e2bc9a6ff4d48fc56e521:src/helloworld/helloworld.sln:ipv4:4
56
4f4e8c15629b2cb09356a7fed4d72953590227ce:docs/Gemfile.lock:ipv4:4

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ gitleaks 8.18.4
33
pre-commit 3.6.0
44
terraform 1.9.2
55
terraform-docs 0.19.0
6+
trivy 0.61.0
67
tfsec 1.28.10
78
vale 3.6.0
89
poetry 1.8.3

infrastructure/terraform/bin/terraform.sh

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -539,24 +539,26 @@ fi;
539539
[ -f "${dynamic_file_path}" ] && tf_var_file_paths+=("${dynamic_file_path}");
540540

541541
# Warn on duplication
542-
duplicate_variables="$(cat "${tf_var_file_paths[@]}" | sed -n -e 's/\(^[a-zA-Z0-9_\-]\+\)\s*=.*$/\1/p' | sort | uniq -d)";
543-
[ -n "${duplicate_variables}" ] \
544-
&& echo -e "
545-
###################################################################
546-
# WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING #
547-
###################################################################
548-
The following input variables appear to be duplicated:
549-
550-
${duplicate_variables}
551-
552-
This could lead to unexpected behaviour. Overriding of variables
553-
has previously been unpredictable and is not currently supported,
554-
but it may work.
555-
556-
Recent changes to terraform might give you useful overriding and
557-
map-merging functionality, please use with caution and report back
558-
on your successes & failures.
559-
###################################################################";
542+
if [ ${#tf_var_file_paths[@]} -gt 0 ]; then
543+
duplicate_variables="$(cat "${tf_var_file_paths[@]}" | sed -n -e 's/\(^[a-zA-Z0-9_\-]\+\)\s*=.*$/\1/p' | sort | uniq -d)";
544+
[ -n "${duplicate_variables}" ] \
545+
&& echo -e "
546+
###################################################################
547+
# WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING #
548+
###################################################################
549+
The following input variables appear to be duplicated:
550+
551+
${duplicate_variables}
552+
553+
This could lead to unexpected behaviour. Overriding of variables
554+
has previously been unpredictable and is not currently supported,
555+
but it may work.
556+
557+
Recent changes to terraform might give you useful overriding and
558+
map-merging functionality, please use with caution and report back
559+
on your successes & failures.
560+
###################################################################";
561+
fi
560562

561563
# Build up the tfvars arguments for terraform command line
562564
for file_path in "${tf_var_file_paths[@]}"; do
@@ -791,8 +793,8 @@ case "${action}" in
791793
;;
792794
*)
793795
echo -e "Generic action case invoked. Only the additional arguments will be passed to terraform, you break it you fix it:";
794-
echo -e "\tterraform ${action} ${extra_args}";
795-
terraform "${action}" ${extra_args} \
796+
echo -e "\tterraform ${action} ${extra_args} | tee terraform_output";
797+
terraform "${action}" ${extra_args} | tee terraform_output \
796798
|| error_and_die "Terraform ${action} failed.";
797799
;;
798800
esac;

scripts/config/.repository-template-sync-ignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# Files and folders to ignore when syncing nhs-notify-repository-template back in to this repository
2+
.editorconfig
3+
.gitleaksignore
4+
/Makefile
5+
scripts/config/sonar-scanner.properties
6+
scripts/tests/
7+
scripts/**/examples/
28
.github/workflows/
39
.github/CODEOWNERS
410
nhs-notify-repository-template/

scripts/config/.repository-template-sync-merge

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ scripts/config/.repository-template-sync-ignore
33
scripts/config/.repository-template-sync-merge
44
.tool-versions
55
.gitignore
6+
scripts/config/vale/vale.ini
67
scripts/config/vale/styles/config/vocabularies/words/accept.txt
78
scripts/config/vale/styles/config/vocabularies/words/reject.txt

scripts/config/gitleaks.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# SEE: https://github.com/gitleaks/gitleaks/#configuration
2+
# Do not edit this file directly as it will be overwritten by changes from the nhs-notify-repository-template on next sync
23

34
[extend]
45
useDefault = true # SEE: https://github.com/gitleaks/gitleaks/blob/master/config/gitleaks.toml

scripts/config/pre-commit.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ repos:
99
- id: check-symlinks
1010
- id: detect-private-key
1111
- id: end-of-file-fixer
12-
exclude: .+\.cs
1312
- id: forbid-new-submodules
1413
- id: mixed-line-ending
1514
- id: pretty-format-json

0 commit comments

Comments
 (0)