mirror of
https://github.com/floci-io/floci.git
synced 2026-11-30 00:45:17 -05:00
The request-resources table gives CloudWatch's alarms, dashboards and metric streams the aws:ResourceTag keys, which the Service Reference lists for them, but CloudWatch answered no storedTags, so a condition on a resource tag never matched: a caller allowed cloudwatch:DeleteAlarms only on alarms tagged team=blue was refused it on the blue alarm as on any other. CloudWatchStoredResourceArns reads the tags CloudWatch's tag operations read, each kind from the service keeping it: an alarm's from the metrics service, a dashboard's from the dashboards service and a metric stream's from the metric streams service. An ARN of another account, or one naming no resource CloudWatch holds, reads none. The dashboards and metric streams services changed a resource's tags in place under no lock, and their tag read handed out the live map, which an IAM check reading it while another request tags the resource could see half changed or fail on. Their tag read, tag and untag are now synchronized, and the read returns a copy, as the metrics service's already were; the dashboards and metric streams service tests check the read is a copy. Each kind is told by the resource part its ARN starts with (alarm:, dashboard/, metric-stream/), as the table's formats name it. isDashboardArn and isMetricStreamArn matched their word anywhere in the ARN, and an alarm may be named x:dashboard/y, which then went to the dashboards service, read no tags and escaped a tag-scoped Deny; the tag handlers dispatched with the same helpers, so they now match the prefix too.