Limit actions within Opensearch Serverless IAM policy

0

I'm trying to limit the actions given within my IAM role statement but it is only working when full access is given (aoss:*). I'm trying to limit this down to only allow users to have minimum access to the collection.

Below is my working example:

iamRoleStatements:
            - Effect: Allow
              Action:
                  - aoss:APIAccessAll
              Resource:
                  - arn:aws:aoss:${aws:region}:${aws:accountId}:collection/open_search_collection_id
            - Effect: Allow
              Action:
                  - aoss:DashboardsAccessAll
              Resource:
                  - arn:aws:aoss:${aws:region}:${aws:accountId}:dashboards/default
            - Effect: Allow
              Action:
                  - aoss:*
              Resource:
                  - '*'

I have had a look at the documentation and implemented the full list of actions to then try eliminate one by one, but with the full action list added it is still throwing an error. The example is shown below.

iamRoleStatements:
            - Effect: Allow
              Action:
                  - aoss:APIAccessAll
                  - aoss:DeleteCollection
                  - aoss:UpdateCollection
              Resource:
                  - arn:aws:aoss:${aws:region}:${aws:accountId}:collection/open_search_collection_id
            - Effect: Allow
              Action:
                  - aoss:DashboardsAccessAll
              Resource:
                  - arn:aws:aoss:${aws:region}:${aws:accountId}:dashboards/default
            - Effect: Allow
              Action:
                  - aoss:BatchGetCollection
                  - aoss:BatchGetVpcEndpoint
                  - aoss:CreateAccessPolicy
                  - aoss:CreateCollection
                  - aoss:CreateSecurityConfig
                  - aoss:CreateSecurityPolicy
                  - aoss:CreateVpcEndpoint
                  - aoss:DeleteAccessPolicy
                  - aoss:DeleteSecurityConfig
                  - aoss:DeleteSecurityPolicy
                  - aoss:DeleteVpcEndpoint
                  - aoss:GetAccessPolicy
                  - aoss:GetAccountSettings
                  - aoss:GetPoliciesStats
                  - aoss:GetSecurityConfig
                  - aoss:GetSecurityPolicy
                  - aoss:ListAccessPolicies
                  - aoss:ListCollections
                  - aoss:ListSecurityConfigs
                  - aoss:ListSecurityPolicies
                  - aoss:ListTagsForResource
                  - aoss:ListVpcEndpoints
                  - aoss:UpdateAccessPolicy
                  - aoss:UpdateAccountSettings
                  - aoss:UpdateSecurityConfig
                  - aoss:UpdateSecurityPolicy
                  - aoss:UpdateVpcEndpoint
              Resource:
                  - '*'

Any help would be greatly appreciated!

1개 답변
0

Hello.
What error messages are you getting?

profile picture
전문가
답변함 10달 전
  • It's returning a 403 Forbidden error.

  • Am I correct in assuming that the following policies are working properly? By the way, is this policy the one used by IAM users, etc.?

    iamRoleStatements:
                - Effect: Allow
                  Action:
                      - aoss:APIAccessAll
                  Resource:
                      - arn:aws:aoss:${aws:region}:${aws:accountId}:collection/open_search_collection_id
                - Effect: Allow
                  Action:
                      - aoss:DashboardsAccessAll
                  Resource:
                      - arn:aws:aoss:${aws:region}:${aws:accountId}:dashboards/default
                - Effect: Allow
                  Action:
                      - aoss:*
                  Resource:
                      - '*'
    

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠