I updated my AWS Private Certificate Authority (AWS Private CA) to configure a certificate revocation list (CRL). However, I received a "The ACM Private CA Service Principal 'acm-pca.amazonaws.com' requires 's3:GetBucketAcl' permissions" error.
Short description
AWS Private CA places the CRL into an Amazon Simple Storage Service (Amazon S3) bucket that you designate for use. Your Amazon S3 bucket must be secured by an attached permissions policy. Authorized users and service principals require Put permission to allow AWS Private CA to place objects in the bucket and Get permission to retrieve them. For more information, see Access policies for CRLs in Amazon S3.
Resolution
Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.
To replace the default Amazon S3 policy with a less permissive policy, complete the following steps:
-
Open the Amazon S3 console.
-
From the list of buckets, open the bucket that you want to place the CRL in.
-
Choose the Permissions tab.
-
In Bucket policy, choose Edit.
-
In Policy, copy and paste the following policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "acm-pca.amazonaws.com"
},
"Action": [
"s3:PutObject",
"s3:PutObjectAcl",
"s3:GetBucketAcl",
"s3:GetBucketLocation"
],
"Resource": [
"arn:aws:s3:::your-crl-storage-bucket/*",
"arn:aws:s3:::your-crl-storage-bucket"
],
"Condition": {
"StringEquals": {
"aws:SourceAccount": "account",
"aws:SourceArn": "arn:partition:acm-pca:region:account:certificate-authority/CA_ID"
}
}
}
]
}
Note: Replace the value for Resource with your Amazon S3 bucket name. Replace the value for aws:SourceAccount with your Account ID. Replace the value for aws:SourceArn with your ARN.
-
Choose Save changes.
-
Encrypt your CRLs.
-
Run the update-certificate-authority command to update the AWS Private CA revocation configuration:
aws acm-pca update-certificate-authority --certificate-authority-arn Certification_Auhtority_ARN --revocation-configuration file://revoke_config.txt
Note: Replace Certification_Auhtority_ARN with your ARN.
The revoke_config.txt file contains revocation information similar to the following:
{ "CrlConfiguration": {
"Enabled": <true>,
"ExpirationInDays": <7>,
"CustomCname": "example1234.cloudfront.net",
"S3BucketName": "example-test-crl-bucket-us-east-1",
"S3ObjectAcl": "BUCKET_OWNER_FULL_CONTROL"
}
}
Note:
- If you turned off the Block Public Access (BPA) feature in Amazon S3, then you can specify either BUCKET_OWNER_FULL_CONTROL or PUBLIC_READ as the value.
- If you use the AWS Management Console to configure your CRL, then you might receive a "ValidationException" error. Repeat step 8 to update the CA revocation configuration through the AWS CLI.
Related information
Enable S3 Block Public Access (BPA) with CloudFront
Security best practices for Amazon S3
GetBucketAcl