Skip to content

Add logging when old SAML requests are used#1986

Open
johanib wants to merge 1 commit intomainfrom
feature/1792-add-expired-logging
Open

Add logging when old SAML requests are used#1986
johanib wants to merge 1 commit intomainfrom
feature/1792-add-expired-logging

Conversation

@johanib
Copy link
Copy Markdown
Contributor

@johanib johanib commented Apr 22, 2026

Prior to this change, EB would not make note of the fact that old SAML requests are used. Engine does make a log notice about possible clock drift, but does so if if the time is off by 30 seconds.

This change adds a warning if a request is received that is X seconds old. With the default being 1 day.

Functionally, EB does proces these requests as usual, but SPs might reject the requests.

Resolves #1792

@johanib johanib linked an issue Apr 22, 2026 that may be closed by this pull request
@johanib johanib requested a review from kayjoosten April 22, 2026 14:23
public function test_checkIssueInstant_does_not_warn_when_request_is_within_max_age(): void
{
$maxAge = 86400;
$issueInstant = time() - $maxAge + 1;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 second seems flaky to me. What if computing for some reason takes longer the test will fail without i clear message. Maybe you can increase this to 60. What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree that 1 second can trigger false failures. 60 seconds is a bit much, the whole corto test suite takes 500ms seconds to complete. Adjusted to 5 seconds.

Comment thread CHANGELOG.md Outdated
* The `0000-00-00 00:00:00` is added for clarity/consistency, as this is probably the default behaviour of your database already.
* Removed unused index `consent.deleted_at`. Delete this from your production database if it's there.
* Added a specific error page for unsolicited SAML responses (IdP-initiated SSO without a prior AuthnRequest).
* Added `max_issue_instant_age` to parameters.yaml to configure the logging mechanism. EB will write log entries if it receives requests that are older than this value.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very nitpick: the parameter reference isn't correct. It should be yml instead of yaml. As i said very nitpicky you dont have to change this.

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

adjusted 👍

Comment thread config/reference.php
* debug?: DebugConfig,
* web_profiler?: WebProfilerConfig,
* },
* "when@prod"?: array{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just wondering why is this needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

its not needed. Just reference.php being annoying: symfony/symfony#62588 (comment)

Prior to this change, EB would not make note of the fact that old SAML requests are used. Engine does make a log notice about possible clock drift, but does so if if the time is off by 30 seconds.

This change adds a warning if a request is received that is X seconds old. With the default being 1 day.

Functionally, EB does proces these requests as usual, but SPs might reject the requests.

Resolves #1792
@johanib johanib force-pushed the feature/1792-add-expired-logging branch from b917f95 to 8d30b05 Compare April 28, 2026 06:59
@johanib johanib requested a review from kayjoosten April 28, 2026 06:59
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.

Check for and log old IssueInstants

2 participants