udap_security_test_kit 0.11.6 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/udap_security_test_kit/client_suite.rb +3 -0
- data/lib/udap_security_test_kit/registration_failure_invalid_contents_test.rb +1 -1
- data/lib/udap_security_test_kit/requirements/generated/udap-security-test-kit_requirements_coverage.csv +317 -0
- data/lib/udap_security_test_kit/requirements/generated/udap_security_client_requirements_coverage.csv +38 -38
- data/lib/udap_security_test_kit/requirements/generated/udap_security_requirements_coverage.csv +70 -70
- data/lib/udap_security_test_kit/version.rb +2 -2
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/b2b_authorization_extension_object_test.rb +77 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/client_authorization_code_usage_test.rb +47 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/client_security_csrf_protection_test.rb +50 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/cryptographic_algorithms_test.rb +44 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/data_holder_auth_request_scope_test.rb +42 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/idp_authentication_compliance_test.rb +44 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/idp_supports_required_scopes_test.rb +42 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/jti_reuse_prevention_test.rb +44 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/metadata_interpretation_test.rb +47 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/oauth2_protocol_compliance_test.rb +50 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/preferred_identity_provider_test.rb +45 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/private_key_authentication_test.rb +47 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/resource_holder_authentication_test.rb +45 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/software_statement_registration_test.rb +49 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/token_request_authentication_test.rb +51 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/trust_community_query_parameters_test.rb +43 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/validation_confidentiality_test.rb +49 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/client_attestation_group.rb +48 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authentication_requests_group/authentication_request_construction_test.rb +56 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authentication_requests_group/authentication_request_validation_test.rb +60 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authentication_requests_group.rb +13 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authorization_code_token_requests_group/access_token_lifetime_test.rb +42 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authorization_code_token_requests_group/access_token_request_validation_test.rb +51 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authorization_code_token_requests_group/authorization_code_usage_test.rb +45 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authorization_code_token_requests_group/resource_holder_authorization_flow_test.rb +37 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authorization_code_token_requests_group.rb +17 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/client_authentication_group/client_certificate_storage_test.rb +36 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/client_authentication_group/no_client_credentials_native_apps_test.rb +38 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/client_authentication_group.rb +13 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/dynamic_client_registration_group/certification_handling_test.rb +45 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/dynamic_client_registration_group/client_id_modification_test.rb +42 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/dynamic_client_registration_group/dynamic_client_registration_validation_test.rb +48 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/dynamic_client_registration_group.rb +15 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/deny_token_request_test.rb +42 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/general_error_response_test.rb +39 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/invalid_id_token_test.rb +43 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/invalid_idp_test.rb +39 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/invalid_redirection_uri_test.rb +43 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/prompt_none_test.rb +39 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/state_mismatch_test.rb +43 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/unauthenticated_user_test.rb +42 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/valid_state_error_response_test.rb +43 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group.rb +27 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/id_token_access_token_validation_group/access_token_validation_test.rb +47 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/id_token_access_token_validation_group/id_token_validation_test.rb +45 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/id_token_access_token_validation_group/token_response_validation_test.rb +47 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/id_token_access_token_validation_group.rb +15 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/identity_provider_interaction_group/idp_authentication_request_test.rb +45 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/identity_provider_interaction_group/idp_dynamic_registration_test.rb +45 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/identity_provider_interaction_group/idp_metadata_validation_test.rb +44 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/identity_provider_interaction_group/idp_token_exchange_test.rb +46 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/identity_provider_interaction_group.rb +17 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group/jwt_certificate_chain_validation_test.rb +36 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group/jwt_grant_parameter_validation_test.rb +36 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group/jwt_jti_reuse_test.rb +35 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group/jwt_signature_validation_test.rb +36 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group/jwt_token_request_validation_test.rb +43 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group.rb +19 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group/udap_authorization_extensions_required_test.rb +43 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group/udap_community_parameter_support_test.rb +44 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group/udap_metadata_endpoint_error_handling_test.rb +43 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group/udap_metadata_representation_test.rb +42 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group/udap_profiles_supported_test.rb +43 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group.rb +19 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/security_measures_group/csrf_protection_test.rb +49 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/security_measures_group/obtain_authorization_scopes_test.rb +44 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/security_measures_group/state_parameter_test.rb +48 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/security_measures_group/unauthenticated_client_security_test.rb +47 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/security_measures_group.rb +17 -0
- data/lib/udap_security_test_kit/visual_inspection_and_attestation/server_attestation_group.rb +33 -0
- data/lib/udap_security_test_kit.rb +2 -0
- metadata +81 -4
@@ -0,0 +1,42 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class DataHolderAuthRequestScopeAttestationTest < Inferno::Test
|
3
|
+
title 'Data Holder Authentication Request Contains `openid` and `udap` Scopes'
|
4
|
+
id :udap_security_data_holder_auth_request_scope
|
5
|
+
description %(
|
6
|
+
Data holder's authentication request to the Identity Provider includes both
|
7
|
+
`openid` and `udap` in the `scope` query parameter.
|
8
|
+
)
|
9
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@256'
|
10
|
+
|
11
|
+
input :auth_request_scope_contains_openid_udap,
|
12
|
+
title: 'Authentication request `scope` contains `openid` and `udap`',
|
13
|
+
description: %(
|
14
|
+
I attest that the data holder's authentication request to the Identity Provider includes both
|
15
|
+
`openid` and `udap` in the `scope` query parameter.
|
16
|
+
),
|
17
|
+
type: 'radio',
|
18
|
+
default: 'false',
|
19
|
+
options: {
|
20
|
+
list_options: [
|
21
|
+
{
|
22
|
+
label: 'Yes',
|
23
|
+
value: 'true'
|
24
|
+
},
|
25
|
+
{
|
26
|
+
label: 'No',
|
27
|
+
value: 'false'
|
28
|
+
}
|
29
|
+
]
|
30
|
+
}
|
31
|
+
input :auth_request_scope_contains_openid_udap_note,
|
32
|
+
title: 'Notes, if applicable:',
|
33
|
+
type: 'textarea',
|
34
|
+
optional: true
|
35
|
+
|
36
|
+
run do
|
37
|
+
assert auth_request_scope_contains_openid_udap == 'true',
|
38
|
+
'Authentication request did not include both `openid` and `udap` in the `scope` query parameter.'
|
39
|
+
pass auth_request_scope_contains_openid_udap_note if auth_request_scope_contains_openid_udap_note.present?
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class IdPAuthenticationComplianceAttestationTest < Inferno::Test
|
3
|
+
title 'Identity Provider Authenticates User per OIDC Core and UDAP Tiered OAuth'
|
4
|
+
id :udap_security_idp_authentication_compliance
|
5
|
+
description %(
|
6
|
+
The Identity Provider authenticates the user according to
|
7
|
+
[Sections 3.1.2.2 - 3.1.2.6 of OIDC Core](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequestValidation)
|
8
|
+
and Sections 4.1 - 4.2 of [UDAP Tiered OAuth](https://www.udap.org/udap-user-auth-stu1.html).
|
9
|
+
)
|
10
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@257'
|
11
|
+
|
12
|
+
input :idp_authenticates_per_spec,
|
13
|
+
title: 'IdP authenticates user per OIDC Core and UDAP Tiered OAuth',
|
14
|
+
description: %(
|
15
|
+
I attest that the Identity Provider authenticates the user according to
|
16
|
+
[Sections 3.1.2.2 - 3.1.2.6 of OIDC Core](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequestValidation)
|
17
|
+
and Sections 4.1 - 4.2 of [UDAP Tiered OAuth](https://www.udap.org/udap-user-auth-stu1.html).
|
18
|
+
),
|
19
|
+
type: 'radio',
|
20
|
+
default: 'false',
|
21
|
+
options: {
|
22
|
+
list_options: [
|
23
|
+
{
|
24
|
+
label: 'Yes',
|
25
|
+
value: 'true'
|
26
|
+
},
|
27
|
+
{
|
28
|
+
label: 'No',
|
29
|
+
value: 'false'
|
30
|
+
}
|
31
|
+
]
|
32
|
+
}
|
33
|
+
input :idp_authenticates_per_spec_note,
|
34
|
+
title: 'Notes, if applicable:',
|
35
|
+
type: 'textarea',
|
36
|
+
optional: true
|
37
|
+
|
38
|
+
run do
|
39
|
+
assert idp_authenticates_per_spec == 'true',
|
40
|
+
'Identity Provider did not authenticate the user as per OIDC Core and UDAP Tiered OAuth specifications.'
|
41
|
+
pass idp_authenticates_per_spec_note if idp_authenticates_per_spec_note.present?
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class IdPSupportsRequiredScopesAttestationTest < Inferno::Test
|
3
|
+
title 'Supports required scopes in IdPs'
|
4
|
+
id :udap_security_idp_supports_scopes
|
5
|
+
description %(
|
6
|
+
Identity Provider (IdP) includes `"openid"` and `"udap"` in the array of scopes returned
|
7
|
+
for the `scopes_supported` parameter.
|
8
|
+
)
|
9
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@235'
|
10
|
+
|
11
|
+
input :idp_supports_required_scopes,
|
12
|
+
title: 'Supports required scopes',
|
13
|
+
description: %(
|
14
|
+
I attest that the Identity Provider (IdP) includes `"openid"` and `"udap"` in the array of scopes returned
|
15
|
+
for the `scopes_supported` parameter.
|
16
|
+
),
|
17
|
+
type: 'radio',
|
18
|
+
default: 'false',
|
19
|
+
options: {
|
20
|
+
list_options: [
|
21
|
+
{
|
22
|
+
label: 'Yes',
|
23
|
+
value: 'true'
|
24
|
+
},
|
25
|
+
{
|
26
|
+
label: 'No',
|
27
|
+
value: 'false'
|
28
|
+
}
|
29
|
+
]
|
30
|
+
}
|
31
|
+
input :idp_supports_required_scopes_note,
|
32
|
+
title: 'Notes, if applicable:',
|
33
|
+
type: 'textarea',
|
34
|
+
optional: true
|
35
|
+
|
36
|
+
run do
|
37
|
+
assert idp_supports_required_scopes == 'true',
|
38
|
+
'Identity Provider (IdP) did not demonstrate support for required scopes.'
|
39
|
+
pass idp_supports_required_scopes_note if idp_supports_required_scopes_note.present?
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class JTIReusePreventionAttestationTest < Inferno::Test
|
3
|
+
title 'Prevents reuse of JTI values in authentication tokens'
|
4
|
+
id :udap_security_jti_reuse_prevention
|
5
|
+
description %(
|
6
|
+
Client application prevents reuse of JTI values in authentication tokens by:
|
7
|
+
- Ensuring the `jti` parameter is not reused in another authentication JWT before the time specified
|
8
|
+
in the `exp` claim has passed.
|
9
|
+
)
|
10
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@159'
|
11
|
+
|
12
|
+
input :jti_reuse_prevention_correctly,
|
13
|
+
title: 'Prevents reuse of JTI values in authentication tokens',
|
14
|
+
description: %(
|
15
|
+
I attest that the client application prevents reuse of JTI values in authentication tokens by:
|
16
|
+
- Ensuring the `jti` parameter is not reused in another authentication JWT before the time specified
|
17
|
+
in the `exp` claim has passed.
|
18
|
+
),
|
19
|
+
type: 'radio',
|
20
|
+
default: 'false',
|
21
|
+
options: {
|
22
|
+
list_options: [
|
23
|
+
{
|
24
|
+
label: 'Yes',
|
25
|
+
value: 'true'
|
26
|
+
},
|
27
|
+
{
|
28
|
+
label: 'No',
|
29
|
+
value: 'false'
|
30
|
+
}
|
31
|
+
]
|
32
|
+
}
|
33
|
+
input :jti_reuse_prevention_correctly_note,
|
34
|
+
title: 'Notes, if applicable:',
|
35
|
+
type: 'textarea',
|
36
|
+
optional: true
|
37
|
+
|
38
|
+
run do
|
39
|
+
assert jti_reuse_prevention_correctly == 'true',
|
40
|
+
'Client application did not demonstrate prevention of JTI reuse in authentication tokens.'
|
41
|
+
pass jti_reuse_prevention_correctly_note if jti_reuse_prevention_correctly_note.present?
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class MetadataInterpretationAttestationTest < Inferno::Test
|
3
|
+
title 'Interprets metadata correctly'
|
4
|
+
id :udap_security_metadata_interpretation
|
5
|
+
description %(
|
6
|
+
Client application interprets metadata correctly by:
|
7
|
+
- Interpreting an empty array value in metadata as indicating that the corresponding capability is
|
8
|
+
NOT supported by the server.
|
9
|
+
- Using applicable values returned in a server’s UDAP metadata for workflows defined in this guide.
|
10
|
+
)
|
11
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@20',
|
12
|
+
'hl7.fhir.us.udap-security_1.0.0@21'
|
13
|
+
|
14
|
+
input :interprets_metadata_correctly,
|
15
|
+
title: 'Interprets metadata correctly',
|
16
|
+
description: %(
|
17
|
+
I attest that the client application interprets metadata correctly by:
|
18
|
+
- Interpreting an empty array value in metadata as indicating that the corresponding capability is
|
19
|
+
NOT supported by the server.
|
20
|
+
- Using applicable values returned in a server’s UDAP metadata for workflows defined in this guide.
|
21
|
+
),
|
22
|
+
type: 'radio',
|
23
|
+
default: 'false',
|
24
|
+
options: {
|
25
|
+
list_options: [
|
26
|
+
{
|
27
|
+
label: 'Yes',
|
28
|
+
value: 'true'
|
29
|
+
},
|
30
|
+
{
|
31
|
+
label: 'No',
|
32
|
+
value: 'false'
|
33
|
+
}
|
34
|
+
]
|
35
|
+
}
|
36
|
+
input :interprets_metadata_correctly_note,
|
37
|
+
title: 'Notes, if applicable:',
|
38
|
+
type: 'textarea',
|
39
|
+
optional: true
|
40
|
+
|
41
|
+
run do
|
42
|
+
assert interprets_metadata_correctly == 'true',
|
43
|
+
'Client application did not demonstrate correct interpretation of metadata.'
|
44
|
+
pass interprets_metadata_correctly_note if interprets_metadata_correctly_note.present?
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class OAuth2ProtocolComplianceAttestationTest < Inferno::Test
|
3
|
+
title 'Complies with OAuth 2.0 Protocol Requirements'
|
4
|
+
id :udap_security_oauth2_protocol_compliance
|
5
|
+
description %(
|
6
|
+
Client application complies with OAuth 2.0 protocol requirements:
|
7
|
+
- Ignores unrecognized response parameters in the authorization response when receiveing an response to an
|
8
|
+
authorization request.
|
9
|
+
- Follows the token request and response protocol as defined in RFC 6749 Sections 4.1.3 and 4.1.4 when
|
10
|
+
authenticating with a shared secret.
|
11
|
+
)
|
12
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@139',
|
13
|
+
'hl7.fhir.us.udap-security_1.0.0@162'
|
14
|
+
|
15
|
+
input :oauth2_protocol_compliance,
|
16
|
+
title: 'Complies with OAuth 2.0 Protocol Requirements',
|
17
|
+
description: %(
|
18
|
+
I attest that the client application complies with OAuth 2.0 protocol requirements:
|
19
|
+
- Ignores unrecognized response parameters in the authorization response when receiveing an response to an
|
20
|
+
authorization request.
|
21
|
+
- Follows the token request and response protocol as defined in RFC 6749 Sections 4.1.3 and 4.1.4 when
|
22
|
+
authenticating with a shared secret.
|
23
|
+
),
|
24
|
+
type: 'radio',
|
25
|
+
default: 'false',
|
26
|
+
options: {
|
27
|
+
list_options: [
|
28
|
+
{
|
29
|
+
label: 'Yes',
|
30
|
+
value: 'true'
|
31
|
+
},
|
32
|
+
{
|
33
|
+
label: 'No',
|
34
|
+
value: 'false'
|
35
|
+
}
|
36
|
+
]
|
37
|
+
}
|
38
|
+
|
39
|
+
input :oauth2_protocol_compliance_note,
|
40
|
+
title: 'Notes, if applicable:',
|
41
|
+
type: 'textarea',
|
42
|
+
optional: true
|
43
|
+
|
44
|
+
run do
|
45
|
+
assert oauth2_protocol_compliance == 'true',
|
46
|
+
'Client application did not comply with OAuth 2.0 protocol requirements.'
|
47
|
+
pass oauth2_protocol_compliance_note if oauth2_protocol_compliance_note.present?
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class PreferredIdentityProviderAttestationTest < Inferno::Test
|
3
|
+
title 'Indicates preferred Identity Provider'
|
4
|
+
id :udap_security_preferred_idp
|
5
|
+
description %(
|
6
|
+
Client application indicates the preferred Identity Provider (IdP) to the data holder by:
|
7
|
+
- Adding `udap` to the list of scopes provided in the `scope` query parameter.
|
8
|
+
- Adding the extension query parameter `idp` with a value equal to the base URL of the preferred OIDC IdP.
|
9
|
+
)
|
10
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@236',
|
11
|
+
'hl7.fhir.us.udap-security_1.0.0@237'
|
12
|
+
|
13
|
+
input :indicates_preferred_idp,
|
14
|
+
title: 'Indicates preferred Identity Provider',
|
15
|
+
description: %(
|
16
|
+
I attest that the client application indicates the preferred Identity Provider (IdP) to the data holder by:
|
17
|
+
- Adding `udap` to the list of scopes provided in the `scope` query parameter.
|
18
|
+
- Adding the extension query parameter `idp` with a value equal to the base URL of the preferred OIDC IdP.
|
19
|
+
),
|
20
|
+
type: 'radio',
|
21
|
+
default: 'false',
|
22
|
+
options: {
|
23
|
+
list_options: [
|
24
|
+
{
|
25
|
+
label: 'Yes',
|
26
|
+
value: 'true'
|
27
|
+
},
|
28
|
+
{
|
29
|
+
label: 'No',
|
30
|
+
value: 'false'
|
31
|
+
}
|
32
|
+
]
|
33
|
+
}
|
34
|
+
input :indicates_preferred_idp_note,
|
35
|
+
title: 'Notes, if applicable:',
|
36
|
+
type: 'textarea',
|
37
|
+
optional: true
|
38
|
+
|
39
|
+
run do
|
40
|
+
assert indicates_preferred_idp == 'true',
|
41
|
+
'Client application did not demonstrate correct indication of the preferred Identity Provider.'
|
42
|
+
pass indicates_preferred_idp_note if indicates_preferred_idp_note.present?
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class PrivateKeyAuthenticationAttestationTest < Inferno::Test
|
3
|
+
title 'Uses private key authentication correctly'
|
4
|
+
id :udap_security_private_key_authentication
|
5
|
+
description %(
|
6
|
+
Client application uses private key authentication correctly as per
|
7
|
+
Section [5.2.1](https://hl7.org/fhir/us/udap-security/STU1/b2b.html#constructing-authentication-token) by:
|
8
|
+
- Omitting the HTTP Authorization header and client secret in token endpoint requests when authenticating
|
9
|
+
with a private key and Authentication Token.
|
10
|
+
)
|
11
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@164',
|
12
|
+
'hl7.fhir.us.udap-security_1.0.0@224'
|
13
|
+
|
14
|
+
input :private_key_authentication_correctly,
|
15
|
+
title: 'Uses private key authentication correctly',
|
16
|
+
description: %(
|
17
|
+
I attest that the client application uses private key authentication correctly as per
|
18
|
+
Section [5.2.1](https://hl7.org/fhir/us/udap-security/STU1/b2b.html#constructing-authentication-token) by:
|
19
|
+
- Omitting the HTTP Authorization header and client secret in token endpoint requests when authenticating
|
20
|
+
with a private key and Authentication Token.
|
21
|
+
),
|
22
|
+
type: 'radio',
|
23
|
+
default: 'false',
|
24
|
+
options: {
|
25
|
+
list_options: [
|
26
|
+
{
|
27
|
+
label: 'Yes',
|
28
|
+
value: 'true'
|
29
|
+
},
|
30
|
+
{
|
31
|
+
label: 'No',
|
32
|
+
value: 'false'
|
33
|
+
}
|
34
|
+
]
|
35
|
+
}
|
36
|
+
input :private_key_authentication_correctly_note,
|
37
|
+
title: 'Notes, if applicable:',
|
38
|
+
type: 'textarea',
|
39
|
+
optional: true
|
40
|
+
|
41
|
+
run do
|
42
|
+
assert private_key_authentication_correctly == 'true',
|
43
|
+
'Client application did not demonstrate correct private key authentication.'
|
44
|
+
pass private_key_authentication_correctly_note if private_key_authentication_correctly_note.present?
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class ResourceHolderTokenEndpointAuthenticationAttestationTest < Inferno::Test
|
3
|
+
title 'Authenticates to IdP Token Endpoint'
|
4
|
+
id :udap_security_resource_holder_token_endpoint_authentication
|
5
|
+
description %(
|
6
|
+
The Resource authenticates to the IdP’s token endpoint when requesting an ID token
|
7
|
+
and access token, as detailed in Section 5 of UDAP JWT-based Client Authentication.
|
8
|
+
)
|
9
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@281'
|
10
|
+
|
11
|
+
input :resource_holder_token_endpoint_authentication,
|
12
|
+
title: 'Authenticates to IdP Token Endpoint',
|
13
|
+
description: %(
|
14
|
+
I attest that the Resource Holder authenticates to the IdP’s token endpoint when requesting an ID token
|
15
|
+
and access token, as detailed in Section 5 of UDAP JWT-based Client Authentication.
|
16
|
+
),
|
17
|
+
type: 'radio',
|
18
|
+
default: 'false',
|
19
|
+
options: {
|
20
|
+
list_options: [
|
21
|
+
{
|
22
|
+
label: 'Yes',
|
23
|
+
value: 'true'
|
24
|
+
},
|
25
|
+
{
|
26
|
+
label: 'No',
|
27
|
+
value: 'false'
|
28
|
+
}
|
29
|
+
]
|
30
|
+
}
|
31
|
+
|
32
|
+
input :resource_holder_token_endpoint_authentication_note,
|
33
|
+
title: 'Notes, if applicable:',
|
34
|
+
type: 'textarea',
|
35
|
+
optional: true
|
36
|
+
|
37
|
+
run do
|
38
|
+
assert resource_holder_token_endpoint_authentication == 'true',
|
39
|
+
'Resource Holder did not authenticate to the IdP’s token endpoint as required.'
|
40
|
+
if resource_holder_token_endpoint_authentication_note.present?
|
41
|
+
pass resource_holder_token_endpoint_authentication_note
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class SoftwareStatementAndRegistrationAttestationTest < Inferno::Test
|
3
|
+
title 'Complies with Software Statement and Registration'
|
4
|
+
id :udap_security_software_statement_registration
|
5
|
+
description %(
|
6
|
+
Client application complies with the requirements for Software Statement and Registration:
|
7
|
+
- Ensures that the `jti` claim in the JWT is not reused in another software statement or authentication JWT
|
8
|
+
before the time specified in the `exp` claim has passed.
|
9
|
+
- Interprets a registration response containing an empty `grant_types` array as a confirmation that the
|
10
|
+
registration for the `client_id` listed in the response has been cancelled by the Authorization Server.
|
11
|
+
)
|
12
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@82',
|
13
|
+
'hl7.fhir.us.udap-security_1.0.0@123'
|
14
|
+
|
15
|
+
input :software_statement_registration_compliance,
|
16
|
+
title: 'Complies with the requirements for Software Statement and Registration',
|
17
|
+
description: %(
|
18
|
+
I attest that the client application complies with the requirements for Software Statement and Registration:
|
19
|
+
- Ensures that the `jti` claim in the JWT is not reused in another software statement or authentication JWT
|
20
|
+
before the time specified in the `exp` claim has passed.
|
21
|
+
- Interprets a registration response containing an empty `grant_types` array as a confirmation that the
|
22
|
+
registration for the `client_id` listed in the response has been cancelled by the Authorization Server.
|
23
|
+
),
|
24
|
+
type: 'radio',
|
25
|
+
default: 'false',
|
26
|
+
options: {
|
27
|
+
list_options: [
|
28
|
+
{
|
29
|
+
label: 'Yes',
|
30
|
+
value: 'true'
|
31
|
+
},
|
32
|
+
{
|
33
|
+
label: 'No',
|
34
|
+
value: 'false'
|
35
|
+
}
|
36
|
+
]
|
37
|
+
}
|
38
|
+
input :software_statement_registration_compliance_note,
|
39
|
+
title: 'Notes, if applicable:',
|
40
|
+
type: 'textarea',
|
41
|
+
optional: true
|
42
|
+
|
43
|
+
run do
|
44
|
+
assert software_statement_registration_compliance == 'true',
|
45
|
+
'Client application did not comply with the requirements for Software Statement and Registration.'
|
46
|
+
pass software_statement_registration_compliance_note if software_statement_registration_compliance_note.present?
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class TokenRequestAuthenticationAttestationTest < Inferno::Test
|
3
|
+
title 'Authenticates correctly when making token requests'
|
4
|
+
id :udap_security_token_request_authentication
|
5
|
+
description %(
|
6
|
+
Client application authenticates correctly when making token requests as described in
|
7
|
+
[Section 3.2.1](https://datatracker.ietf.org/doc/html/rfc6749#section-3.2.1) by:
|
8
|
+
- Including the `client_id` parameter in the token request if the client is not authenticating with the
|
9
|
+
authorization server.
|
10
|
+
- Authenticating to the Token Endpoint using the method registered for its `client_id` if the client
|
11
|
+
is a Confidential Client.
|
12
|
+
)
|
13
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@144',
|
14
|
+
'hl7.fhir.us.udap-security_1.0.0@280'
|
15
|
+
|
16
|
+
input :token_request_authentication_correctly,
|
17
|
+
title: 'Authenticates correctly when making token requests',
|
18
|
+
description: %(
|
19
|
+
I attest that the client application authenticates correctly when making token requests as
|
20
|
+
described in in [Section 3.2.1](https://datatracker.ietf.org/doc/html/rfc6749#section-3.2.1) by:
|
21
|
+
- Including the `client_id` parameter in the token request if the client is not authenticating
|
22
|
+
with the authorization server.
|
23
|
+
- Authenticating to the Token Endpoint using the method registered for its `client_id` if the client
|
24
|
+
is a Confidential Client.
|
25
|
+
),
|
26
|
+
type: 'radio',
|
27
|
+
default: 'false',
|
28
|
+
options: {
|
29
|
+
list_options: [
|
30
|
+
{
|
31
|
+
label: 'Yes',
|
32
|
+
value: 'true'
|
33
|
+
},
|
34
|
+
{
|
35
|
+
label: 'No',
|
36
|
+
value: 'false'
|
37
|
+
}
|
38
|
+
]
|
39
|
+
}
|
40
|
+
input :token_request_authentication_correctly_note,
|
41
|
+
title: 'Notes, if applicable:',
|
42
|
+
type: 'textarea',
|
43
|
+
optional: true
|
44
|
+
|
45
|
+
run do
|
46
|
+
assert token_request_authentication_correctly == 'true',
|
47
|
+
'Client application did not demonstrate correct authentication during token requests.'
|
48
|
+
pass token_request_authentication_correctly_note if token_request_authentication_correctly_note.present?
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class TrustCommunityAndQueryParametersAttestationTest < Inferno::Test
|
3
|
+
title 'Complies with Trust Community and Query Parameter'
|
4
|
+
id :udap_security_trust_community_query_parameters
|
5
|
+
description %(
|
6
|
+
Client application ensures the value of the `community` query parameter is a valid URI as
|
7
|
+
determined by the trust community.
|
8
|
+
)
|
9
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@61'
|
10
|
+
|
11
|
+
input :community_query_parameter_compliance,
|
12
|
+
title: 'Complies with Trust Community and Query Parameter',
|
13
|
+
description: %(
|
14
|
+
I attest that the client application ensures the value of the `community` query parameter is a valid URI
|
15
|
+
as determined by the trust community.
|
16
|
+
),
|
17
|
+
type: 'radio',
|
18
|
+
default: 'false',
|
19
|
+
options: {
|
20
|
+
list_options: [
|
21
|
+
{
|
22
|
+
label: 'Yes',
|
23
|
+
value: 'true'
|
24
|
+
},
|
25
|
+
{
|
26
|
+
label: 'No',
|
27
|
+
value: 'false'
|
28
|
+
}
|
29
|
+
]
|
30
|
+
}
|
31
|
+
input :community_query_parameter_compliance_note,
|
32
|
+
title: 'Notes, if applicable:',
|
33
|
+
type: 'textarea',
|
34
|
+
optional: true
|
35
|
+
|
36
|
+
run do
|
37
|
+
assert community_query_parameter_compliance == 'true',
|
38
|
+
'Client application did not ensure the `community` query parameter value is a valid URI
|
39
|
+
as determined by the trust community.'
|
40
|
+
pass community_query_parameter_compliance_note if community_query_parameter_compliance_note.present?
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class ValidationAndConfidentialityAttestationTest < Inferno::Test
|
3
|
+
title 'Complies with Validation and Confidentiality'
|
4
|
+
id :udap_security_validation_confidentiality
|
5
|
+
description %(
|
6
|
+
Client applications complies with the requirements for Validation and Confidentiality:
|
7
|
+
- Validates the `state` parameter returned by the Resource Holder in response to an authorization request to
|
8
|
+
ensure it matches the value sent in the original request.
|
9
|
+
- Ensures confidentiality of client passwords and other client credentials by securely storing and
|
10
|
+
transmitting them.
|
11
|
+
)
|
12
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@274',
|
13
|
+
'hl7.fhir.us.udap-security_1.0.0@286'
|
14
|
+
|
15
|
+
input :validation_confidentiality_compliance,
|
16
|
+
title: 'Complies with requirements for Validation and Confidentiality',
|
17
|
+
description: %(
|
18
|
+
I attest that the client applications complies with the requirements for Validation and Confidentiality:
|
19
|
+
- Validates the `state` parameter returned by the Resource Holder in response to an authorization request to
|
20
|
+
ensure it matches the value sent in the original request.
|
21
|
+
- Ensures confidentiality of client passwords and other client credentials by securely storing and
|
22
|
+
transmitting them.
|
23
|
+
),
|
24
|
+
type: 'radio',
|
25
|
+
default: 'false',
|
26
|
+
options: {
|
27
|
+
list_options: [
|
28
|
+
{
|
29
|
+
label: 'Yes',
|
30
|
+
value: 'true'
|
31
|
+
},
|
32
|
+
{
|
33
|
+
label: 'No',
|
34
|
+
value: 'false'
|
35
|
+
}
|
36
|
+
]
|
37
|
+
}
|
38
|
+
input :validation_confidentiality_compliance_note,
|
39
|
+
title: 'Notes, if applicable:',
|
40
|
+
type: 'textarea',
|
41
|
+
optional: true
|
42
|
+
|
43
|
+
run do
|
44
|
+
assert validation_confidentiality_compliance == 'true',
|
45
|
+
'Client application did not validate the `state` parameter returned by the Resource Holder.'
|
46
|
+
pass validation_confidentiality_compliance_note if validation_confidentiality_compliance_note.present?
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require_relative 'client/client_authorization_code_usage_test'
|
2
|
+
require_relative 'client/b2b_authorization_extension_object_test'
|
3
|
+
require_relative 'client/client_security_csrf_protection_test'
|
4
|
+
require_relative 'client/cryptographic_algorithms_test'
|
5
|
+
require_relative 'client/data_holder_auth_request_scope_test'
|
6
|
+
require_relative 'client/idp_authentication_compliance_test'
|
7
|
+
require_relative 'client/idp_supports_required_scopes_test'
|
8
|
+
require_relative 'client/jti_reuse_prevention_test'
|
9
|
+
require_relative 'client/metadata_interpretation_test'
|
10
|
+
require_relative 'client/oauth2_protocol_compliance_test'
|
11
|
+
require_relative 'client/preferred_identity_provider_test'
|
12
|
+
require_relative 'client/private_key_authentication_test'
|
13
|
+
require_relative 'client/resource_holder_authentication_test'
|
14
|
+
require_relative 'client/software_statement_registration_test'
|
15
|
+
require_relative 'client/token_request_authentication_test'
|
16
|
+
require_relative 'client/trust_community_query_parameters_test'
|
17
|
+
require_relative 'client/validation_confidentiality_test'
|
18
|
+
|
19
|
+
module UDAPSecurityTestKit
|
20
|
+
class ClientAttestationGroup < Inferno::TestGroup
|
21
|
+
id :udap_client_v100_visual_inspection_and_attestation
|
22
|
+
title 'Visual Inspection and Attestation'
|
23
|
+
optional
|
24
|
+
|
25
|
+
description <<~DESCRIPTION
|
26
|
+
Perform visual inspections or attestations to ensure that the Client is conformant to the UDAP IG requirements.
|
27
|
+
DESCRIPTION
|
28
|
+
|
29
|
+
run_as_group
|
30
|
+
test from: :udap_security_client_auth_code_usage
|
31
|
+
test from: :udap_security_crypto_algorithms_and_protocols
|
32
|
+
test from: :udap_security_idp_supports_scopes
|
33
|
+
test from: :udap_security_jti_reuse_prevention
|
34
|
+
test from: :udap_security_metadata_interpretation
|
35
|
+
test from: :udap_security_preferred_idp
|
36
|
+
test from: :udap_security_private_key_authentication
|
37
|
+
test from: :udap_security_token_request_authentication
|
38
|
+
test from: :udap_security_oauth2_protocol_compliance
|
39
|
+
test from: :udap_security_resource_holder_token_endpoint_authentication
|
40
|
+
test from: :udap_security_software_statement_registration
|
41
|
+
test from: :udap_security_b2b_authorization_extension_object
|
42
|
+
test from: :udap_security_client_security_csrf_protection
|
43
|
+
test from: :udap_security_data_holder_auth_request_scope
|
44
|
+
test from: :udap_security_idp_authentication_compliance
|
45
|
+
test from: :udap_security_validation_confidentiality
|
46
|
+
test from: :udap_security_trust_community_query_parameters
|
47
|
+
end
|
48
|
+
end
|