generated from cds-snc/project-template
-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add SRE Security Hub automation rule role #207
Merged
Merged
Conversation
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
Add an OIDC rule that can be used by the SRE repo by the `tools/aws-security-automation-rules` script to manage Security Hub automation rules.
Plan for log_archive/sre_bot✅ Terraform Init: Plan: 3 to add, 0 to change, 0 to destroy Show summary
Show planResource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# aws_iam_policy.sre_sechub_automation_rules will be created
+ resource "aws_iam_policy" "sre_sechub_automation_rules" {
+ arn = (known after apply)
+ id = (known after apply)
+ name = "sre_sechub_automation_rules"
+ name_prefix = (known after apply)
+ path = "/"
+ policy = jsonencode(
{
+ Statement = [
+ {
+ Action = [
+ "securityhub:ListAutomationRules",
+ "securityhub:CreateAutomationRule",
+ "securityhub:BatchGetAutomationRules",
+ "securityhub:BatchDeleteAutomationRules",
]
+ Effect = "Allow"
+ Resource = "*"
+ Sid = "ManageSecurityHubAutomationRules"
},
]
+ Version = "2012-10-17"
}
)
+ policy_id = (known after apply)
+ tags = {
+ "CostCentre" = "cds-aft-log-archive-production"
+ "Terraform" = "true"
}
+ tags_all = {
+ "CostCentre" = "cds-aft-log-archive-production"
+ "Terraform" = "true"
}
}
# aws_iam_role_policy_attachment.sre_sechub_automation_rules will be created
+ resource "aws_iam_role_policy_attachment" "sre_sechub_automation_rules" {
+ id = (known after apply)
+ policy_arn = (known after apply)
+ role = "sre_sechub_automation_rules_github_action"
}
# module.OIDC_Roles.aws_iam_role.this["sre_sechub_automation_rules_github_action"] will be created
+ resource "aws_iam_role" "this" {
+ arn = (known after apply)
+ assume_role_policy = jsonencode(
{
+ Statement = [
+ {
+ Action = "sts:AssumeRoleWithWebIdentity"
+ Condition = {
+ StringLike = {
+ token.actions.githubusercontent.com:sub = [
+ "repo:cds-snc/site-reliability-engineering:ref:refs/heads/main",
]
}
}
+ Effect = "Allow"
+ Principal = {
+ Federated = "arn:aws:iam::274536870005:oidc-provider/token.actions.githubusercontent.com"
}
+ Sid = ""
},
]
+ Version = "2012-10-17"
}
)
+ create_date = (known after apply)
+ force_detach_policies = false
+ id = (known after apply)
+ managed_policy_arns = (known after apply)
+ max_session_duration = 3600
+ name = "sre_sechub_automation_rules_github_action"
+ name_prefix = (known after apply)
+ path = "/"
+ role_last_used = (known after apply)
+ tags = {
+ "CostCentre" = "cds-aft-log-archive-production"
+ "Terraform" = "true"
}
+ tags_all = {
+ "CostCentre" = "cds-aft-log-archive-production"
+ "Terraform" = "true"
}
+ unique_id = (known after apply)
+ inline_policy {
+ name = (known after apply)
+ policy = (known after apply)
}
}
Plan: 3 to add, 0 to change, 0 to destroy.
─────────────────────────────────────────────────────────────────────────────
Saved the plan to: plan.tfplan
To perform exactly these actions, run the following command to apply:
terraform apply "plan.tfplan"
Releasing state lock. This may take a few moments...
Show Conftest resultsWARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.assume_sre_vulnerability_report"]
18 tests, 17 passed, 1 warning, 0 failures, 0 exceptions
|
wanpengyang
approved these changes
Oct 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add an OIDC rule that can be used by the SRE repo by the
tools/aws-security-automation-rules
script to manage Security Hub automation rules.Related