Giter Site home page Giter Site logo

Comments (4)

rvIceBreaker avatar rvIceBreaker commented on June 1, 2024

So it appears that I'm slightly incorrect, ${jwt:groups} does substitute the variable, but only with the first element when its an array of values; at least in terms of what my policy and requests authorize in testing.

...
{
    "Effect": "Allow",
    "Action": [
        "s3:DeleteObject",
        "s3:GetObject",
        "s3:PutObject"
    ],
    "Resource": [
        "arn:aws:s3:::testbucket1/${jwt:groups}",
        "arn:aws:s3:::testbucket1/${jwt:groups}/*"
    ]
}
...

There doesn't seem to be any way to index them individually.

from minio.

harshavardhana avatar harshavardhana commented on June 1, 2024

Right now, we need cycles to take this up @rvIceBreaker. I suggest pushing our roadmaps by becoming a customer if you have a production requirement.

However, this is not a priority and will be addressed later if and when we find some time.

from minio.

harshavardhana avatar harshavardhana commented on June 1, 2024

You can use jwt:groups as part of the ForAnyValue or ForAllValues conditionals. However, these are not supported in the resources and will only use the first element.

https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-logic-multiple-context-keys-or-values.html

from minio.

rvIceBreaker avatar rvIceBreaker commented on June 1, 2024

@harshavardhana I appreciate the response, this information isn't really clearly stated anywhere so hopefully this thread can save someone else some time.

As far as I can tell using ForAnyValues/ForAllValues on s3:ListBucket->s3:prefix also only matches against the first element.

//s3:ListBucket statement
"Condition": {
    "ForAllValues:StringLike": {
        "s3:prefix": [
            "${jwt:groups}",
            "${jwt:groups}/*"
        ]
    }
}
//s3:GetObject statement
"Resource": [
    "arn:aws:s3:::testbucket1/*"
]

In my testing, the above effectively only allows listing from the first element in ${jwt:groups}, though I can GetObject on a known object path that differs.

from minio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.