mirror of
https://github.com/floci-io/floci.git
synced 2026-12-04 02:28:08 -05:00
Under enforcement a REST route no vendored model names runs unchecked, and CloudWatch RUM was among them: any caller could create, read, update, delete or list app monitors with no permission at all. RUM's model routes are vendored (regen_rest_routes.MODELS, signed rum), so each request is checked as its operation's action, and rum joins the generated tables of request resources, passed roles and tags on create: an app monitor by the name its path gives, the tags a create carries, and PutRumMetricsDestination's IamRoleArn passed to rum, which applies once Floci serves that operation, as it serves only the app monitor routes today. RumStoredResourceArns answers the tags RUM holds on an app monitor, read in place in the ARN's account and Region, which an aws:ResourceTag condition reads. PutRumEvents names its monitor by an id, which the table asks to be found; Floci does not serve it, so there is nothing to find. IamRestRouteEnforcementIntegrationTest checks that with no grant a monitor's read is refused, that a grant on one monitor reads it and refuses another, that an aws:ResourceTag condition reads a monitor's tags, that a create granted on the monitor its Name makes passes with a guest role in its configuration, whose IAM role ARN is not taken for a monitor, and that a create carrying tags is refused until rum:TagResource is granted on the monitor it makes.