Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump s3-bucket::modernisation-platform-terraform-s3-bucket from 7.1.0 to 8.1.0 in /terraform/environments/apex #7505

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Aug 16, 2024

Bumps s3-bucket::modernisation-platform-terraform-s3-bucket from 7.1.0 to 8.1.0.

Release notes

Sourced from s3-bucket::modernisation-platform-terraform-s3-bucket's releases.

v8.1.0

What's New

This version updates the bucket policy to deny connections where the TLS version is below 1.2. Prior to this, non-TLS connections were denied, but now less-secure TLS versions will also be denied.

What's Changed

New Contributors

Full Changelog: ministryofjustice/modernisation-platform-terraform-s3-bucket@v8.0.1...v8.1.0

v8.0.1

What's Changed

New Contributors

... (truncated)

Commits
  • 4e17731 Merge pull request #510 from ministryofjustice/dependabot/github_actions/brid...
  • 8431e01 Merge pull request #509 from ministryofjustice/dependabot/github_actions/gith...
  • 6c10893 Merge pull request #511 from ministryofjustice/enforce_tls_12_or_higher
  • eb12580 Commit changes made by code formatters
  • e810ef3 Revise bucket policy to enforce tls v1.2 or higher connections
  • de70f45 Bump bridgecrewio/checkov-action from 12.2849.0 to 12.2851.0
  • df49d9d Bump github/codeql-action from 3.26.1 to 3.26.2
  • f95c656 Merge pull request #508 from ministryofjustice/dependabot/github_actions/gith...
  • 85eb05b Bump github/codeql-action from 3.26.0 to 3.26.1
  • ae42a20 Merge pull request #507 from ministryofjustice/dependabot/github_actions/brid...
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [s3-bucket::modernisation-platform-terraform-s3-bucket](https://github.com/ministryofjustice/modernisation-platform-terraform-s3-bucket) from 7.1.0 to 8.1.0.
- [Release notes](https://github.com/ministryofjustice/modernisation-platform-terraform-s3-bucket/releases)
- [Commits](ministryofjustice/modernisation-platform-terraform-s3-bucket@v7.1.0...v8.1.0)

---
updated-dependencies:
- dependency-name: s3-bucket::github::ministryofjustice/modernisation-platform-terraform-s3-bucket::v7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot requested review from a team as code owners August 16, 2024 00:49
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Aug 16, 2024
@dependabot dependabot bot requested a review from a team as a code owner August 16, 2024 00:49
@dependabot dependabot bot added the terraform Pull requests that update Terraform code label Aug 16, 2024
@github-actions github-actions bot added the environments-repository Used to exclude PRs from this repo in our Slack PR update label Aug 16, 2024
Copy link
Contributor

Trivy Scan Failed

Show Output ```hcl

Trivy will check the following folders:
terraform/environments/apex/modules/alb


Running Trivy in terraform/environments/apex/modules/alb
2024-08-16T00:51:55Z INFO [db] Need to update DB
2024-08-16T00:51:55Z INFO [db] Downloading DB... repository="ghcr.io/aquasecurity/trivy-db:2"
2024-08-16T00:51:58Z INFO [vuln] Vulnerability scanning is enabled
2024-08-16T00:51:58Z INFO [misconfig] Misconfiguration scanning is enabled
2024-08-16T00:51:58Z INFO Need to update the built-in policies
2024-08-16T00:51:58Z INFO Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-08-16T00:51:58Z INFO [secret] Secret scanning is enabled
2024-08-16T00:51:58Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-08-16T00:51:58Z INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.54/docs/scanner/secret#recommendation for faster secret detection
2024-08-16T00:52:00Z INFO Number of language-specific files num=0
2024-08-16T00:52:00Z INFO Detected config files num=3

main.tf (terraform)

Tests: 8 (SUCCESSES: 6, FAILURES: 1, EXCEPTIONS: 1)
Failures: 1 (HIGH: 0, CRITICAL: 1)

CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.

See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
main.tf:289
via main.tf:284-291 (content)
via main.tf:282-292 (dynamic.egress["lb_egress"])
via main.tf:264-293 (aws_security_group.lb)
────────────────────────────────────────
264 resource "aws_security_group" "lb" {
...
289 [ cidr_blocks = lookup(egress.value, "cidr_blocks", null)
...
293 }
────────────────────────────────────────

trivy_exitcode=1

</details> #### `Checkov Scan` Failed
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:
terraform/environments/apex/modules/alb

*****************************

Running Checkov in terraform/environments/apex/modules/alb
Excluding the following checks: CKV_GIT_1,CKV_AWS_126,CKV2_AWS_38,CKV2_AWS_39
2024-08-16 00:52:03,029 [MainThread  ] [WARNI]  Failed to download module github.com/ministryofjustice/modernisation-platform-terraform-s3-bucket?ref=v8.1.0:None (for external modules, the --download-external-modules flag is required)
terraform scan results:

Passed checks: 25, Failed checks: 4, Skipped checks: 3

Check: CKV_TF_1: "Ensure Terraform module sources use a commit hash"
	FAILED for resource: s3-bucket[0]
	File: /main.tf:124-179
	Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/supply-chain-policies/terraform-policies/ensure-terraform-module-sources-use-git-url-with-commit-hash-revision

		Code lines for this resource are too many. Please use IDE of your choice to review the file.
Check: CKV_AWS_149: "Ensure that Secrets Manager secret is encrypted using KMS CMK"
	FAILED for resource: aws_secretsmanager_secret.cloudfront
	File: /main.tf:303-306
	Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/aws-policies/aws-general-policies/ensure-that-secrets-manager-secret-is-encrypted-using-kms

		303 | resource "aws_secretsmanager_secret" "cloudfront" {
		304 |   name        = "cloudfront-v1-secret-${var.application_name}"
		305 |   description = "Simple secret created by AWS CloudFormation to be shared between ALB and CloudFront"
		306 | }

Check: CKV_AWS_233: "Ensure Create before destroy for ACM certificates"
	FAILED for resource: aws_acm_certificate.external_lb
	File: /main.tf:658-668
	Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/aws-policies/aws-networking-policies/ensure-aws-acm-certificate-enables-create-before-destroy

		658 | resource "aws_acm_certificate" "external_lb" {
		659 | 
		660 |   domain_name               = var.acm_cert_domain_name
		661 |   validation_method         = "DNS"
		662 |   subject_alternative_names = var.environment == "production" ? null : ["${var.application_name}.${var.business_unit}-${var.environment}.${var.acm_cert_domain_name}"]
		663 |   tags                      = var.tags
		664 |   # TODO Set prevent_destroy to true to stop Terraform destroying this resource in the future if required
		665 |   lifecycle {
		666 |     prevent_destroy = false
		667 |   }
		668 | }

Check: CKV2_AWS_57: "Ensure Secrets Manager secrets should have automatic rotation enabled"
	FAILED for resource: aws_secretsmanager_secret.cloudfront
	File: /main.tf:303-306
	Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/aws-policies/aws-general-policies/bc-aws-2-57

		303 | resource "aws_secretsmanager_secret" "cloudfront" {
		304 |   name        = "cloudfront-v1-secret-${var.application_name}"
		305 |   description = "Simple secret created by AWS CloudFormation to be shared between ALB and CloudFront"
		306 | }


checkov_exitcode=1

CTFLint Scan Failed

Show Output
*****************************

Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version: 0.5.0)
tflint will check the following folders:
terraform/environments/apex/modules/alb

*****************************

Running tflint in terraform/environments/apex/modules/alb
Excluding the following checks: terraform_unused_declarations
3 issue(s) found:

Warning: Missing version constraint for provider "random" in `required_providers` (terraform_required_providers)

  on terraform/environments/apex/modules/alb/main.tf line 298:
 298: resource "random_password" "cloudfront" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.md

Warning: Missing version constraint for provider "null" in `required_providers` (terraform_required_providers)

  on terraform/environments/apex/modules/alb/main.tf line 532:
 532: resource "null_resource" "always_run" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_required_providers.md

Warning: `environment` variable has no type (terraform_typed_variables)

  on terraform/environments/apex/modules/alb/variables.tf line 123:
 123: variable "environment" {}

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_typed_variables.md

tflint_exitcode=2

Trivy Scan Failed

Show Output
*****************************

Trivy will check the following folders:
terraform/environments/apex/modules/alb

*****************************

Running Trivy in terraform/environments/apex/modules/alb
2024-08-16T00:51:55Z	INFO	[db] Need to update DB
2024-08-16T00:51:55Z	INFO	[db] Downloading DB...	repository="ghcr.io/aquasecurity/trivy-db:2"
2024-08-16T00:51:58Z	INFO	[vuln] Vulnerability scanning is enabled
2024-08-16T00:51:58Z	INFO	[misconfig] Misconfiguration scanning is enabled
2024-08-16T00:51:58Z	INFO	Need to update the built-in policies
2024-08-16T00:51:58Z	INFO	Downloading the built-in policies...
74.86 KiB / 74.86 KiB [-----------------------------------------------------------] 100.00% ? p/s 0s2024-08-16T00:51:58Z	INFO	[secret] Secret scanning is enabled
2024-08-16T00:51:58Z	INFO	[secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-08-16T00:51:58Z	INFO	[secret] Please see also https://aquasecurity.github.io/trivy/v0.54/docs/scanner/secret#recommendation for faster secret detection
2024-08-16T00:52:00Z	INFO	Number of language-specific files	num=0
2024-08-16T00:52:00Z	INFO	Detected config files	num=3

main.tf (terraform)
===================
Tests: 8 (SUCCESSES: 6, FAILURES: 1, EXCEPTIONS: 1)
Failures: 1 (HIGH: 0, CRITICAL: 1)

CRITICAL: Security group rule allows egress to multiple public internet addresses.
════════════════════════════════════════
Opening up ports to connect out to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that are explicitly required where possible.

See https://avd.aquasec.com/misconfig/avd-aws-0104
────────────────────────────────────────
 main.tf:289
   via main.tf:284-291 (content)
    via main.tf:282-292 (dynamic.egress["lb_egress"])
     via main.tf:264-293 (aws_security_group.lb)
────────────────────────────────────────
 264   resource "aws_security_group" "lb" {
 ...   
 289 [       cidr_blocks     = lookup(egress.value, "cidr_blocks", null)
 ...   
 293   }
────────────────────────────────────────


trivy_exitcode=1

Copy link
Contributor

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Sep 15, 2024
Copy link
Contributor Author

dependabot bot commented on behalf of github Sep 18, 2024

Superseded by #7807.

@dependabot dependabot bot closed this Sep 18, 2024
@dependabot dependabot bot deleted the dependabot/terraform/terraform/environments/apex/s3-bucket--github--ministryofjustice/modernisation-platform-terraform-s3-bucket--v7.1.0-8.1.0 branch September 18, 2024 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file environments-repository Used to exclude PRs from this repo in our Slack PR update Stale terraform Pull requests that update Terraform code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants