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

Support overriding StepUp EntityId #1279

Merged
merged 5 commits into from
Mar 13, 2024
Merged

Support overriding StepUp EntityId #1279

merged 5 commits into from
Mar 13, 2024

Conversation

MKodde
Copy link
Member

@MKodde MKodde commented Nov 20, 2023

Currently the SAML EntityID of the engineblock SP that us used to do Stepup (SFO) authenticatons to the Stepup-Gateway is always https://<engineblock.sever.domain.name>/authentication/stepup/metadata

The key used to sign the SAML AuthnRequests from this SP is the engineblock default key.

To facilitate a rolling configuration update I want the SP entityID that is used for Stepup to be configurable so that at the same time that the engineblock default key is updated, this entityID can be changed. This then allows two entities, with two different keys, to be configured in the Stepup-Gateway.

https://www.pivotaltracker.com/story/show/186200738

@MKodde MKodde force-pushed the feature/rollover-stepup branch 2 times, most recently from 34a8d52 to d0d28cf Compare November 20, 2023 11:07
UPGRADING.md Outdated Show resolved Hide resolved
@MKodde MKodde force-pushed the feature/rollover-stepup branch 2 times, most recently from 89a0153 to 1895b15 Compare November 20, 2023 12:20
@MKodde MKodde force-pushed the feature/rollover-stepup branch 13 times, most recently from 5b0b4b7 to 442c00a Compare November 21, 2023 07:34
@MKodde MKodde force-pushed the feature/rollover-stepup branch 4 times, most recently from 326b859 to 6dba463 Compare November 21, 2023 10:16
@MKodde MKodde force-pushed the feature/rollover-stepup branch from 6dba463 to 57fe036 Compare November 21, 2023 13:30
@MKodde MKodde requested review from KarsanHAM and thijskh November 21, 2023 15:30
you must provide the "stepup.sfo.override_engine_entityid" parameter.'
);
}
$this->_logger->notice(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I prefer info or even debug. I would expect this config to last for an undetermined amount of time, does not make sense to issue notices on every stepup callout about it.

@@ -261,6 +262,7 @@ parameters:
stepup.gateway.sfo.sso_location: 'https://gateway.stepup.vm.openconext.org/second-factor-only/single-sign-on'
## The public key from the Stepup Gateway IdP
stepup.gateway.sfo.key_file: /etc/openconext/engineblock.crt
stepup.sfo.override_engine_entityid: 'https://engine.vm.openconext.com/new/stepup/metadata'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs/stepup_callout.md file refers to this section for explanation of the Engineblock config. So I think this new setting should have at least a # comment like the ones above.

@MKodde MKodde force-pushed the feature/rollover-stepup branch from 09567d3 to 94bd31e Compare March 12, 2024 08:48
* `eb.stepup.sfo.override_engine_entityid`. See UPGRADING.md (6.13 -> 6.14)
* for details.
*/
private function determineRemoteSpEntityId()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WIll always return string?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we can dash with return type definitions here? I could of course do a @var annotation.

@MKodde MKodde force-pushed the feature/rollover-stepup branch from 94bd31e to 3e19ce2 Compare March 12, 2024 09:31
Engineblock will verify the incoming assertion's Audience which will
be set to the entityID it used on the outgoing authnrequest, so this
place will also need to handle the override if present.
@MKodde MKodde force-pushed the feature/rollover-stepup branch from 3e19ce2 to 11578ad Compare March 12, 2024 09:31

$serviceEntityId = $this->_server->getUrl('stepupMetadataService');
if ($isEnabled && $isConfigured) {
return $entityIdOverrideValue;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the override causes this error down the line when EB is processing the assertion (stepupAssertionConsumerService)

Response processing failed: "Invalid Assertion in SAML Response, errors: "The configured Service Provider [https://engine.vm.openconext.com/new/stepup/metadata] is not a valid audience for the assertion. Audiences: [https://engine.vm.openconext.org/authentication/stepup/metadata]"

When rollover is enabled, let the mock gateway update the assertion
audience to the new entity id. That way, the engineblock is able to
receive the assertion from the new entity
@MKodde MKodde force-pushed the feature/rollover-stepup branch from 1382d17 to 457260c Compare March 13, 2024 07:46
@MKodde MKodde mentioned this pull request Mar 13, 2024
@MKodde MKodde merged commit 02f0238 into master Mar 13, 2024
2 checks passed
@MKodde MKodde deleted the feature/rollover-stepup branch March 13, 2024 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants