Skip to content

Commit 4fc751f

Browse files
Merge branch 'main' into feature/CCM-8861_sftp-poll-2
2 parents d350ee5 + c558d31 commit 4fc751f

File tree

115 files changed

+4766
-1830
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+4766
-1830
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ node_modules
3333

3434
# production
3535
/build
36+
dist
3637

3738
# misc
3839
.DS_Store

.gitleaksignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# SEE: https://github.com/gitleaks/gitleaks/blob/master/README.md#gitleaksignore
1+
# SEE: <https://github.com/gitleaks/gitleaks/blob/master/README.md#gitleaksignore>
22

33
cd9c0efec38c5d63053dd865e5d4e207c0760d91:docs/guides/Perform_static_analysis.md:generic-api-key:37
44
87312c6a627a7b0420956d49187fd15b130df170:src/__tests__/components/molecules/LoginStatus.test.tsx:jwt:23
55
37ca9f5670f4cd7d91869845ca27defbe6156bb9:src/__tests__/components/molecules/LoginStatus.test.tsx:jwt:23
66
b19d88d1d92b0530f065feefcf25d8cdd82a876a:tests/test-team/auth/user.json:jwt:15
77
b19d88d1d92b0530f065feefcf25d8cdd82a876a:tests/test-team/auth/user.json:jwt:25
8+
bc79df4f82052918ae6bf69d36279e5dd391d61e:tests/test-team/auth/user.json:jwt:15
9+
bc79df4f82052918ae6bf69d36279e5dd391d61e:tests/test-team/auth/user.json:jwt:25

infrastructure/terraform/components/app/pre.sh

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
21
npm ci
32

43
npm run generate-dependencies --workspaces --if-present
4+
5+
./lambdas/layers/pdfjs/build.sh

infrastructure/terraform/modules/backend-api/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,21 @@ No requirements.
3434
| <a name="module_build_sftp_letters_lambdas"></a> [build\_sftp\_letters\_lambdas](#module\_build\_sftp\_letters\_lambdas) | ../typescript-build-zip | n/a |
3535
| <a name="module_build_template_client"></a> [build\_template\_client](#module\_build\_template\_client) | ../typescript-build-zip | n/a |
3636
| <a name="module_build_template_lambda"></a> [build\_template\_lambda](#module\_build\_template\_lambda) | ../typescript-build-zip | n/a |
37-
| <a name="module_build_virus_scan_lambdas"></a> [build\_virus\_scan\_lambdas](#module\_build\_virus\_scan\_lambdas) | ../typescript-build-zip | n/a |
3837
| <a name="module_create_letter_template_lambda"></a> [create\_letter\_template\_lambda](#module\_create\_letter\_template\_lambda) | ../lambda-function | n/a |
3938
| <a name="module_create_template_lambda"></a> [create\_template\_lambda](#module\_create\_template\_lambda) | ../lambda-function | n/a |
4039
| <a name="module_delete_template_lambda"></a> [delete\_template\_lambda](#module\_delete\_template\_lambda) | ../lambda-function | n/a |
4140
| <a name="module_get_template_lambda"></a> [get\_template\_lambda](#module\_get\_template\_lambda) | ../lambda-function | n/a |
4241
| <a name="module_lambda_copy_scanned_object_to_internal"></a> [lambda\_copy\_scanned\_object\_to\_internal](#module\_lambda\_copy\_scanned\_object\_to\_internal) | ../lambda-function | n/a |
4342
| <a name="module_lambda_delete_failed_scanned_object"></a> [lambda\_delete\_failed\_scanned\_object](#module\_lambda\_delete\_failed\_scanned\_object) | ../lambda-function | n/a |
44-
| <a name="module_lambda_enrich_guardduty_scan_result"></a> [lambda\_enrich\_guardduty\_scan\_result](#module\_lambda\_enrich\_guardduty\_scan\_result) | ../lambda-function | n/a |
4543
| <a name="module_lambda_send_letter_proof"></a> [lambda\_send\_letter\_proof](#module\_lambda\_send\_letter\_proof) | ../lambda-function | n/a |
4644
| <a name="module_lambda_set_file_virus_scan_status"></a> [lambda\_set\_file\_virus\_scan\_status](#module\_lambda\_set\_file\_virus\_scan\_status) | ../lambda-function | n/a |
4745
| <a name="module_lambda_sftp_poll"></a> [lambda\_sftp\_poll](#module\_lambda\_sftp\_poll) | ../lambda-function | n/a |
46+
| <a name="module_lambda_validate_letter_template_files"></a> [lambda\_validate\_letter\_template\_files](#module\_lambda\_validate\_letter\_template\_files) | ../lambda-function | n/a |
4847
| <a name="module_list_template_lambda"></a> [list\_template\_lambda](#module\_list\_template\_lambda) | ../lambda-function | n/a |
4948
| <a name="module_s3bucket_internal"></a> [s3bucket\_internal](#module\_s3bucket\_internal) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket | v1.0.8 |
5049
| <a name="module_s3bucket_quarantine"></a> [s3bucket\_quarantine](#module\_s3bucket\_quarantine) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket | v1.0.8 |
51-
| <a name="module_sqs_quarantine_scan_enrichment"></a> [sqs\_quarantine\_scan\_enrichment](#module\_sqs\_quarantine\_scan\_enrichment) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs | v2.0.1 |
5250
| <a name="module_sqs_sftp_upload"></a> [sqs\_sftp\_upload](#module\_sqs\_sftp\_upload) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs | v2.0.1 |
51+
| <a name="module_sqs_validate_letter_template_files"></a> [sqs\_validate\_letter\_template\_files](#module\_sqs\_validate\_letter\_template\_files) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs | v2.0.1 |
5352
| <a name="module_sqs_virus_scan_failed_delete_object_dlq"></a> [sqs\_virus\_scan\_failed\_delete\_object\_dlq](#module\_sqs\_virus\_scan\_failed\_delete\_object\_dlq) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs | v2.0.1 |
5453
| <a name="module_sqs_virus_scan_passed_copy_object_dlq"></a> [sqs\_virus\_scan\_passed\_copy\_object\_dlq](#module\_sqs\_virus\_scan\_passed\_copy\_object\_dlq) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs | v2.0.1 |
5554
| <a name="module_sqs_virus_scan_set_file_status_dlq"></a> [sqs\_virus\_scan\_set\_file\_status\_dlq](#module\_sqs\_virus\_scan\_set\_file\_status\_dlq) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs | v2.0.1 |
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
resource "aws_cloudwatch_event_rule" "guardduty_quarantine_scan_failed" {
2+
name = "${local.csi}-quarantine-scan-failed"
3+
description = "Matches quarantine 'GuardDuty Malware Protection Object Scan Result' events where the scan result is not NO_THREATS_FOUND"
4+
5+
event_pattern = jsonencode({
6+
source = ["aws.guardduty"]
7+
detail-type = ["GuardDuty Malware Protection Object Scan Result"]
8+
resources = [aws_guardduty_malware_protection_plan.quarantine.arn]
9+
detail = {
10+
s3ObjectDetails = {
11+
bucketName = [module.s3bucket_quarantine.id]
12+
objectKey = [{ prefix = "pdf-template/" }, { prefix = "test-data/" }]
13+
}
14+
scanResultDetails = {
15+
scanResultStatus = [{ anything-but = "NO_THREATS_FOUND" }]
16+
}
17+
}
18+
})
19+
}
20+
21+
resource "aws_cloudwatch_event_target" "quarantine_scan_failed_set_file_status" {
22+
rule = aws_cloudwatch_event_rule.guardduty_quarantine_scan_failed.name
23+
arn = module.lambda_set_file_virus_scan_status.function_arn
24+
role_arn = aws_iam_role.quarantine_scan_failed.arn
25+
}
26+
27+
resource "aws_cloudwatch_event_target" "quarantine_scan_failed_delete_object" {
28+
rule = aws_cloudwatch_event_rule.guardduty_quarantine_scan_failed.name
29+
arn = module.lambda_delete_failed_scanned_object.function_arn
30+
role_arn = aws_iam_role.quarantine_scan_failed.arn
31+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
resource "aws_cloudwatch_event_rule" "guardduty_quarantine_scan_passed" {
2+
name = "${local.csi}-quarantine-scan-passed"
3+
description = "Matches quarantine 'GuardDuty Malware Protection Object Scan Result' events where the scan result is NO_THREATS_FOUND"
4+
5+
event_pattern = jsonencode({
6+
source = ["aws.guardduty"]
7+
detail-type = ["GuardDuty Malware Protection Object Scan Result"]
8+
resources = [aws_guardduty_malware_protection_plan.quarantine.arn]
9+
detail = {
10+
s3ObjectDetails = {
11+
bucketName = [module.s3bucket_quarantine.id]
12+
objectKey = [{ prefix = "pdf-template/" }, { prefix = "test-data/" }]
13+
}
14+
scanResultDetails = {
15+
scanResultStatus = ["NO_THREATS_FOUND"]
16+
}
17+
}
18+
})
19+
}
20+
21+
resource "aws_cloudwatch_event_target" "quarantine_scan_passed_set_file_status" {
22+
rule = aws_cloudwatch_event_rule.guardduty_quarantine_scan_passed.name
23+
arn = module.lambda_set_file_virus_scan_status.function_arn
24+
role_arn = aws_iam_role.quarantine_scan_passed.arn
25+
}
26+
27+
resource "aws_cloudwatch_event_target" "quarantine_scan_passed_copy_object" {
28+
rule = aws_cloudwatch_event_rule.guardduty_quarantine_scan_passed.name
29+
arn = module.lambda_copy_scanned_object_to_internal.function_arn
30+
role_arn = aws_iam_role.quarantine_scan_passed.arn
31+
}
32+
33+
resource "aws_cloudwatch_event_target" "quarantine_scan_passed_validate_files" {
34+
rule = aws_cloudwatch_event_rule.guardduty_quarantine_scan_passed.name
35+
arn = module.sqs_validate_letter_template_files.sqs_queue_arn
36+
role_arn = aws_iam_role.quarantine_scan_passed.arn
37+
}

infrastructure/terraform/modules/backend-api/cloudwatch_event_rule_quarantine_scan_result.tf

Lines changed: 0 additions & 54 deletions
This file was deleted.

infrastructure/terraform/modules/backend-api/cloudwatch_event_rule_virus_scan_failed.tf

Lines changed: 0 additions & 55 deletions
This file was deleted.

infrastructure/terraform/modules/backend-api/cloudwatch_event_rule_virus_scan_passed.tf

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)