keystone/keystone
Colleen Murphy 1c1cf556f8 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)
(cherry picked from commit d6f1006dd0)
2020-05-31 22:16:05 -07:00
..
assignment Cache list projects and domains for user 2017-08-09 14:45:58 +00:00
auth Merge "Add annotation about token authenticate" 2017-06-23 21:31:03 +00:00
catalog Ensure the endpoint filter API supports HEAD 2017-06-13 14:03:14 +00:00
cmd Remove deprecation of domain_config_upload 2017-08-16 14:45:55 +00:00
common Fix json schema nullable to add None to ENUM 2018-04-19 13:25:02 +00:00
conf Check timestamp of signed EC2 token request 2020-05-31 22:16:05 -07:00
contrib Check timestamp of signed EC2 token request 2020-05-31 22:16:05 -07:00
credential Merge "Make use of Dict-base including extras explicit" 2017-03-31 20:11:14 +00:00
endpoint_policy Ensure the endpoint policy API supports HEAD 2017-06-20 19:44:43 +00:00
federation Mapped Groups don't exist breaks WebSSO 2018-09-24 14:50:31 -03:00
identity Delete shadow users when domain is deleted 2019-04-05 09:16:25 -07:00
locale Imported Translations from Zanata 2017-08-02 07:49:09 +00:00
middleware Make an error state message more explicit 2017-08-08 14:53:20 -07:00
models Revert change 438035 is_admin_project default 2017-05-11 10:46:03 -04:00
oauth1 Ensure oauth API supports HEAD 2017-06-21 15:00:38 +00:00
policy Remove unused CONF 2017-04-22 15:22:05 +08:00
resource Delete SQL users before deleting domain 2018-02-09 00:19:33 +01:00
revoke Remove unused revoke_by_domain_role_assignment 2017-03-24 15:22:04 +00:00
server Merge "Remove log translations in keystone" 2017-03-27 17:35:03 +00:00
tests Check timestamp of signed EC2 token request 2020-05-31 22:16:05 -07:00
token Remove duplicate roles from federated auth 2017-08-16 15:22:36 +00:00
trust Merge "Ensure the trust API supports HEAD requests" 2017-06-23 05:23:13 +00:00
v2_crud Use https for docs.openstack.org references 2017-01-30 16:05:08 -08:00
version Remove log translations in keystone 2017-03-25 18:17:15 +00:00
__init__.py Revert "Disable eventlet monkey-patching of DNS" 2013-05-10 10:24:48 -04:00
exception.py Handle ldap size limit exeeded exception 2017-10-25 02:06:08 +00:00
i18n.py Remove log translations in keystone 2017-03-25 18:17:15 +00:00
notifications.py Delete SQL users before deleting domain 2018-02-09 00:19:33 +01:00