open-vault/builtin/logical/aws
Joel Thompson ac18a44fae secret/aws: Pass policy ARNs to AssumedRole and FederationToken roles (#6789)
* secret/aws: Pass policy ARNs to AssumedRole and FederationToken roles

AWS now allows you to pass policy ARNs as well as, and in addition to,
policy documents for AssumeRole and GetFederationToken (see
https://aws.amazon.com/about-aws/whats-new/2019/05/session-permissions/).
Vault already collects policy ARNs for iam_user credential types; now it
will allow policy ARNs for assumed_role and federation_token credential
types and plumb them through to the appropriate AWS calls.

This brings along a minor breaking change. Vault roles of the
federation_token credential type are now required to have either a
policy_document or a policy_arns specified. This was implicit
previously; a missing policy_document would result in a validation error
from the AWS SDK when retrieving credentials. However, it would still
allow creating a role that didn't have a policy_document specified and
then later specifying it, after which retrieving the AWS credentials
would work. Similar workflows in which the Vault role didn't have a
policy_document specified for some period of time, such as deleting the
policy_document and then later adding it back, would also have worked
previously but will now be broken.

The reason for this breaking change is because a credential_type of
federation_token without either a policy_document or policy_arns
specified will return credentials that have equivalent permissions to
the credentials the Vault server itself is using. This is quite
dangerous (e.g., it could allow Vault clients access to retrieve
credentials that could modify Vault's underlying storage) and so should
be discouraged. This scenario is still possible when passing in an
appropriate policy_document or policy_arns parameter, but clients should
be explicitly aware of what they are doing and opt in to it by passing
in the appropriate role parameters.

* Error out on dangerous federation token retrieval

The AWS secrets role code now disallows creation of a dangerous role
configuration; however, pre-existing roles could have existed that would
trigger this now-dangerous code path, so also adding a check for this
configuration at credential retrieval time.

* Run makefmt

* Fix tests

* Fix comments/docs
2019-08-20 12:34:41 -07:00
..
cmd/aws Update to api 1.0.1 and sdk 0.1.8 2019-04-15 14:10:07 -04:00
backend.go Switch to go modules (#6585) 2019-04-13 03:44:06 -04:00
backend_test.go secret/aws: Pass policy ARNs to AssumedRole and FederationToken roles (#6789) 2019-08-20 12:34:41 -07:00
client.go Create sdk/ and api/ submodules (#6583) 2019-04-12 17:54:35 -04:00
path_config_lease.go Switch to go modules (#6585) 2019-04-13 03:44:06 -04:00
path_config_root.go Switch to go modules (#6585) 2019-04-13 03:44:06 -04:00
path_config_rotate_root.go Switch to go modules (#6585) 2019-04-13 03:44:06 -04:00
path_roles.go secret/aws: Pass policy ARNs to AssumedRole and FederationToken roles (#6789) 2019-08-20 12:34:41 -07:00
path_roles_test.go secret/aws: Pass policy ARNs to AssumedRole and FederationToken roles (#6789) 2019-08-20 12:34:41 -07:00
path_user.go secret/aws: Pass policy ARNs to AssumedRole and FederationToken roles (#6789) 2019-08-20 12:34:41 -07:00
rollback.go Switch to go modules (#6585) 2019-04-13 03:44:06 -04:00
secret_access_keys.go secret/aws: Pass policy ARNs to AssumedRole and FederationToken roles (#6789) 2019-08-20 12:34:41 -07:00
secret_access_keys_test.go Allow use of pre-existing policies for AWS users 2015-12-30 18:05:54 +00:00