Skip to content

Add A Policy To A Role (aws)

PlatformAuthorLast Update
awsNick Jones2024-12-02

An adversary may attempt to add a policy to a role, in order to grant additional privileges to a compromised resource.

MITRE IDs

Required Permissions

  • iam:AttachUserPolicy

Required Parameters

NameTypeDescriptionExample Value
rolestrRole to add policy toReadOnlyRole
policyarnstrPolicy to add to Rolearn:aws:iam::aws:policy/ReadOnlyAccess

Attacker Action

Terminal window
aws iam attach-role-policy --role-name --policy-arn

Detection Case

ELK query

When logs are ingested into ELK, the following Lucene query can be used to identify relevant events.

eventName:AttachRolePolicy

Sigma Definition

---
title: Add a policy to a role
id: cdf3b0fc-0c45-4bb4-89f2-1c6b2661ec52
status: experimental
author: Nick Jones
date: 2024-12-02
description: An adversary may attempt to add a policy to a role, in order to grant additional privileges to a compromised resource.
logsource:
service: cloudtrail
detection:
selection_source:
- eventSource: ""
events:
- eventName: "AttachRolePolicy"
condition: selection_source and events
level: low
tags:
- attack.T1098
falsepositives:
- Developers making legitimate changes to the environment. Verify whether the user identity, user agent, and/or hostname should be making changes in your environment.