Is there a way to create an EventBridge rule that extract a log of any AssumedRole event and any ARN which assume the role ?

0

i tried two solutions but it does not work :

  1. an arn with the wilcard
`{
  "source": ["aws.signin"],
  "detail-type": ["AWS Console Sign In via CloudTrail"],
  "detail": {
    "userIdentity": {
      "type": ["AssumedRole"],
      "arn": ["arn:aws:sts::1234567890:assumed-role/Role1/*"]
    },
    "eventName": ["SwitchRole"]
  }
}`
  1. and the prefix, but it doesn't work :
`{
  "source": ["aws.signin"],
  "detail-type": ["AWS Console Sign In via CloudTrail"],
  "detail": {
    "userIdentity": {
      "type": ["AssumedRole"],
     "arn": [{
          "prefix": "arn:aws:sts::1234567890:assumed-role/Role1/"
        }]
    },
    "eventName": ["SwitchRole"]
  }
}
`

It only works with a specific arn with a username known in advance like this :

`{
  "source": ["aws.signin"],
  "detail-type": ["AWS Console Sign In via CloudTrail"],
  "detail": {
    "userIdentity": {
      "type": ["AssumedRole"],
      "arn": ["arn:aws:sts::1234567890:assumed-role/Role1/banza.caleb"]
    },
    "eventName": ["SwitchRole"]
  }
}`

Can anyone have a solution please?

1개 답변
0

Since you're using AWS CloudTrail as the source of your AWS EventBridge Rule, then you must verify in AWS CloudTrail how the event is being registered.

In AWS CloudTrail the event you're trying to use is registered as 'AssumeRole', not 'AssumedRole'.

Here is the documentation link on how to view your event history in AWS Cloud Trail: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html

AWS
vtjean
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠