1. 03 Jun, 2020 1 commit
    • Colleen Murphy's avatar
      Fix security issues with EC2 credentials · a405e4b7
      Colleen Murphy authored
      This change addresses several issues in the creation and use of EC2/S3
      credentials with keystone tokens.
      
      1. Disable altering credential owner attributes or metadata
      
      Without this patch, an authenticated user can create an EC2 credential
      for themself for a project they have a role on, then update the
      credential to target a user and project completely unrelated to them. In
      the worst case, this could be the admin user and a project the admin
      user has a role assignment on. A token granted for an altered credential
      like this would allow the user to masquerade as the victim user. This
      patch ensures that when updating a credential, the new form of the
      credential is one the acting user has access to: if the system admin
      user is changing the credential, the new user ID or project ID could be
      anything, but regular users may only change the credential to be one
      that they still own.
      
      Relatedly, when a user uses an application credential or a trust to
      create an EC2 credential, keystone automatically adds the trust ID or
      application credential ID as metadata in the EC2 access blob so that it
      knows how the token can be scoped when it is used. Without this patch, a
      user who has created a credential in this way can update the access blob
      to remove or alter this metadata and escalate their privileges to be
      fully authorized for the trustor's, application credential creator's, or
      OAuth1 access token authorizor's privileges on the project. This patch
      fixes the issue by simply disallowing updates to keystone-controlled
      metadata in the credential.
      
      2. Respect token roles when creating EC2 credentials
      
      Without this patch, a trustee, an application credential user, or an
      OAuth1 access token holder could create an EC2 credential or an
      application credential using any roles the trustor, application
      credential creator, or access token authorizor had on the project,
      regardless of whether the creator had delegated only a limited subset of
      roles. This was because the trust_id attribute of the EC2 access blob
      was ignored, and no metadata for the application credential or access
      token was recorded either. This change ensures that the access
      delegation resource is recorded in the metadata of the EC2 credential
      when created and passed to the token provider when used for
      authentication so that the token provider can look up the correct roles
      for the request.
      
      Conflicts (six removal in  e2d83ae9, pep8 fixes in e2d83ae9):
            keystone/api/credentials.py
            keystone/tests/unit/test_v3_application_credential.py
            keystone/tests/unit/test_v3_credential.py
      
      Conflicts due to flask reorg:
      	keystone/api/_shared/EC2_S3_Resource.py
      	keystone/api/credentials.py
      	keystone/api/users.py
      	keystone/tests/unit/test_v3_credential.py
      
      Moved the test_update_credential_non_owner unit test to
      CredentialSelfServiceTestCase since in this branch the default policies
      are not affected by #1872733.
      
      NOTE: the application credential functional changes, along with its
      tests were removed from the stable/pike backport as stable/pike does not
      support application credentials.
      
      Change-Id: I39d0d705839fbe31ac518ac9a82959e108cb7c1d
      Closes-bug: #1872733
      Closes-bug: #1872755
      Closes-bug: #1872735
      (cherry picked from commit 37e9907a)
      (cherry picked from commit 2f2736eb)
      (cherry picked from commit 27caafe3daa552663719954f2cd6713dd4493178)
      (cherry picked from commit bfba75fc3c5c8f119f74dbf31347e008824a2134)
      (cherry picked from commit 53d1ccb8a1bdbb5aa0efaacf9739b1a6f436e191)
      (cherry picked from commit 6db1bb09a048dfb7f337484698a9a19fdbbe9546)
      a405e4b7
  2. 02 Jun, 2020 2 commits
  3. 01 Jun, 2020 1 commit
    • Colleen Murphy's avatar
      Check timestamp of signed EC2 token request · 1c1cf556
      Colleen Murphy authored
      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 ab89ea74)
      (cherry picked from commit 8d5becbe)
      (cherry picked from commit e3f65d6f)
      (cherry picked from commit 1ef38285)
      (cherry picked from commit 35f09e2b7c00e03cd1d52a2337b51be38dd79480)
      (cherry picked from commit d6f1006dd0ca8f7999f32133d348fcec8f2299d3)
      1c1cf556
  4. 18 May, 2020 1 commit
    • Guang Yee's avatar
      Remove neutron-grenade job · 591fb3c8
      Guang Yee authored
      Neutron-grenade have a dependency on stestr 1.0.0 or later in stable/ocata.
      Unfortunately, we didn't add stestr to openstack/requirements till stable/pike.
      There's been an attempts to fix the problem in stable/ocata [1][2]. But it
      appears we won't be able to retrofit it because of the dependency conflicts.
      However, we still want to land critical security patches in stable/pike and
      since stable/pike is already in Extended Maintenance, it's best to just remove
      the neutron-grenade job.
      
      [1] https://review.opendev.org/#/c/718202/
      [2] https://review.opendev.org/#/c/726983/
      
      Change-Id: Icb32bda29b3c12d54269f4f257db5658538a5620
      591fb3c8
  5. 14 May, 2020 1 commit
    • Colleen Murphy's avatar
      Ensure OAuth1 authorized roles are respected · 7653847a
      Colleen Murphy authored
      Without this patch, when an OAuth1 request token is authorized with a
      limited set of roles, the roles for the access token are ignored when
      the user uses it to request a keystone token. This means that user of an
      access token can use it to escallate their role assignments beyond what
      was authorized by the creator. This patch fixes the issue by ensuring
      the token model accounts for an OAuth1-scoped token and correctly
      populating the roles for it.
      
      Modified to work with older test helper function:
      
        keystone/tests/unit/test_v3_oauth1.py
      
      Conflicts:
      
        keystone/models/token_model.py
      
        The keystone token model was refactored in the Rocky release. This
        commit only backports the test so that we have test coverage against
        the bug and proves there wasn't a regression in Queens. As such, the
        code changes to token_model.py (where the bug was introduced) are not
        applicable to Pike.
      
        releasenotes/notes/bug-1873290-ff7f8e4cee15b75a.yaml
      
        Removed the release note since there isn't anything to signal to
        operators regarding a vulnerability. We're only adding test coverage
        to prove that stable/queens isn't vulnerable.
      
      Change-Id: I02f9836fbd4d7e629653977fc341476cfd89859e
      Closes-bug: #1873290
      (cherry picked from commit 6c73690f)
      (cherry picked from commit ba89d277)
      (cherry picked from commit 5ff52dbaa2082991d229d8557a8e4b65256d6c53)
      (cherry picked from commit 2483a578a80a916d9f5acd672d85830385b236e2)
      (cherry picked from commit 10bc689a6796f85c44d19e0c18f0e37b0a87474c)
      (cherry picked from commit d590441ce6897a7a169db7262eb17bcd5d90bcd2)
      7653847a
  6. 17 Oct, 2019 1 commit
  7. 22 Aug, 2019 2 commits
    • Andreas Jaeger's avatar
      Remove experimental openSUSE 42.3 job · 7668597c
      Andreas Jaeger authored
      The openSUSE 42.3 distribution is eol, remove this experimental job so
      that the job can be removed from Zuul.
      
      Note that master has job for newer openSUSE running.
      
      Change-Id: Icd25b8695816f4d89a7aa00a9b9e9387866438f3
      7668597c
    • Andreas Jaeger's avatar
      Cap bandit · 4018f862
      Andreas Jaeger authored
      Bandit is a linter, let's cap the version in a stable branch
      so that new versions of bandit do not introduce pepe8 failures.
      
      This is capped to version 1.4, same version as listed in
      upper-constraints file in requirements repo for stable/pike branch.
      
      Change-Id: Idd2b6254bb4fcf4b168cd35a1a27a9da2ca2280d
      4018f862
  8. 09 May, 2019 1 commit
  9. 19 Apr, 2019 1 commit
  10. 15 Apr, 2019 1 commit
  11. 05 Apr, 2019 1 commit
    • Colleen Murphy's avatar
      Delete shadow users when domain is deleted · d76a068d
      Colleen Murphy authored
      Without this change, when an admin tries to delete an LDAP-backed
      domain, it fails due to the foreign key relationship in the users table.
      Previously, we were assuming that LDAP users existed solely in the LDAP
      directory, but this is not true with shadow users. This patch fixes the
      logic to delete the shadow users upon domain deletion.
      
      Altered cherry-pick: use injected API provider since provider_api
      mechanism doesn't exist in pike.
      
      Change-Id: I12a08001e3aa08e4db9438cae425ad1a0a8070f7
      Closes-bug: #1801873
      (cherry picked from commit 1b16725d)
      d76a068d
  12. 24 Mar, 2019 1 commit
  13. 12 Mar, 2019 1 commit
  14. 19 Oct, 2018 1 commit
  15. 02 Oct, 2018 1 commit
    • Vishakha Agarwal's avatar
      LDAP attribute names non-case-sensitive · 55fda22d
      Vishakha Agarwal authored
      keystone was not able to find any users while
      the LDAP user name attribute was configured to
      "samaccountname", but could find users when
      reconfigured to use "sAMAccountName". LDAP is
      not supposed to be case-sensitive, so either
      should work.
      
      This patch addresses the above problem by making
      both the attributes into lower case. Also updated
      the ldap_result example supporting python3.
      
      Change-Id: I51813ac41489baed04f3cadbccd748e03025313e
      Closes-Bug: #1753585
      (cherry picked from commit 816b472a)
      55fda22d
  16. 24 Sep, 2018 1 commit
    • Vishakha Agarwal's avatar
      Mapped Groups don't exist breaks WebSSO · a09ba690
      Vishakha Agarwal authored
      The issue occurs if a user has a group that
      does not map to a project in OpenStack. At
      which point an exception is raised and the
      websso login blows up with a 500 message.
      This is because of the exception being raised
      when the group name not matches thus replacing
      that with a log.
      
      Change-Id: Ia7321705db118af28f3dc6e01d5b18e8650aa633
      Closes-Bug: #1789450
      (cherry picked from commit ee46f735)
      a09ba690
  17. 29 Aug, 2018 1 commit
    • Doug Hellmann's avatar
      import zuul job settings from project-config · 6c63f8ea
      Doug Hellmann authored
      This is a mechanically generated patch to complete step 1 of moving
      the zuul job settings out of project-config and into each project
      repository.
      
      Because there will be a separate patch on each branch, the branch
      specifiers for branch-specific jobs have been removed.
      
      Because this patch is generated by a script, there may be some
      cosmetic changes to the layout of the YAML file(s) as the contents are
      normalized.
      
      See the python3-first goal document for details:
      https://governance.openstack.org/tc/goals/stein/python3-first.html
      
      Change-Id: I549ec25953d8a5870c0aad211ccb9ca8418ba151
      Story: #2002586
      Task: #24304
      6c63f8ea
  18. 25 Jul, 2018 1 commit
    • Lance Bragstad's avatar
      Reduce duplication in federated auth APIs · ce46cc25
      Lance Bragstad authored
      
      
      The GET /v3/OS-FEDERATION/projects and GET /v3/OS-FEDERATION/domains
      APIs were introduced to handle tokens from federated users, but now
      that GET /v3/auth/projects and GET /v3/auth/domains know how to handle
      federated tokens, they're just duplicate APIs.
      
      In the past we deprecated these federated auth APIs, but they still
      used separate code paths from GET /v3/auth/projects and GET
      /v3/auth/domains. The two code paths are true duplication in that they
      don't expect to differ over time and should provide the same user
      experience.
      
      Instead of running the risk that comes with two code paths that do the
      same thing, we should consolidate them.
      
      Conflicts:
        keystone/federation/controllers.py due to the fact that pre-Queens
        code used a different dependency framework. This was reworked in
        the Queens release, causing a conflict with this patch since it
        touches the same code.
      
      Co-Authored-By: default avatarKristi Nikolla <kristi@nikolla.me>
      
      Closes-Bug: 1779205
      Change-Id: Ib906c42e1dd2c2408ccd2e256ffd876af02af3fe
      (cherry picked from commit df5d7557)
      ce46cc25
  19. 19 Apr, 2018 1 commit
    • Morgan Fainberg's avatar
      Fix json schema nullable to add None to ENUM · 22af1d9f
      Morgan Fainberg authored
      The JSON Schema validation implementation of nullable(), which makes
      values possible to be null was not adding None to the enum if it exists.
      This causes validation to fail on ``None`` especially in the case of
      keystone's boolean parameter_type implementation. ``nullable()`` now
      adds ``None`` to the enum if the enum exists.
      
      Closes-Bug: #1763824
      Change-Id: I176fa90df63049661413c445554dba9b7d87272a
      (cherry picked from commit 78adf4b4)
      22af1d9f
  20. 20 Feb, 2018 1 commit
  21. 14 Feb, 2018 4 commits
  22. 08 Feb, 2018 1 commit
    • Colleen Murphy's avatar
      Delete SQL users before deleting domain · fb814694
      Colleen Murphy authored
      Since the users table has a foreign key to the projects table[1], users
      must be deleted before the domain can be deleted. However, the
      notification emitted from the domain deletion comes too late, and
      keystone runs into a foreign key reference error before it can delete
      the users. This patch addresses the problem by adding a new internal
      notification to alert the identity manager that users should be deleted.
      This uses a new notification rather than the existing notification
      because the existing one is used to alert listeners that the domain
      deletion has been fully completed, whereas this one must happen in the
      middle of the domain delete process.
      
      The callback must also only try to delete SQL users. The LDAP driver
      doesn't support deleting users, and we can't assume other drivers
      support it either. Moreover, the foreign key reference is only a problem
      for SQL users anyway.
      
      Because our backend unit tests run with SQLite and foreign keys do not
      work properly, we can't properly expose this bug in our unit tests, but
      there is an accompanying tempest test[2][3] to validate this fix.
      
      [1] https://github.com/openstack/keystone/blob/2bd88d3/keystone/common/sql/expand_repo/versions/014_expand_add_domain_id_to_user_table.py#L140-L141
      [2] https://review.openstack.org/#/c/509610
      [3] https://review.openstack.org/#/c/509947
      
      Change-Id: If5bdb6f5eef80b50b000aed5188ce7da4dfd1083
      Closes-bug: #1718747
      (cherry picked from commit 62ee18b3)
      fb814694
  23. 16 Jan, 2018 1 commit
    • Lance Bragstad's avatar
      Expose a get_enforcer method for oslo.policy scripts · 075b8ad4
      Lance Bragstad authored
      Because we have policy in code, we should be able to use the
      oslo.policy CLI scripts to produce sample policy files and render
      complete policies based on overrides on disk. This was broken
      because keystone wasn't removing unexpected commandline arguments
      before passing them to oslo.config to parse. This prevented
      people from generating complete policy files like they would for
      horizon.
      
      This commit exposes a get_enforcer() that substitutes an empty list
      in place of arguments passed in through the system. This makes it
      so that oslo.config doesn't choke when processing configuration
      values.
      
      Change-Id: I22583258eac5b3a64208355d18ccfa62dba1871d
      Closes-Bug: 1740951
      (cherry picked from commit 85c957c5)
      075b8ad4
  24. 12 Jan, 2018 1 commit
  25. 29 Nov, 2017 1 commit
    • Gage Hugo's avatar
      Add New in Pike note to using db_sync check · 543a71f1
      Gage Hugo authored
      This change adds a note (*New in Pike*) to the section for running
      db_sync --check to clarify which release this feature was added. This
      is similar to other sections in this document that specify the release
      that a feature was added in and when it is available.
      
      Change-Id: I7d778fa249997bb24e4563d6960910b93637bbf2
      Closes-Bug: #1734549
      (cherry picked from commit 756d2814)
      543a71f1
  26. 15 Nov, 2017 1 commit
    • prashkre's avatar
      Filter users/groups in ldap with whitespaces · d0721d7c
      prashkre authored
      All users and groups are required to have a name. With this fix,
      Keystone will ignore users and groups that do have only white
      spaces as value for the LDAP attribute which Keystone has been
      configured to use for that entity's name.
      
      Change-Id: Id539e1b7e1cea8b05cd9bb753707e1fc98244d29
      Closes-Bug: #1727726
      (cherry picked from commit 789573a0)
      d0721d7c
  27. 25 Oct, 2017 1 commit
    • prashkre's avatar
      Handle ldap size limit exeeded exception · d07677ab
      prashkre authored
      LDAP servers have sizelimit configuration to limit the number of
      user/group objects that can be returned for an LDAP query. This
      change catches the size limit exceeded exception when users/groups
      returned from ldap search query exceeds the configured limit and
      responds with an appropriate error message instead of default
      500 error message.
      
      Change-Id: I9949bb7d458b4b037616c701e0e4d362bfa36473
      Closes-Bug: #1712415
      (cherry picked from commit f776fc18)
      d07677ab
  28. 11 Oct, 2017 1 commit
  29. 09 Oct, 2017 1 commit
    • Gage Hugo's avatar
      Copy specific distro pages for install guide · 5c9ccced
      Gage Hugo authored
      This change breaks the get-started-identity, keystone-users,
      and keystone-openrc pages into multiple copies for each distribution
      release in the keystone install guides. Before this change, sphinx
      would not render the links correctly and these pages would be skipped
      in both the RDO and Ubuntu guides.
      
      To avoid unnecessary duplication of the same text, the files were
      moved into common/ and are simply included into the newly created
      files for each release.
      
      Change-Id: I7b478504f1e68034ea993c0214705045da86bb6e
      Closes-Bug: #1716899
      Closes-Bug: #1716792
      (cherry picked from commit 04515333)
      5c9ccced
  30. 08 Oct, 2017 1 commit
    • Lance Bragstad's avatar
      Remove admin_token_auth steps from install guide · e520fb5a
      Lance Bragstad authored
      The installation guide previously listed this as a step but
      it is no longer needed since `admin_token_auth` is no longer in the
      paste file by default
      
      Change-Id: If36bafbecd657c3acd769f11636a1d844be0ac66
      Closes-Bug: 1716797
      (cherry picked from commit 5194a369)
      e520fb5a
  31. 26 Aug, 2017 2 commits
  32. 22 Aug, 2017 1 commit
    • Lance Bragstad's avatar
      Update pike to ignore specific release notes · 317ade3a
      Lance Bragstad authored
      Some notes were updated due to the docs migration but they were only
      relevant for the ocata or newton release. This commit prevents those
      notes from being rendered in the pike release notes document.
      
      Change-Id: Id705bad286c75870746ef56c2c9c44a1cdf049a7
      317ade3a
  33. 17 Aug, 2017 1 commit
  34. 16 Aug, 2017 1 commit