keystone/keystone
Colleen Murphy b25739fa96 Check timestamp of signed EC2 token request
EC2 token requests contain a signature that signs the entire request,
including the access timestamp. While the signature is checked, the
timestamp is not, and so these signed requests remain valid
indefinitely, leaving the token API vulnerable to replay attacks. This
change introduces a configurable TTL for signed token requests and
ensures that the timestamp is actually validated against it.

The check will work for either an AWS Signature v1/v2 'Timestamp'
parameter[1] or the AWS Signature v4 'X-Aws-Date' header or
parameter[2].

Although this technically adds a new feature and the default value of
the feature changes behavior, this change is required to protect
credential holders and therefore must be backported to all supported
branches.

[1] https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html
[2] https://docs.aws.amazon.com/general/latest/gr/sigv4-date-handling.html

Conflicts due to six removal in e2d83ae9:
	keystone/api/_shared/EC2_S3_Resource.py
	keystone/tests/unit/test_contrib_ec2_core.py

Conflicts due to v2.0 API testing in stable/queens. The v2.0 tests were
removed in Rocky but in earlier releases we tested similar functionality
between v3 and v2.0. This conflict was resolved by porting the timestamp
to the v2.0 API test:
	keystone/tests/unit/test_contrib_ec2_core.py

Conflicts due to flask reorg:
	keystone/api/_shared/EC2_S3_Resource.py

Change-Id: Idb10267338b4204b435df233c636046a1ce5711f
Closes-bug: #1872737
(cherry picked from commit ab89ea7490)
(cherry picked from commit 8d5becbe4b)
(cherry picked from commit e3f65d6fbc)
(cherry picked from commit 1ef3828516)
(cherry picked from commit 35f09e2b7c)
2020-05-11 19:41:13 +00:00
..
application_credential Invalidate app cred AFTER deletion 2018-10-21 19:52:38 +00:00
assignment Delete system role assignments when deleting groups 2018-02-14 19:21:44 +00:00
auth Use keystone.common.provider_api for auth APIs 2018-02-02 22:07:29 +00:00
catalog Use keystone.common.provider_api for catalog APIs 2017-12-27 16:32:18 +00:00
cmd Ensure bootstrap handles multiple roles with the same name 2020-03-06 19:11:53 +00:00
common Make system tokens work with domain-specific drivers 2019-10-22 16:56:09 -07:00
conf Check timestamp of signed EC2 token request 2020-05-11 19:41:13 +00:00
contrib Check timestamp of signed EC2 token request 2020-05-11 19:41:13 +00:00
credential Add retry for DBDeadlock in credential delete 2019-09-09 09:01:35 +05:30
endpoint_policy Use keystone.common.provider_api for endpoint_policy APIs 2017-12-27 16:56:49 +00:00
federation Mapped Groups don't exist breaks WebSSO 2018-09-24 16:06:35 +00:00
identity Revert "Fix python3 compatibility on LDAP search DN from id" 2019-10-30 08:51:24 -04:00
limit Expose unified limit APIs 2018-01-25 16:33:11 +08:00
locale Imported Translations from Zanata 2018-03-14 06:35:15 +00:00
middleware Implement system-scoped tokens 2018-01-23 23:33:43 +00:00
models Implement system-scoped tokens 2018-01-23 23:33:43 +00:00
oauth1 Remove all v2.0 APIs except the ec2tokens API 2018-02-06 23:12:55 +01:00
policy Use keystone.common.provider_api for policy APIs 2017-12-27 17:10:20 +00:00
resource Remove @expression from tags 2018-03-01 13:26:00 +00:00
revoke Remove all v2.0 APIs except the ec2tokens API 2018-02-06 23:12:55 +01:00
server Add limit provider 2018-01-25 15:45:44 +08:00
tests Check timestamp of signed EC2 token request 2020-05-11 19:41:13 +00:00
token Allows to use application credentials through group membership 2019-11-13 15:28:46 +00:00
trust Populate application credential data in token 2018-02-20 08:47:02 +01:00
version Remove all v2.0 APIs except the ec2tokens API 2018-02-06 23:12:55 +01:00
__init__.py Revert "Disable eventlet monkey-patching of DNS" 2013-05-10 10:24:48 -04:00
exception.py Impose limits on application credentials 2018-01-27 12:00:23 +01:00
i18n.py Update links in keystone 2017-09-12 15:18:13 +08:00
notifications.py Set initiator id as user_id for auth events 2019-03-19 10:54:25 +01:00