Skip to content

Add stricter VTR validation#91

Merged
jmhooper merged 2 commits intomainfrom
jmhooper-stricter-vtr-validation
Feb 28, 2024
Merged

Add stricter VTR validation#91
jmhooper merged 2 commits intomainfrom
jmhooper-stricter-vtr-validation

Conversation

@jmhooper
Copy link

A previous commit added a regex that looked like this to detect a VTR:

[A-Z][a-z0-9](\.[A-Z][a-z0-9])*

That turned out to be a regex that also matches on this valid authn context:

urn:gov:gsa:ac:classes:sp:PasswordProtectedTransport:duo

This commit modifies the regex so it must match on the entire string to be valid to fix this issue.


context 'context that contains a VTR substring but is not a VTR' do
let(:authn_context_classref) do
fake_vtr = 'Not a VTR but does contain LetT3.Rs and Nu.Mb.Ers'

Choose a reason for hiding this comment

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

this is a beautiful fake vtr

Copy link

@Sgtpluck Sgtpluck left a comment

Choose a reason for hiding this comment

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

oh good catch! have a small question about whether explicitly testing urn:gov:gsa:ac:classes:sp:PasswordProtectedTransport:duo is worthwhile

A previous commit added a regex that looked like this to detect a VTR:

```
[A-Z][a-z0-9](\.[A-Z][a-z0-9])*
```

That turned out to be a regex that _also_ matches on this valid authn context:

```
urn:gov:gsa:ac:classes:sp:PasswordProtectedTransport:duo
```

This commit modifies the regex so it must match on the entire string to be valid to fix this issue.
@jmhooper jmhooper force-pushed the jmhooper-stricter-vtr-validation branch from 43d675b to f7dd59d Compare February 28, 2024 18:26
@jmhooper jmhooper merged commit f7dd59d into main Feb 28, 2024
@jmhooper jmhooper deleted the jmhooper-stricter-vtr-validation branch February 28, 2024 18:31
jmhooper added a commit to 18F/identity-idp that referenced this pull request Mar 4, 2024
This commit enables SAML service providers to make requests using vectors of trust. Vectors of trust support has been built into OIDC in previous commits and much of the work to support this feature was done there.

This commit usee the changes in 18F/saml_idp#91 to capture the VTR and store it in the service provider request (and eventually `sp_session`). This is done in the `FederateProtocols::Saml` model similar to the approach for OIDC.

This commit modifies `SamlRequestValidator` to validate VTRs alongside validations that exist today for `AuthnContextClassref`s. The `Vot::Parser` is used here to validate the format of VoTs. The `SamlRequestValidator` validates that an SP is allowed to make requests with identity proofing if it is requested. Finally the `SamlRequestValidator` will also fail if the vector or trust feature is not available in the environment

The logic for biometric comparison was added to `SamlIdpController` to support the `Pb` component-value that can be used there now. Users are prompted to go through proofing with a selfie if it is required. This includes users who have proofed without a selfie.. If the biometric comparison feature is not enabled for the environment and it is requested with the `Pb` component value `SamlIdpController` will render a 406 similar to the `OpenidConnect::AuthorizationController`.

changelog: Internal, SAML, VTR support was added to SAML
jmhooper added a commit to 18F/identity-idp that referenced this pull request Mar 5, 2024
This commit enables SAML service providers to make requests using vectors of trust. Vectors of trust support has been built into OIDC in previous commits and much of the work to support this feature was done there.

This commit use the changes in 18F/saml_idp#91 to capture the VTR and store it in the service provider request (and eventually `sp_session`). This is done in the `FederateProtocols::Saml` model similar to the approach for OIDC.

This commit modifies `SamlRequestValidator` to validate VTRs alongside validations that exist today for `AuthnContextClassref`s. The `Vot::Parser` is used here to validate the format of VoTs. The `SamlRequestValidator` validates that an SP is allowed to make requests with identity proofing if it is requested. Finally the `SamlRequestValidator` will also fail if the vector or trust feature is not available in the environment

The logic for biometric comparison was added to `SamlIdpController` to support the `Pb` component-value that can be used there now. Users are prompted to go through proofing with a selfie if it is required. This includes users who have proofed without a selfie.. If the biometric comparison feature is not enabled for the environment and it is requested with the `Pb` component value `SamlIdpController` will render a 406 similar to the `OpenidConnect::AuthorizationController`.

changelog: Internal, SAML, VTR support was added to SAML
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.

2 participants