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

fix: address checkov issues #6607

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ resource "aws_sesv2_configuration_set" "nexctloud_ses_configuration_set" {
#####################

resource "aws_iam_user" "nextcloud_ses_smtp_user" {
#checkov:skip=CKV_AWS_273:Nextcloud requires an SMTP user to send emails
name = "${var.env_name}-${var.account_info.application_name}-smtp-user"

tags = var.tags
Expand All @@ -81,6 +82,7 @@ resource "aws_iam_user_policy" "nextcloud_ses_smtp_user" {
name = "${var.env_name}-${var.account_info.application_name}-smtp-user-policy"
user = aws_iam_user.nextcloud_ses_smtp_user.name

#checkov:skip=CKV_AWS_290:No restrictions can be set in the policy
policy = jsonencode({
Version = "2012-10-17"
Statement = [
Expand All @@ -90,15 +92,16 @@ resource "aws_iam_user_policy" "nextcloud_ses_smtp_user" {
"ses:SendEmail",
"ses:SendRawEmail"
]
Resource = "*"
Resource = "${aws_sesv2_email_identity.nextcloud.arn}"
}
]
})
}

resource "aws_ssm_parameter" "nextcloud_ses_smtp_user" {
name = "/${var.env_name}/${var.account_info.application_name}/ses_smtp"
type = "SecureString"
name = "/${var.env_name}/${var.account_info.application_name}/ses_smtp"
type = "SecureString"
key_id = var.account_config.kms_keys.general_shared
value = jsonencode({
user = aws_iam_user.nextcloud_ses_smtp_user.name
key = aws_iam_access_key.nextcloud_ses_smtp_user.id
Expand Down
Loading