Skip to content

Instantly share code, notes, and snippets.

@infamousjoeg
Created August 28, 2025 12:49
Show Gist options
  • Save infamousjoeg/725b5e921edb87f107dc6ea2c8623d0f to your computer and use it in GitHub Desktop.
Save infamousjoeg/725b5e921edb87f107dc6ea2c8623d0f to your computer and use it in GitHub Desktop.
Secrets Hub ListSecrets Only CloudFormation Template
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"PolicyName": {
"Type": "String",
"Description": "Meaningful policy name"
},
"CyberArkSecretsHubRoleARN": {
"Type": "String",
"Description": "The Secrets Hub tenant role ARN which will be trusted by this role"
},
"SecretsManagerRegion": {
"Type": "String",
"Description": "The AWS Secrets Manager Account region that the Secrets Hub will have access to"
}
},
"Resources": {
"AllowSecretsAccessRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": {
"Ref": "CyberArkSecretsHubRoleARN"
}
},
"Action": [
"sts:AssumeRole"
]
}
]
},
"Policies": [
{
"PolicyName": {
"Ref": "PolicyName"
},
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Action": "secretsmanager:ListSecrets",
"Resource": "*",
"Effect": "Allow",
"Condition": {
"StringEquals": {
"aws:RequestedRegion": {
"Ref": "SecretsManagerRegion"
}
}
}
}
]
}
}
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment