Saltar al contenido

AWS Console error: "Failed to get the secret value" when pressing 'Retrieve Secret Value'

0

I get error "Failed to get the secret value" when pressing 'Retrieve Secret Value'
Retrieve Secret Value

I am not an IAM user with a role, but logged in as an IAM-identity-center user.

My group has a permission-set containing the AWS-managed policy SecretsManagerReadWrite.

The resource policy of the secret is set to deny all requests not coming from a specified VPCE (e.g. vpce-myvpce) as follows:

{
  "Version" : "2012-10-17",
  "Id" : "pl-sm_ev_vpce_ecs_sr",
  "Statement" : [ {
    "Sid" : "RestrictGetSecretValueoperation",
    "Effect" : "Deny",
    "Principal" : "*",
    "Action" : "secretsmanager:GetSecretValue",
    "Resource" : "*",
    "Condition" : {
      "StringNotEquals" : {
        "aws:sourceVpce" : "vpce-myvpce"
      }
    }
  } ]
}

How should I modify this policy in order to allow myself access to my secrets via the AWS Console, i.e. view and edit the key/value pairs?

preguntada hace 10 meses589 visualizaciones
1 Respuesta
1
Respuesta aceptada

Hello.

How about setting the IAM role used by IAM-identity-center in the same account as SecretsManager as an exception, as shown below?

{
  "Version" : "2012-10-17",
  "Id" : "pl-sm_ev_vpce_ecs_sr",
  "Statement" : [ {
    "Sid" : "RestrictGetSecretValueoperation",
    "Effect" : "Deny",
    "Principal" : "*",
    "Action" : "secretsmanager:GetSecretValue",
    "Resource" : "*",
    "Condition" : {
      "StringNotEquals" : {
        "aws:sourceVpce" : "vpce-myvpce",
        "aws:PrincipalArn" : [ 
          "arn:aws:iam::your-account-id:role/aws-reserved/sso.amazonaws.com/your-iam-identity-center-region/AWSReservedSSO_Role"
        ]
      }
    }
  } ]
}
EXPERTO
respondido hace 10 meses
EXPERTO
revisado hace 10 meses
  • In your answer, I further had to replace /AWSReservedSSO_Role with the 'Federated user' id copied from the account details in the top-right corner of the console, e.g. /AWSReservedSSO_PermissionSetName_somecode

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.