Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

Create IAM Policy Resource #58

Open
christopherhein opened this issue Sep 29, 2018 · 3 comments
Open

Create IAM Policy Resource #58

christopherhein opened this issue Sep 29, 2018 · 3 comments
Labels
needs help Needs help from a contributor new-resource All new resource requests operator/iampolicy IAM Policy operator package

Comments

@christopherhein
Copy link
Contributor

This will allow you to create an IAM Policy that you can reference from an IAM Role, giving you the ability to give out specific permissions to every role.

Long term when you build a syncing tool, use this to load existing policies in IAM that way they can be referenced via the Roles OR use the same naming scheme to allow you to use any standard policy name.

apiVersion: operator.aws/v1alpha1
kind: IAMPolicy
metadata:
  name: aws-operator
spec:
  dynamodb:
    list:
    - ListBackups
    - ListGlobalTables
    - ListTables
    read:
    - BatchGetItem
    - DescribeBackup
    - DescribeContinuousBackups
    - DescribeGlobalTable
    - DescribeGlobalTableSettings
    - DescribeLimits
    - DescribeReservedCapacity
    - DescribeReservedCapacityOfferings
    - DescribeStream
    - DescribeTable
    - DescribeTimeToLive
    - GetItem
    - GetRecords
    - GetShardIterator
    - ListStreams
    - ListTagsOfResource
    - Query
    - Scan
    write:
    - BatchWriteItem
    - CreateBackup
    - CreateGlobalTable
    - CreateTable
    - DeleteBackup
    - DeleteItem
    - DeleteTable
    - PurchaseReservedCapacityOfferings
    - PutItem
    - RestoreTableFromBackup
    - RestoreTableToPointInTime
    - TagResource
    - UntagResource
    - UpdateContinuousBackups
    - UpdateGlobalTable
    - UpdateGlobalTableSettings
    - UpdateItem
    - UpdateTable
    - UpdateTimeToLive
    # ...
@christopherhein christopherhein added the operator/iamrole IAM Role operator package label Sep 29, 2018
@christopherhein christopherhein added needs help Needs help from a contributor operator/iampolicy IAM Policy operator package and removed operator/iamrole IAM Role operator package labels Sep 29, 2018
@christopherhein christopherhein added the new-resource All new resource requests label Oct 4, 2018
@sepulworld
Copy link
Contributor

I'm not sure I understand where you are going with example provided. Wouldn't it make sense to have 'actions' and 'resources' as spec values?

apiVersion: operator.aws/v1alpha1
kind: IAMPolicy
metadata:
  name: app-foo-dynamodb-access
spec:
  actions:
  - dynamodb:*
  resources:
  - arn:aws:dynamodb:us-east-2:123456789012:table/app-foo-*

@christopherhein
Copy link
Contributor Author

I'm not sure I understand where you are going with example provided. Wouldn't it make sense to have 'actions' and 'resources' as spec values?

apiVersion: operator.aws/v1alpha1
kind: IAMPolicy
metadata:
  name: app-foo-dynamodb-access
spec:
  actions:
  - dynamodb:*
  resources:
  - arn:aws:dynamodb:us-east-2:123456789012:table/app-foo-*

Definitely, this will be really useful and I have some ideas around the resources, I'm trying to design a better strategy for referencing resources similar to how k8s core does with configmaps and secrets I could image this being something like:

- arn: {arn} # or arn with wildcards
  resourceRef: # optional if you'd like to reference a Kubernetes managed AWS Resource
    name: {name}
    namespace: {namespace}

@micahlmartin
Copy link

Wanted to checkin and see if any more progress has been made on the design of this. I'm curious how you would address assume role and inline policies.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs help Needs help from a contributor new-resource All new resource requests operator/iampolicy IAM Policy operator package
Projects
None yet
Development

No branches or pull requests

3 participants