udap_security_test_kit 0.11.5 → 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/authorization_code_received_test.rb +8 -0
- data/lib/udap_security_test_kit/authorization_code_redirect_test.rb +3 -0
- data/lib/udap_security_test_kit/authorization_code_token_exchange_test.rb +2 -0
- data/lib/udap_security_test_kit/authorization_endpoint_field_test.rb +5 -1
- data/lib/udap_security_test_kit/client_suite/access_ac_group.rb +2 -0
- data/lib/udap_security_test_kit/client_suite/authorization_request_verification_test.rb +5 -0
- data/lib/udap_security_test_kit/client_suite/registration_ac_verification_test.rb +34 -0
- data/lib/udap_security_test_kit/client_suite/registration_cc_verification_test.rb +30 -0
- data/lib/udap_security_test_kit/client_suite/token_request_ac_verification_test.rb +47 -0
- data/lib/udap_security_test_kit/client_suite/token_request_cc_verification_test.rb +25 -0
- data/lib/udap_security_test_kit/client_suite.rb +11 -0
- data/lib/udap_security_test_kit/discovery_group.rb +2 -0
- data/lib/udap_security_test_kit/dynamic_client_registration_group.rb +3 -0
- data/lib/udap_security_test_kit/endpoints/mock_udap_server.rb +2 -2
- data/lib/udap_security_test_kit/grant_types_supported_field_test.rb +3 -0
- data/lib/udap_security_test_kit/reg_endpoint_jwt_signing_alg_values_supported_field_test.rb +6 -0
- data/lib/udap_security_test_kit/registration_endpoint_field_test.rb +3 -0
- data/lib/udap_security_test_kit/registration_failure_invalid_contents_test.rb +4 -1
- data/lib/udap_security_test_kit/registration_failure_invalid_jwt_signature_test.rb +2 -0
- data/lib/udap_security_test_kit/registration_success_contents_test.rb +3 -0
- data/lib/udap_security_test_kit/registration_success_test.rb +3 -0
- 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 +146 -0
- data/lib/udap_security_test_kit/requirements/generated/udap_security_requirements_coverage.csv +164 -0
- data/lib/udap_security_test_kit/requirements/hl7.fhir.us.udap-security_1.0.0_reqs.xlsx +0 -0
- data/lib/udap_security_test_kit/requirements/udap_security_test_kit_requirements.csv +308 -0
- data/lib/udap_security_test_kit/signed_metadata_contents_test.rb +17 -0
- data/lib/udap_security_test_kit/signed_metadata_field_test.rb +4 -1
- data/lib/udap_security_test_kit/token_endpoint_auth_methods_supported_field_test.rb +2 -0
- data/lib/udap_security_test_kit/token_endpoint_auth_signing_alg_values_supported_field_test.rb +5 -0
- data/lib/udap_security_test_kit/token_endpoint_field_test.rb +3 -0
- data/lib/udap_security_test_kit/udap_auth_extensions_required_field_test.rb +3 -0
- data/lib/udap_security_test_kit/udap_auth_extensions_supported_field_test.rb +3 -0
- data/lib/udap_security_test_kit/udap_certifications_required_field_test.rb +3 -0
- data/lib/udap_security_test_kit/udap_certifications_supported_field_test.rb +2 -0
- data/lib/udap_security_test_kit/udap_profiles_supported_field_test.rb +5 -0
- data/lib/udap_security_test_kit/udap_versions_supported_field_test.rb +2 -0
- 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/well_known_endpoint_test.rb +4 -0
- data/lib/udap_security_test_kit.rb +10 -0
- metadata +85 -4
@@ -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
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class AuthenticationRequestConstructionAttestationTest < Inferno::Test
|
3
|
+
title 'Complies with OpenID Connect requirements in construction'
|
4
|
+
id :oidc_auth_request_construction
|
5
|
+
description %(
|
6
|
+
Authorization Server complies ith OpenID Connect requirements and ensures:
|
7
|
+
- HTTP GET and POST methods are supported at the Authorization Endpoint.
|
8
|
+
- The `openid` scope value is included in requests.
|
9
|
+
- A `scope` parameter is present and contains the `openid` scope value on an authentication request
|
10
|
+
- Required parameters (`response_type`, `client_id`, `redirect_uri`) are present and valid.
|
11
|
+
- The `redirect_uri` exactly matches pre-registered values.
|
12
|
+
)
|
13
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@246',
|
14
|
+
'hl7.fhir.us.udap-security_1.0.0@247',
|
15
|
+
'hl7.fhir.us.udap-security_1.0.0@248',
|
16
|
+
'hl7.fhir.us.udap-security_1.0.0@249',
|
17
|
+
'hl7.fhir.us.udap-security_1.0.0@250',
|
18
|
+
'hl7.fhir.us.udap-security_1.0.0@251',
|
19
|
+
'hl7.fhir.us.udap-security_1.0.0@259'
|
20
|
+
|
21
|
+
input :auth_request_construction_correct,
|
22
|
+
title: 'Authentication Requests: Complies with OpenID Connect requirements',
|
23
|
+
description: %(
|
24
|
+
I attest that the Authorization Server complies with OpenID Connect requirements and ensures:
|
25
|
+
- HTTP GET and POST methods are supported at the Authorization Endpoint.
|
26
|
+
- The `openid` scope value is included in requests.
|
27
|
+
- A `scope` parameter is present and contains the `openid` scope value on an authentication request
|
28
|
+
- Required parameters (`response_type`, `client_id`, `redirect_uri`) are present and valid.
|
29
|
+
- The `redirect_uri` exactly matches pre-registered values.
|
30
|
+
),
|
31
|
+
type: 'radio',
|
32
|
+
default: 'false',
|
33
|
+
options: {
|
34
|
+
list_options: [
|
35
|
+
{
|
36
|
+
label: 'Yes',
|
37
|
+
value: 'true'
|
38
|
+
},
|
39
|
+
{
|
40
|
+
label: 'No',
|
41
|
+
value: 'false'
|
42
|
+
}
|
43
|
+
]
|
44
|
+
}
|
45
|
+
input :auth_request_construction_note,
|
46
|
+
title: 'Notes, if applicable:',
|
47
|
+
type: 'textarea',
|
48
|
+
optional: true
|
49
|
+
|
50
|
+
run do
|
51
|
+
assert auth_request_construction_correct == 'true',
|
52
|
+
'Authentication Request Construction does not comply with OpenID Connect requirements.'
|
53
|
+
pass auth_request_construction_note if auth_request_construction_note.present?
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class AuthenticationRequestValidationAttestationTest < Inferno::Test
|
3
|
+
title 'Complies with OpenID Connect requirements in validation'
|
4
|
+
id :oidc_auth_request_validation
|
5
|
+
description %(
|
6
|
+
Authorization Server complies with OpenID Connect requirements and ensures:
|
7
|
+
- Validation of all OAuth 2.0 parameters.
|
8
|
+
- Verification that the `scope` parameter contains the `openid` value.
|
9
|
+
- Required parameters are present and conform to the specification.
|
10
|
+
- Proper handling of the `sub` Claim, `id_token_hint`, and `prompt` parameter.
|
11
|
+
- Implementation of CSRF and Clickjacking protections.
|
12
|
+
)
|
13
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@258',
|
14
|
+
'hl7.fhir.us.udap-security_1.0.0@259',
|
15
|
+
'hl7.fhir.us.udap-security_1.0.0@260',
|
16
|
+
'hl7.fhir.us.udap-security_1.0.0@261',
|
17
|
+
'hl7.fhir.us.udap-security_1.0.0@262',
|
18
|
+
'hl7.fhir.us.udap-security_1.0.0@263',
|
19
|
+
'hl7.fhir.us.udap-security_1.0.0@264',
|
20
|
+
'hl7.fhir.us.udap-security_1.0.0@265',
|
21
|
+
'hl7.fhir.us.udap-security_1.0.0@266',
|
22
|
+
'hl7.fhir.us.udap-security_1.0.0@267',
|
23
|
+
'hl7.fhir.us.udap-security_1.0.0@269'
|
24
|
+
|
25
|
+
input :auth_request_validation_correct,
|
26
|
+
title: 'Authentication Requests: Complies with OpenID Connect requirements in validation',
|
27
|
+
description: %(
|
28
|
+
I attest that the Authorization Server complies with OpenID Connect requirements and ensures:
|
29
|
+
- Validation of all OAuth 2.0 parameters.
|
30
|
+
- Verification that the `scope` parameter contains the `openid` value.
|
31
|
+
- Required parameters are present and conform to the specification.
|
32
|
+
- Proper handling of the `sub` Claim, `id_token_hint`, and `prompt` parameter.
|
33
|
+
- Implementation of CSRF and Clickjacking protections.
|
34
|
+
),
|
35
|
+
type: 'radio',
|
36
|
+
default: 'false',
|
37
|
+
options: {
|
38
|
+
list_options: [
|
39
|
+
{
|
40
|
+
label: 'Yes',
|
41
|
+
value: 'true'
|
42
|
+
},
|
43
|
+
{
|
44
|
+
label: 'No',
|
45
|
+
value: 'false'
|
46
|
+
}
|
47
|
+
]
|
48
|
+
}
|
49
|
+
input :auth_request_validation_note,
|
50
|
+
title: 'Notes, if applicable:',
|
51
|
+
type: 'textarea',
|
52
|
+
optional: true
|
53
|
+
|
54
|
+
run do
|
55
|
+
assert auth_request_validation_correct == 'true',
|
56
|
+
'Authentication Request Validation does not comply with OpenID Connect requirements.'
|
57
|
+
pass auth_request_validation_note if auth_request_validation_note.present?
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require_relative 'authentication_requests_group/authentication_request_construction_test'
|
2
|
+
require_relative 'authentication_requests_group/authentication_request_validation_test'
|
3
|
+
|
4
|
+
module UDAPSecurityTestKit
|
5
|
+
class OpenIDConnectAuthenticationRequestsAttestationGroup < Inferno::TestGroup
|
6
|
+
id :udap_server_v100_authentication_requests_group
|
7
|
+
title 'Authentication Requests'
|
8
|
+
|
9
|
+
run_as_group
|
10
|
+
test from: :oidc_auth_request_construction
|
11
|
+
test from: :oidc_auth_request_validation
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class AccessTokenLifetimeAttestationTest < Inferno::Test
|
3
|
+
title 'Limits lifetime of access tokens to no longer than 60 minutes'
|
4
|
+
id :udap_security_access_token_lifetime
|
5
|
+
description %(
|
6
|
+
The Authorization Server issues access tokens with a lifetime no longer than 60 minutes for all successful
|
7
|
+
token requests.
|
8
|
+
)
|
9
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@184'
|
10
|
+
|
11
|
+
input :access_token_lifetime_correct,
|
12
|
+
title: 'Authorization Code and Token Requests: Limits lifetime of access tokens to no longer than 60 minutes',
|
13
|
+
description: %(
|
14
|
+
I attest that the Authorization Server issues access tokens with a lifetime no longer than 60 minutes for
|
15
|
+
all successful token requests.
|
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 :access_token_lifetime_note,
|
32
|
+
title: 'Notes, if applicable:',
|
33
|
+
type: 'textarea',
|
34
|
+
optional: true
|
35
|
+
|
36
|
+
run do
|
37
|
+
assert access_token_lifetime_correct == 'true',
|
38
|
+
'Authorization Server did not issue access tokens with a lifetime no longer than 60 minutes.'
|
39
|
+
pass access_token_lifetime_note if access_token_lifetime_note.present?
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class AccessTokenRequestValidationAttestationTest < Inferno::Test
|
3
|
+
title 'Validates access token requests correctly'
|
4
|
+
id :udap_security_access_token_request_validation
|
5
|
+
description %(
|
6
|
+
The Authorization Server validates access token requests by:
|
7
|
+
- Requiring client authentication for confidential clients or clients issued credentials.
|
8
|
+
- Authenticating the client if client authentication is included.
|
9
|
+
- Verifying that the authorization code is valid.
|
10
|
+
- Ensuring the `redirect_uri` parameter is present and matches the initial authorization request.
|
11
|
+
)
|
12
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@146',
|
13
|
+
'hl7.fhir.us.udap-security_1.0.0@147',
|
14
|
+
'hl7.fhir.us.udap-security_1.0.0@149',
|
15
|
+
'hl7.fhir.us.udap-security_1.0.0@150'
|
16
|
+
|
17
|
+
input :access_token_request_validation_correct,
|
18
|
+
title: 'Authorization Code and Token Requests: Validates access token requests correctly',
|
19
|
+
description: %(
|
20
|
+
I attest that the Authorization Server validates access token requests by:
|
21
|
+
- Requiring client authentication for confidential clients or clients issued credentials.
|
22
|
+
- Authenticating the client if client authentication is included.
|
23
|
+
- Verifying that the authorization code is valid.
|
24
|
+
- Ensuring the `redirect_uri` parameter is present and matches the initial authorization request.
|
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 :access_token_request_validation_note,
|
41
|
+
title: 'Notes, if applicable:',
|
42
|
+
type: 'textarea',
|
43
|
+
optional: true
|
44
|
+
|
45
|
+
run do
|
46
|
+
assert access_token_request_validation_correct == 'true',
|
47
|
+
'Authorization Server did not validate access token requests correctly.'
|
48
|
+
pass access_token_request_validation_note if access_token_request_validation_note.present?
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class AuthorizationCodeUsageAttestationTest < Inferno::Test
|
3
|
+
title 'Ensures authorization code is used correctly'
|
4
|
+
id :udap_security_auth_code_usage
|
5
|
+
description %(
|
6
|
+
The Authorization Server ensures that:
|
7
|
+
- Authorization codes are not used more than once.
|
8
|
+
- Authorization codes expire shortly after issuance to mitigate the risk of leaks.
|
9
|
+
)
|
10
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@135',
|
11
|
+
'hl7.fhir.us.udap-security_1.0.0@137'
|
12
|
+
|
13
|
+
input :authorization_code_usage_correct,
|
14
|
+
title: 'Authorization Code and Token Requests: Ensures Authorization Code is used correctly',
|
15
|
+
description: %(
|
16
|
+
I attest that the Authorization Server ensures:
|
17
|
+
- Authorization codes are not used more than once.
|
18
|
+
- Authorization codes expire shortly after issuance to mitigate the risk of leaks.
|
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 :authorization_code_usage_note,
|
35
|
+
title: 'Notes, if applicable:',
|
36
|
+
type: 'textarea',
|
37
|
+
optional: true
|
38
|
+
|
39
|
+
run do
|
40
|
+
assert authorization_code_usage_correct == 'true',
|
41
|
+
'Authorization Server did not ensure correct usage of authorization codes.'
|
42
|
+
pass authorization_code_usage_note if authorization_code_usage_note.present?
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class AuthorizationCodeFlowAttestationTest < Inferno::Test
|
3
|
+
title 'Resource Holder uses the authorization code flow'
|
4
|
+
id :udap_security_authorization_code_flow
|
5
|
+
description %(
|
6
|
+
The Resource Holder uses the authorization code flow when redirecting the user
|
7
|
+
to the IdP’s authorization endpoint.
|
8
|
+
)
|
9
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@253'
|
10
|
+
|
11
|
+
input :authorization_code_flow_correct,
|
12
|
+
title: 'Authorization Code and Token Requests: Resource Holder uses authorization code flow',
|
13
|
+
description: %(
|
14
|
+
I attest that the Resource Holder uses the authorization code flow when redirecting
|
15
|
+
the user to the IdP’s authorization endpoint.
|
16
|
+
),
|
17
|
+
type: 'radio',
|
18
|
+
default: 'false',
|
19
|
+
options: {
|
20
|
+
list_options: [
|
21
|
+
{ label: 'Yes', value: 'true' },
|
22
|
+
{ label: 'No', value: 'false' }
|
23
|
+
]
|
24
|
+
}
|
25
|
+
input :authorization_code_flow_note,
|
26
|
+
title: 'Notes, if applicable:',
|
27
|
+
type: 'textarea',
|
28
|
+
optional: true
|
29
|
+
|
30
|
+
run do
|
31
|
+
assert authorization_code_flow_correct == 'true',
|
32
|
+
'Resource Holder does not use the authorization code flow when redirecting the user to the
|
33
|
+
IdP’s authorization endpoint.'
|
34
|
+
pass authorization_code_flow_note if authorization_code_flow_note.present?
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require_relative 'authorization_code_token_requests_group/authorization_code_usage_test'
|
2
|
+
require_relative 'authorization_code_token_requests_group/access_token_request_validation_test'
|
3
|
+
require_relative 'authorization_code_token_requests_group/access_token_lifetime_test'
|
4
|
+
require_relative 'authorization_code_token_requests_group/resource_holder_authorization_flow_test'
|
5
|
+
|
6
|
+
module UDAPSecurityTestKit
|
7
|
+
class AuthorizationCodeTokenRequestsAttestationGroup < Inferno::TestGroup
|
8
|
+
id :udap_server_v100_authorization_code_token_requests_group
|
9
|
+
title 'Authorization Code and Token Requests'
|
10
|
+
|
11
|
+
run_as_group
|
12
|
+
test from: :udap_security_auth_code_usage
|
13
|
+
test from: :udap_security_access_token_request_validation
|
14
|
+
test from: :udap_security_access_token_lifetime
|
15
|
+
test from: :udap_security_authorization_code_flow
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class ClientCertificateStorageAttestationTest < Inferno::Test
|
3
|
+
title 'Authorization Server stores client certificate for authentication'
|
4
|
+
id :udap_security_client_certificate_storage
|
5
|
+
description %(
|
6
|
+
The Authorization Server stores the certificate provided by the Client for
|
7
|
+
use in validating subsequent client authentication attempts.
|
8
|
+
)
|
9
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@112'
|
10
|
+
|
11
|
+
input :client_certificate_storage_correct,
|
12
|
+
title: 'Client Authentication: Authorization Server stores client certificate',
|
13
|
+
description: %(
|
14
|
+
I attest that the Authorization Server stores the certificate provided by the Client for
|
15
|
+
use in validating subsequent client authentication attempts.
|
16
|
+
),
|
17
|
+
type: 'radio',
|
18
|
+
default: 'false',
|
19
|
+
options: {
|
20
|
+
list_options: [
|
21
|
+
{ label: 'Yes', value: 'true' },
|
22
|
+
{ label: 'No', value: 'false' }
|
23
|
+
]
|
24
|
+
}
|
25
|
+
input :client_certificate_storage_note,
|
26
|
+
title: 'Notes, if applicable:',
|
27
|
+
type: 'textarea',
|
28
|
+
optional: true
|
29
|
+
|
30
|
+
run do
|
31
|
+
assert client_certificate_storage_correct == 'true',
|
32
|
+
'Authorization Server does not store the client certificate for use in subsequent authentication attempts.'
|
33
|
+
pass client_certificate_storage_note if client_certificate_storage_note.present?
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|