@@ -809,6 +809,69 @@ resource "aws_iam_policy" "cloudwatch_management" {
809809 tags = merge (local. tags , { Name = " cloudwatch-management" })
810810}
811811
812+ resource "aws_iam_policy" "code_signing_management" {
813+ # checkov:skip=CKV_AWS_290: Actions require wildcard resource for Lambda code signing configs and Signer jobs
814+ # checkov:skip=CKV_AWS_235: Actions require wildcard resource for Lambda code signing configs and Signer jobs
815+ # checkov:skip=CKV_AWS_355: Actions require wildcard resource for Lambda code signing configs and Signer jobs
816+ name = " code-signing-management"
817+ description = " Allow GitHub Actions to manage Lambda code signing and start Signer jobs"
818+ path = " /service-policies/"
819+
820+ policy = jsonencode ({
821+ Version = " 2012-10-17" ,
822+ Statement = [
823+ {
824+ Sid = " LambdaCodeSigningConfigManagement" ,
825+ Effect = " Allow" ,
826+ Action = [
827+ " lambda:CreateCodeSigningConfig" ,
828+ " lambda:UpdateCodeSigningConfig" ,
829+ " lambda:DeleteCodeSigningConfig" ,
830+ " lambda:GetCodeSigningConfig" ,
831+ " lambda:ListCodeSigningConfigs" ,
832+ " lambda:GetFunctionCodeSigningConfig" ,
833+ " lambda:ListTags" ,
834+ " lambda:DeleteFunctionCodeSigningConfig" ,
835+ " lambda:PutFunctionCodeSigningConfig"
836+ ],
837+ Resource = " *"
838+ },
839+ {
840+ Sid = " SignerProfileManagement"
841+ Effect = " Allow"
842+ Action = [
843+ " signer:GetSigningProfile" ,
844+ " signer:TagResource" ,
845+ " signer:UntagResource" ,
846+ " signer:ListTagsForResource"
847+ ]
848+ Resource = local.lambda_signing_profile_arn
849+ },
850+ {
851+ Sid = " SignerProfileCreateAndList"
852+ Effect = " Allow"
853+ Action = [
854+ " signer:PutSigningProfile" ,
855+ " signer:ListSigningProfiles"
856+ ]
857+ Resource = " *"
858+ },
859+ {
860+ Sid = " SignerJobUsage" ,
861+ Effect = " Allow" ,
862+ Action = [
863+ " signer:StartSigningJob" ,
864+ " signer:DescribeSigningJob" ,
865+ " signer:ListSigningJobs"
866+ ],
867+ Resource = " *"
868+ },
869+ ]
870+ })
871+
872+ tags = merge (local. tags , { Name = " code-signing-management" })
873+ }
874+
812875# Attach the policies to the role
813876resource "aws_iam_role_policy_attachment" "terraform_state" {
814877 role = aws_iam_role. github_actions . name
@@ -859,3 +922,8 @@ resource "aws_iam_role_policy_attachment" "kinesis_management_attach" {
859922 role = aws_iam_role. github_actions . name
860923 policy_arn = aws_iam_policy. kinesis_management . arn
861924}
925+
926+ resource "aws_iam_role_policy_attachment" "code_signing_management" {
927+ role = aws_iam_role. github_actions . name
928+ policy_arn = aws_iam_policy. code_signing_management . arn
929+ }
0 commit comments