Files
floci/tools/aws/sources/backup-roles.json
T
Priamo Germosen c0c60ea886 fix(iam): check AWS Backup by its generated routes, resources and passed roles (#9669)
Under enforcement a REST route no vendored model names runs unchecked, and AWS Backup was among them: a caller could start a backup job or assign resources to a backup plan with any role and no iam:PassRole, and a grant scoped to one backup vault or plan covered every one, as #6255 reports. Backup's model routes are vendored, so each request is checked as its operation's action, and Backup joins the tables of request resources, passed roles and tags on create.

The Service Reference passes most of Backup's roles to one service, which the passed-roles generator reads alone: IamRoleArn to backup.amazonaws.com, a backup plan's scan settings' ScannerRoleArn to malware-protection.guardduty.amazonaws.com, and a restore testing selection's to restore-testing.backup.amazonaws.com. It passes StartScanJob's IamRoleArn and ScannerRoleArn to both of the first two without saying which goes where, so a vendored source, tools/aws/sources/backup-roles.json, written by tools/aws/fetch_backup_roles.py from the developer guide's malware protection page, gives each: the scanner role "trusts malware-protection.guardduty.amazonaws.com", and the backup role is "the same role found in ... the BackupSelection API", linking CreateBackupSelection, whose role the Service Reference passes to backup alone. The generator reads such a role as going where the reference passes that operation's roles, when that is one service.

A backup vault is checked by its name and a backup plan by its id; BackupStoredResourceArns answers the tags Backup holds on either, which an aws:ResourceTag condition reads. A recovery point's format the Service Reference gives with a literal * account, which the reader matches as written, so a request naming a recovery point by its ARN is checked on *, as one naming a DMS endpoint is.

A namespace the table reads is served on the shared tag routes only with a method its model gives on the path, as it already was only on the paths its model gives: Backup removes tags with POST /untag/{resourceArn}, so a DELETE on its /tags/{resourceArn}, which no Backup operation is and no action checks, was let through and removed tags an aws:ResourceTag deny relies on. It is now refused with MethodNotAllowedException (405), as a tag call sent with the other verb is.

Closes #6255.
2026-11-28 14:26:04 -04:00

36 lines
2.3 KiB
JSON

{
"_source": {
"pages": [
"https://docs.aws.amazon.com/aws-backup/latest/APIReference/API_StartScanJob.html",
"https://docs.aws.amazon.com/aws-backup/latest/devguide/malware-protection.html"
],
"fetcher": "tools/aws/fetch_backup_roles.py",
"retrieved": "2026-11-28",
"note": "Each member's description on its API reference page, copied as it stands; the malware protection page's Access item naming its role (roleText); and from that item the service principal the role trusts, or else the operation whose role the guide says it is (sameRoleAs)."
},
"members": [
{
"operation": "StartScanJob",
"member": "IamRoleArn",
"description": "Specifies the IAM role ARN used to create the target recovery point; for example, arn:aws:iam::123456789012:role/S3Access .",
"rolePage": "https://docs.aws.amazon.com/aws-backup/latest/devguide/malware-protection.html",
"section": "Access",
"roleText": "First, the AWSBackupServiceRolePolicyForBackup or AWSBackupServiceRolePolicyForScans managed policy must be attached to your existing or new backup role. This is the same role found in the resource assignment for your backup plan in the console, or through the BackupSelection API . This managed policy allows AWS Backup to initiate malware scans with Amazon GuardDuty.",
"sameRoleAs": {
"operation": "CreateBackupSelection"
}
},
{
"operation": "StartScanJob",
"member": "ScannerRoleArn",
"description": "Specified the IAM scanner role ARN.",
"rolePage": "https://docs.aws.amazon.com/aws-backup/latest/devguide/malware-protection.html",
"section": "Access",
"roleText": "Second, a new scanner role is required with AWSBackupGuardDutyRolePolicyForScans managed policy that trusts malware-protection.guardduty.amazonaws.com . To create this role, you can specify a custom trust policy and attach the required managed policy. This is the same role found in the malware protection portion of your backup plan in the console or through the scan settings in your BackupPlan API . This role is passed by AWS Backup to Amazon GuardDuty when a scan is initiated, providing access to backups.",
"trustedBy": [
"malware-protection.guardduty.amazonaws.com"
]
}
]
}