Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish work on the SSO on 2FA feature #288

Merged
merged 30 commits into from
Aug 8, 2023
Merged

Finish work on the SSO on 2FA feature #288

merged 30 commits into from
Aug 8, 2023

Commits on Aug 8, 2023

  1. Update .gitignore

    Ignore the /app and /web folders. /app is used by ansible to deploy some
    certificates. And the /web folder is used to store the u2f app ID
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    f28eec1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a2cc0cc View commit details
    Browse the repository at this point in the history
  3. Configure SSO on 2FA configuration option

    The sso cookie:
     - name
     - type
     - lifetime
    
    Can be configured in the parameters.yaml
    
    They are then validated in the DI Configuration component. As they are
    part of the `surfnet_stepup_gateway_gateway` bundle configuration.
    
    See: https://www.pivotaltracker.com/story/show/183402574
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    a9526ad View commit details
    Browse the repository at this point in the history
  4. Add docs/SsoOn2Fa.md readme

    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    fdb649d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    068c945 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2c5a234 View commit details
    Browse the repository at this point in the history
  7. Create a CookieValue value object

    This object contains all data we need to store SSO on the Second Factor
    authentication. The cookie value is used to recognize an identity, it's
    second factor used and the associated LoA.
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    2b677b5 View commit details
    Browse the repository at this point in the history
  8. Provide a helper class to assist in crypto actions

    The authentication, verification, encryption and decryption is
    implemented in this helper class. The helper in turn uses the Paragon
    Halite library to actually perform the crypto actions.
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    fe9d18d View commit details
    Browse the repository at this point in the history
  9. Create a cookie read/write helper

    This is a helper class that:
    
    1. reads and decrypts, encrypted cookie data from the configured sso cookie
    2. writes encrypted data to the configured sso on 2fa cookie
    
    Goal is to limit access to the actual creation of the Cookie in the
    application. We use this helper to configure sane, industry standard
    settings for the cookie.
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    d3692e0 View commit details
    Browse the repository at this point in the history
  10. Write outline of the cookie service

    WIP
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    bbcb225 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    49942b7 View commit details
    Browse the repository at this point in the history
  12. Improve quality of SSO 2FA cookie implementation

    This includes improving exception messages, making the fingerprinting
    more pragmatic, and addressing smaller readability, code construction
    changes.
    
    Thanks @pmeulen and @Shaky212
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    a338775 View commit details
    Browse the repository at this point in the history
  13. Create two SSO 2FA behat tests

    In order to get them to work, a host of changes where required. Most
    notable changes required was that the SSO authentications did not yet
    utilize the mock gateway remote IdP setup. It visited the SSP mock idp
    that is not available in this container. Trololo
    
    Next up was to configure the certificates correctly.
    
    Finally the new sso-on-2fa.feature itself could be constructed.
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    06c8369 View commit details
    Browse the repository at this point in the history
  14. Store cookie before sending SAML response

    The cookie is created in the renderSamlResponse method of
    GatewayController. Serveral information is required to determine if the
    cookie may be created. The institution must support sso-on-2fa
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    59f05fe View commit details
    Browse the repository at this point in the history
  15. Move integration logic into CookieService

    That makes sure we need little/no code duplication between the SFO and
    SSO implementations of the Gateway auth modes.
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    e85a8f6 View commit details
    Browse the repository at this point in the history
  16. Improve behat test scenario

    1. By using a real SP/IdP, we can more realistically track the different
       authentication varieties.
    2. A new SSP container is added to the docker-compose (ci) that runs the
       SP/IdP
    3. The scenarios have been updated to authenticat on the SSP debug sp
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    c277991 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    70c3e47 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    3c3149b View commit details
    Browse the repository at this point in the history
  19. Update node packages

    In the process a lot of the webpack configuration was modernized. Chief
    amongst which was to replace TS lint with ES lint
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    a73b11e View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    5eb4f28 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    3d4d1c3 View commit details
    Browse the repository at this point in the history
  22. Configure exceptions to Allow|Store SSO on 2FA

    Don't store the SSO cookie when a RA vetting procedure is handled by
    Gateway. Or any of the other SP's that have this explicitly configured
    in the middleware config.
    
    Don't try to give SSO on 2FA when one of the SPs which are configured to
    not evaluate the SSO cookie. This is also configured in the MW config.
    
    See: https://www.pivotaltracker.com/story/show/183511012
    See: OpenConext/Stepup-Middleware#391
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    897d123 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    b422e3f View commit details
    Browse the repository at this point in the history
  24. Configure exceptions to Allow|Store SSO on 2FA

    Don't store the SSO cookie when a RA vetting procedure is handled by
    Gateway.
    
    Don't try to give SSO on 2FA when one of the `gssp_allowed_sps` is used
    during authentication.
    
    See: https://www.pivotaltracker.com/story/show/183511012
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    f29a9f6 View commit details
    Browse the repository at this point in the history
  25. Log SSO on 2FA authentications to auth-log

    To get the correct data into the log message. Some additional stowing of
    data was required on the context (state handler).
    
    See: https://www.pivotaltracker.com/story/show/183511341
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    79c27fd View commit details
    Browse the repository at this point in the history
  26. Repair rebase damages

    1. Remove the ra_vetting_procedure_sp_metadata_url_regex config option
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    d46aee1 View commit details
    Browse the repository at this point in the history
  27. Store resulting loa, not the required

    The required (required by SP) LoA was stored in the SSO cookie. That is
    not rigth, we want to store the LoA of the SF used to authenticate the
    rquired LoA. That LoA might be higher. An might assist the end user in
    not having to give another 2FA when another SP requires a higher LoA.
    
    See: https://www.pivotaltracker.com/story/show/184060757
    See: https://www.pivotaltracker.com/story/show/183402542
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    3e0bade View commit details
    Browse the repository at this point in the history
  28. Repair PHPUnit tests

    Add the now included Utf8 encoding to the expected xml messages defined
    in the tests
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    4304723 View commit details
    Browse the repository at this point in the history
  29. Integrate updated Behat tests

    The Adfs feature saw the ligth of some behat test improvements. Rebasing
    those changes into the SSO on 2FA branch caused some issues.
    
    This commit merges those changes
    MKodde committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    06e7e2c View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    d84a52c View commit details
    Browse the repository at this point in the history