Open joemiller opened 1 year ago
https://github.com/hashicorp/vault/pull/18813 is first step towards achieving this. Please upvote it so that we can land it on mainline and introduce templates in the future.
I have also added some thoughts on an alternative approach that is viable today using the Vault identity engine. https://harsimranmaan.medium.com/aws-abac-attribute-based-access-control-using-hashicorp-vault-e9a6c07c066e
@harsimranmaan thank you for the article! I was not aware the identity engine could do that 🤦
It can do it but has its complexities around setting it up. For most orgs already hooked onto AWS secrets engine, native support is the way to go.
Is your feature request related to a problem? Please describe.
Not a problem per se. Perhaps it may lead to being able to better conform to certain AWS IAM best practices around using tags and ABAC-style policies.
Describe the solution you'd like
I have an example use case where it would be desirable for the AWS secrets backend to be able to apply session tags on credentials issued by the
aws/sts/creds
API. This would allow greater dynamism in the AWS backend.example use case:
I want to auth OIDC tokens from my CI using the
auth/jwt
backend and a single auth role. Most CI providers are offering per-job OIDC tokens now. I will use Buildkite in this example but it applies to GHA and others.auth/jwt/role/<REPO>
role for each.How this might look in practice:
auth/jwt
rolebuildkite-pipelines
:buildkite-pipelines
. This role will be assumed by any BK pipeline in our org.buildkite-pipelines
that will assume the role created in the previous step:Buildkite pipelines would use their OIDC token to auth to vault and fetch AWS creds. These creds would have a
pipeline_slug
session tag.Then, an S3 bucket could be made available for all pipelines to use with a single bucket policy. They would be restricted to read/write/list on the path
cache/<PIPELINE>
where<PIPELINE>
is thepipeline_slug
conveyed from the claims on the BK OIDC token down to a session tag on the AWS IAM creds:Describe alternatives you've considered
sts:AssumeRole
API with those claims as session tags, returning the resulting creds to the caller. https://github.com/glassechidna/ghaoidc/blob/main/api/api.goExplain any additional use-cases
In general I think this would go a long way towards allowing folks to expressing more ABAC-style IAM policies with Vault.