dataall icon indicating copy to clipboard operation
dataall copied to clipboard

IAM Policy enhancements - Split policy statements in chunks

Open anushka-singh opened this issue 1 year ago • 7 comments

Is your idea related to a problem? Please describe. The limit for managed IAM policies is 6144 characters. Based on a dirty approximation, each team can request access to around 35 buckets based on the number of characters in policy statements.

Describe the solution you'd like In v2.1.0 we added some utilities in dataall/base/utils/iam_policy_utils.py. We can reuse them to limit the resources per policy and splitting policies.

anushka-singh avatar Nov 17 '23 16:11 anushka-singh

Thanks for opening the issue for visibility @anushka-singh. We will work together on introducing this feature because as you noticed it includes some scenarios out of the ones considedred in the iam_policy_utils

dlpzx avatar Nov 27 '23 07:11 dlpzx

@dlpzx @SofiaSazonova @anmolsgandhi we ran into this issue on IAM policies when a role accumulated 38+ shares. Would be nice to prioritize this one.

zsaltys avatar Jul 05 '24 14:07 zsaltys

I started an investigation into it and here are my findings so far...

When using data.all generated IAM roles we already use all the policies (max 10 per role) for services hence we cannot add anymore. We can assume that not all deployment will have all the features enabled and those 10 might be fewer and as such have some space but I don't consider this a good solution.

When using consumption roles we don't have those service policies hence in theory we have space for adding more managed policies but keeping in mind that those roles are not data.all managed and hence users might have already added their own policies.

Overall to tackle this issue we need to come up with a smarter (which probably means dynamic) policy manager which will maximise the capacity based on the following limitations

  • 10 managed policies per role
  • 6144 chars per managed policy
  • 10240 chars in total across all the inline policies per role

petrkalos avatar Sep 05 '24 13:09 petrkalos