@@ -809,6 +809,76 @@ 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+ ],
835+ Resource = " *"
836+ },
837+ {
838+ Sid = " LambdaFunctionSigningManagement" ,
839+ Effect = " Allow" ,
840+ Action = [
841+ " lambda:DeleteFunctionCodeSigningConfig" ,
842+ " lambda:PutFunctionCodeSigningConfig"
843+ ],
844+ Resource = " arn:aws:lambda:*:${ data . aws_caller_identity . current . account_id } :function:eligibility_signposting_api"
845+ },
846+ {
847+ Sid = " SignerProfileManagement"
848+ Effect = " Allow"
849+ Action = [
850+ " signer:GetSigningProfile" ,
851+ " signer:TagResource" ,
852+ " signer:UntagResource" ,
853+ " signer:ListTagsForResource"
854+ ]
855+ Resource = local.lambda_signing_profile_arn
856+ },
857+ {
858+ Sid = " SignerProfileCreateAndList"
859+ Effect = " Allow"
860+ Action = [
861+ " signer:PutSigningProfile" ,
862+ " signer:ListSigningProfiles"
863+ ]
864+ Resource = " *"
865+ },
866+ {
867+ Sid = " SignerJobUsage" ,
868+ Effect = " Allow" ,
869+ Action = [
870+ " signer:StartSigningJob" ,
871+ " signer:DescribeSigningJob" ,
872+ " signer:ListSigningJobs"
873+ ],
874+ Resource = " *"
875+ },
876+ ]
877+ })
878+
879+ tags = merge (local. tags , { Name = " code-signing-management" })
880+ }
881+
812882# Attach the policies to the role
813883resource "aws_iam_role_policy_attachment" "terraform_state" {
814884 role = aws_iam_role. github_actions . name
@@ -859,3 +929,8 @@ resource "aws_iam_role_policy_attachment" "kinesis_management_attach" {
859929 role = aws_iam_role. github_actions . name
860930 policy_arn = aws_iam_policy. kinesis_management . arn
861931}
932+
933+ resource "aws_iam_role_policy_attachment" "code_signing_management" {
934+ role = aws_iam_role. github_actions . name
935+ policy_arn = aws_iam_policy. code_signing_management . arn
936+ }
0 commit comments