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,38 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class NoClientCredentialsForNativeAppsAttestationTest < Inferno::Test
|
3
|
+
title 'Does not issue client credentials to native/user-agent-based apps'
|
4
|
+
id :udap_security_no_client_credentials_native_apps
|
5
|
+
description %(
|
6
|
+
The Authorization Server does not issue client passwords or other client
|
7
|
+
credentials to native application or user-agent-based application clients for the
|
8
|
+
purpose of client authentication.
|
9
|
+
)
|
10
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@287'
|
11
|
+
|
12
|
+
input :no_client_credentials_native_apps_correct,
|
13
|
+
title: 'Client Authentication: Does not issue client credentials to native/user-agent-based apps',
|
14
|
+
description: %(
|
15
|
+
I attest that the Authorization Server does not issue client passwords or other client
|
16
|
+
credentials to native application or user-agent-based application clients for the
|
17
|
+
purpose of client authentication.
|
18
|
+
),
|
19
|
+
type: 'radio',
|
20
|
+
default: 'false',
|
21
|
+
options: {
|
22
|
+
list_options: [
|
23
|
+
{ label: 'Yes', value: 'true' },
|
24
|
+
{ label: 'No', value: 'false' }
|
25
|
+
]
|
26
|
+
}
|
27
|
+
input :no_client_credentials_native_apps_note,
|
28
|
+
title: 'Notes, if applicable:',
|
29
|
+
type: 'textarea',
|
30
|
+
optional: true
|
31
|
+
|
32
|
+
run do
|
33
|
+
assert no_client_credentials_native_apps_correct == 'true',
|
34
|
+
'Authorization Server issues client credentials to native or user-agent-based application clients.'
|
35
|
+
pass no_client_credentials_native_apps_note if no_client_credentials_native_apps_note.present?
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require_relative 'client_authentication_group/client_certificate_storage_test'
|
2
|
+
require_relative 'client_authentication_group/no_client_credentials_native_apps_test'
|
3
|
+
|
4
|
+
module UDAPSecurityTestKit
|
5
|
+
class ClientAuthenticationGroup < Inferno::TestGroup
|
6
|
+
id :udap_server_v100_client_authentication_group
|
7
|
+
title 'Client Authentication and Credential Management'
|
8
|
+
|
9
|
+
run_as_group
|
10
|
+
test from: :udap_security_client_certificate_storage
|
11
|
+
test from: :udap_security_no_client_credentials_native_apps
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class CertificationHandlingAttestationTest < Inferno::Test
|
3
|
+
title 'Handles certifications correctly'
|
4
|
+
id :udap_security_certification_handling
|
5
|
+
description %(
|
6
|
+
The Authorization Server handles certifications correctly:
|
7
|
+
- Ignores unsupported or unrecognized certifications.
|
8
|
+
- Communicates required certifications via the `udap_certifications_required` element in its UDAP metadata.
|
9
|
+
)
|
10
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@116',
|
11
|
+
'hl7.fhir.us.udap-security_1.0.0@118'
|
12
|
+
|
13
|
+
input :certification_handling_correct,
|
14
|
+
title: 'Dynamic Client Registration: Handles certifications correctly',
|
15
|
+
description: %(
|
16
|
+
I attest that the Authorization Server handles certifications correctly:
|
17
|
+
- Ignores unsupported or unrecognized certifications.
|
18
|
+
- Communicates required certifications via the `udap_certifications_required` element in its UDAP metadata.
|
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 :certification_handling_note,
|
35
|
+
title: 'Notes, if applicable:',
|
36
|
+
type: 'textarea',
|
37
|
+
optional: true
|
38
|
+
|
39
|
+
run do
|
40
|
+
assert certification_handling_correct == 'true',
|
41
|
+
'Authorization Server did not handle certifications correctly.'
|
42
|
+
pass certification_handling_note if certification_handling_note.present?
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class ClientIDModificationAttestationTest < Inferno::Test
|
3
|
+
title 'Handles client ID modification correctly'
|
4
|
+
id :udap_security_client_id_modification
|
5
|
+
description %(
|
6
|
+
Authorization Server cancels the registration for the previous `client_id` if it returns a different `client_id`
|
7
|
+
in response to a registration modification request.
|
8
|
+
)
|
9
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@121'
|
10
|
+
|
11
|
+
input :client_id_modification_correct,
|
12
|
+
title: 'Dynamic Client Registration: Handles client ID modification correctly',
|
13
|
+
description: %(
|
14
|
+
I attest that the Authorization Server cancels the registration for the previous `client_id` if it
|
15
|
+
returns a different `client_id` in response to a registration modification request.
|
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 :client_id_modification_note,
|
32
|
+
title: 'Notes, if applicable:',
|
33
|
+
type: 'textarea',
|
34
|
+
optional: true
|
35
|
+
|
36
|
+
run do
|
37
|
+
assert client_id_modification_correct == 'true',
|
38
|
+
'Authorization Server did not handle client ID modification correctly.'
|
39
|
+
pass client_id_modification_note if client_id_modification_note.present?
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class DynamicClientRegistrationValidationAttestationTest < Inferno::Test
|
3
|
+
title 'Validates requests correctly'
|
4
|
+
id :udap_security_dynamic_client_registration_validation
|
5
|
+
description %(
|
6
|
+
The Authorization Server validates dynamic client registration requests by:
|
7
|
+
- Ensuring the `sub` value matches the `iss` value.
|
8
|
+
- Ensuring the `aud` value contains the Authorization Server’s registration endpoint URL.
|
9
|
+
- Ensuring the software statement is unexpired.
|
10
|
+
)
|
11
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@107',
|
12
|
+
'hl7.fhir.us.udap-security_1.0.0@108',
|
13
|
+
'hl7.fhir.us.udap-security_1.0.0@109'
|
14
|
+
|
15
|
+
input :dynamic_client_registration_validation_correct,
|
16
|
+
title: 'Dynamic Client Registration: Validates requests correctly',
|
17
|
+
description: %(
|
18
|
+
I attest that the Authorization Server validates dynamic client registration requests by:
|
19
|
+
- Ensuring the `sub` value matches the `iss` value.
|
20
|
+
- Ensuring the `aud` value contains the Authorization Server’s registration endpoint URL.
|
21
|
+
- Ensuring the software statement is unexpired.
|
22
|
+
),
|
23
|
+
type: 'radio',
|
24
|
+
default: 'false',
|
25
|
+
options: {
|
26
|
+
list_options: [
|
27
|
+
{
|
28
|
+
label: 'Yes',
|
29
|
+
value: 'true'
|
30
|
+
},
|
31
|
+
{
|
32
|
+
label: 'No',
|
33
|
+
value: 'false'
|
34
|
+
}
|
35
|
+
]
|
36
|
+
}
|
37
|
+
input :dynamic_client_registration_validation_note,
|
38
|
+
title: 'Notes, if applicable:',
|
39
|
+
type: 'textarea',
|
40
|
+
optional: true
|
41
|
+
|
42
|
+
run do
|
43
|
+
assert dynamic_client_registration_validation_correct == 'true',
|
44
|
+
'Authorization Server did not validate dynamic client registration requests correctly.'
|
45
|
+
pass dynamic_client_registration_validation_note if dynamic_client_registration_validation_note.present?
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require_relative 'dynamic_client_registration_group/certification_handling_test'
|
2
|
+
require_relative 'dynamic_client_registration_group/client_id_modification_test'
|
3
|
+
require_relative 'dynamic_client_registration_group/dynamic_client_registration_validation_test'
|
4
|
+
|
5
|
+
module UDAPSecurityTestKit
|
6
|
+
class DynamicClientRegistrationAttestationGroup < Inferno::TestGroup
|
7
|
+
id :udap_server_v100_dynamic_client_registration_group
|
8
|
+
title 'Dynamic Client Registration'
|
9
|
+
|
10
|
+
run_as_group
|
11
|
+
test from: :udap_security_dynamic_client_registration_validation
|
12
|
+
test from: :udap_security_certification_handling
|
13
|
+
test from: :udap_security_client_id_modification
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class DenyTokenRequestAttestationTest < Inferno::Test
|
3
|
+
title 'Denies token request that cannot be validated from x5c parameter'
|
4
|
+
id :udap_security_deny_token_request
|
5
|
+
description %(
|
6
|
+
Authorization Server denies the token request if:
|
7
|
+
- JWT signature cannot be validated using the public key from the x5c parameter.
|
8
|
+
- A trusted certificate chain cannot be built and validated from the x5c parameter.
|
9
|
+
- Required parameter is missing or a parameter is invalid.
|
10
|
+
)
|
11
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@174',
|
12
|
+
'hl7.fhir.us.udap-security_1.0.0@176',
|
13
|
+
'hl7.fhir.us.udap-security_1.0.0@183'
|
14
|
+
|
15
|
+
input :deny_token_request,
|
16
|
+
title: 'Error Handling: Denies token request that cannot be validated from x5c parameter',
|
17
|
+
description: %(
|
18
|
+
I attest that the Authorization Server denies the token request if:
|
19
|
+
- JWT signature cannot be validated using the public key from the x5c parameter.
|
20
|
+
- A trusted certificate chain cannot be built and validated from the x5c parameter.
|
21
|
+
- Required parameter is missing or a parameter is invalid.
|
22
|
+
),
|
23
|
+
type: 'radio',
|
24
|
+
default: 'false',
|
25
|
+
options: {
|
26
|
+
list_options: [
|
27
|
+
{ label: 'Yes', value: 'true' },
|
28
|
+
{ label: 'No', value: 'false' }
|
29
|
+
]
|
30
|
+
}
|
31
|
+
input :deny_token_request_note,
|
32
|
+
title: 'Notes, if applicable:',
|
33
|
+
type: 'textarea',
|
34
|
+
optional: true
|
35
|
+
|
36
|
+
run do
|
37
|
+
assert deny_token_request == 'true',
|
38
|
+
'Authorization Server does not deny the token request when parameter(s) are invalid.'
|
39
|
+
pass deny_token_request_note if deny_token_request_note.present?
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class GeneralErrorResponseAttestationTest < Inferno::Test
|
3
|
+
title 'Returns error response on authentication request errors'
|
4
|
+
id :udap_security_general_error_response
|
5
|
+
description %(
|
6
|
+
Authorization Server returns an error response if it encounters any error while validating
|
7
|
+
an authentication request, as per
|
8
|
+
[Section 3.1.2.6](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequestValidation).
|
9
|
+
)
|
10
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@264'
|
11
|
+
|
12
|
+
input :general_error_response_handling_correct,
|
13
|
+
title: 'Error Handling: Returns error response on authentication request errors',
|
14
|
+
description: %(
|
15
|
+
I attest that the Authorization Server returns an error response if it encounters any
|
16
|
+
error while validating an authentication request, as per
|
17
|
+
[Section 3.1.2.6](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequestValidation).
|
18
|
+
),
|
19
|
+
type: 'radio',
|
20
|
+
default: 'false',
|
21
|
+
options: {
|
22
|
+
list_options: [
|
23
|
+
{ label: 'Yes', value: 'true' },
|
24
|
+
{ label: 'No', value: 'false' }
|
25
|
+
]
|
26
|
+
}
|
27
|
+
input :general_error_response_handling_note,
|
28
|
+
title: 'Notes, if applicable:',
|
29
|
+
type: 'textarea',
|
30
|
+
optional: true
|
31
|
+
|
32
|
+
run do
|
33
|
+
assert general_error_response_handling_correct == 'true',
|
34
|
+
'Authorization Server does not return an error response when it encounters an error
|
35
|
+
while validating an authentication request.'
|
36
|
+
pass general_error_response_handling_note if general_error_response_handling_note.present?
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class InvalidIDTokenErrorAttestationTest < Inferno::Test
|
3
|
+
title 'Handles invalid ID token error correctly'
|
4
|
+
id :udap_security_invalid_id_token_error
|
5
|
+
description %(
|
6
|
+
Data Holder either returns an `invalid_idp` error code or attempts alternate authentication when the IdP
|
7
|
+
does not return an ID Token or validation fails.
|
8
|
+
)
|
9
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@291'
|
10
|
+
|
11
|
+
input :invalid_id_token_error_handling_correct,
|
12
|
+
title: 'Error Handling: Handles invalid ID token error correctly',
|
13
|
+
description: %(
|
14
|
+
I attest that the Data Holder either returns an `invalid_idp` error code or attempts alternate
|
15
|
+
authentication when the IdP does not return an ID Token or validation fails.
|
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 :invalid_id_token_error_handling_note,
|
32
|
+
title: 'Notes, if applicable:',
|
33
|
+
type: 'textarea',
|
34
|
+
optional: true
|
35
|
+
|
36
|
+
run do
|
37
|
+
assert invalid_id_token_error_handling_correct == 'true',
|
38
|
+
'Data Holder does not return an `invalid_idp` error code or attempt alternate authentication
|
39
|
+
when the IdP does not return an ID Token or validation fails.'
|
40
|
+
pass invalid_id_token_error_handling_note if invalid_id_token_error_handling_note.present?
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class InvalidIdpErrorAttestationTest < Inferno::Test
|
3
|
+
title 'Handles invalid_idp error correctly'
|
4
|
+
id :udap_security_invalid_idp_error
|
5
|
+
description %(
|
6
|
+
Data Holder returns an error response with the `invalid_idp` extension error code
|
7
|
+
when the IdP is rejected, as per
|
8
|
+
[Section 4.1.2.1 of RFC 6749](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1).
|
9
|
+
)
|
10
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@241'
|
11
|
+
|
12
|
+
input :invalid_idp_error_handling_correct,
|
13
|
+
title: 'Error Handling: Handles invalid_idp error correctly',
|
14
|
+
description: %(
|
15
|
+
I attest that the Data Holder returns an error response with the `invalid_idp`
|
16
|
+
extension error code when the IdP is rejected, as per
|
17
|
+
[Section 4.1.2.1 of RFC 6749](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1).
|
18
|
+
),
|
19
|
+
type: 'radio',
|
20
|
+
default: 'false',
|
21
|
+
options: {
|
22
|
+
list_options: [
|
23
|
+
{ label: 'Yes', value: 'true' },
|
24
|
+
{ label: 'No', value: 'false' }
|
25
|
+
]
|
26
|
+
}
|
27
|
+
input :invalid_idp_error_handling_note,
|
28
|
+
title: 'Notes, if applicable:',
|
29
|
+
type: 'textarea',
|
30
|
+
optional: true
|
31
|
+
|
32
|
+
run do
|
33
|
+
assert invalid_idp_error_handling_correct == 'true',
|
34
|
+
'Data Holder does not return an error response with the `invalid_idp` extension error code when the
|
35
|
+
IdP is rejected.'
|
36
|
+
pass invalid_idp_error_handling_note if invalid_idp_error_handling_note.present?
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class InvalidRedirectionURIAttestationTest < Inferno::Test
|
3
|
+
title 'Handles invalid redirection URI correctly'
|
4
|
+
id :udap_security_invalid_redirection_uri
|
5
|
+
description %(
|
6
|
+
The Authorization Server does NOT redirect the user-agent to an invalid redirection URI when the request
|
7
|
+
fails due to a missing or invalid redirection URI.
|
8
|
+
)
|
9
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@242'
|
10
|
+
|
11
|
+
input :invalid_redirection_uri_handling_correct,
|
12
|
+
title: 'Error Handling: Handles Invalid redirection URI correctly',
|
13
|
+
description: %(
|
14
|
+
I attest that the Authorization Server does NOT redirect the user-agent to an invalid redirection
|
15
|
+
URI when the request fails due to a missing or invalid redirection URI.
|
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 :invalid_redirection_uri_handling_note,
|
32
|
+
title: 'Notes, if applicable:',
|
33
|
+
type: 'textarea',
|
34
|
+
optional: true
|
35
|
+
|
36
|
+
run do
|
37
|
+
assert invalid_redirection_uri_handling_correct == 'true',
|
38
|
+
'Authorization Server redirects the user-agent to an invalid redirection URI when the
|
39
|
+
request fails due to a missing or invalid URI.'
|
40
|
+
pass invalid_redirection_uri_handling_note if invalid_redirection_uri_handling_note.present?
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class PromptNoneErrorAttestationTest < Inferno::Test
|
3
|
+
title 'Returns error for prompt=none when user not authenticated'
|
4
|
+
id :udap_security_prompt_none_error
|
5
|
+
description %(
|
6
|
+
Authorization Server returns an error if the authentication request contains prompt=none
|
7
|
+
and the End-User is not already authenticated or could not be silently authenticated.
|
8
|
+
)
|
9
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@267',
|
10
|
+
'hl7.fhir.us.udap-security_1.0.0@268'
|
11
|
+
|
12
|
+
input :prompt_none_error_handling_correct,
|
13
|
+
title: 'Error Handling: Returns error for prompt=none when user not authenticated',
|
14
|
+
description: %(
|
15
|
+
I attest that the Authorization Server returns an error if the authentication
|
16
|
+
request contains prompt=none and the End-User is not already authenticated or
|
17
|
+
could not be silently authenticated.
|
18
|
+
),
|
19
|
+
type: 'radio',
|
20
|
+
default: 'false',
|
21
|
+
options: {
|
22
|
+
list_options: [
|
23
|
+
{ label: 'Yes', value: 'true' },
|
24
|
+
{ label: 'No', value: 'false' }
|
25
|
+
]
|
26
|
+
}
|
27
|
+
input :prompt_none_error_handling_note,
|
28
|
+
title: 'Notes, if applicable:',
|
29
|
+
type: 'textarea',
|
30
|
+
optional: true
|
31
|
+
|
32
|
+
run do
|
33
|
+
assert prompt_none_error_handling_correct == 'true',
|
34
|
+
'Authorization Server does not return an error for prompt=none when the End-User
|
35
|
+
is not authenticated or could not be silently authenticated.'
|
36
|
+
pass prompt_none_error_handling_note if prompt_none_error_handling_note.present?
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class StateMismatchErrorAttestationTest < Inferno::Test
|
3
|
+
title 'Handles state mismatch error correctly'
|
4
|
+
id :udap_security_state_mismatch_error
|
5
|
+
description %(
|
6
|
+
If the `state` parameter does NOT match, the Resource Holder MUST terminate the workflow and redirect with a
|
7
|
+
`server_error`.
|
8
|
+
)
|
9
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@271'
|
10
|
+
|
11
|
+
input :state_mismatch_error_handling_correct,
|
12
|
+
title: 'Error Handling: State mismatch error is handled correctly',
|
13
|
+
description: %(
|
14
|
+
I attest that the Resource Holder terminates the workflow and redirects with a `server_error` when the
|
15
|
+
`state` parameter does NOT match.
|
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 :state_mismatch_error_handling_note,
|
32
|
+
title: 'Notes, if applicable:',
|
33
|
+
type: 'textarea',
|
34
|
+
optional: true
|
35
|
+
|
36
|
+
run do
|
37
|
+
assert state_mismatch_error_handling_correct == 'true',
|
38
|
+
'Resource Holder does not terminate the workflow or redirect with a `server_error` when the
|
39
|
+
`state` parameter does NOT match.'
|
40
|
+
pass state_mismatch_error_handling_note if state_mismatch_error_handling_note.present?
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class UnauthenticatedUserErrorAttestationTest < Inferno::Test
|
3
|
+
title 'Handles unauthenticated user error correctly'
|
4
|
+
id :udap_security_unauthenticated_user_error
|
5
|
+
description %(
|
6
|
+
Data Holder returns an `access_denied` error response when it cannot resolve the authenticated user.
|
7
|
+
)
|
8
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@296'
|
9
|
+
|
10
|
+
input :unauthenticated_user_error_handling_correct,
|
11
|
+
title: 'Error Handling: Handles unauthenticated user error correctly',
|
12
|
+
description: %(
|
13
|
+
I attest that the Data Holder returns an `access_denied` error response when it cannot resolve
|
14
|
+
the authenticated user.
|
15
|
+
),
|
16
|
+
type: 'radio',
|
17
|
+
default: 'false',
|
18
|
+
options: {
|
19
|
+
list_options: [
|
20
|
+
{
|
21
|
+
label: 'Yes',
|
22
|
+
value: 'true'
|
23
|
+
},
|
24
|
+
{
|
25
|
+
label: 'No',
|
26
|
+
value: 'false'
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
30
|
+
input :unauthenticated_user_error_handling_note,
|
31
|
+
title: 'Notes, if applicable:',
|
32
|
+
type: 'textarea',
|
33
|
+
optional: true
|
34
|
+
|
35
|
+
run do
|
36
|
+
assert unauthenticated_user_error_handling_correct == 'true',
|
37
|
+
'Data Holder does not return an `access_denied` error response when it cannot resolve the
|
38
|
+
authenticated user.'
|
39
|
+
pass unauthenticated_user_error_handling_note if unauthenticated_user_error_handling_note.present?
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class ValidStateErrorResponseAttestationTest < Inferno::Test
|
3
|
+
title 'Handles valid state error correctly'
|
4
|
+
id :udap_security_valid_state_error_response
|
5
|
+
description %(
|
6
|
+
Resource Holder redirects with an `access_denied` error code when the `state` value is valid
|
7
|
+
on an error response.
|
8
|
+
)
|
9
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@273'
|
10
|
+
|
11
|
+
input :valid_state_error_response_handling_correct,
|
12
|
+
title: 'Error Handling: Handles valid state error correctly',
|
13
|
+
description: %(
|
14
|
+
I attest that the Resource Holder redirects with an `access_denied` error code when the
|
15
|
+
`state` value is valid on an error response.
|
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 :valid_state_error_response_handling_note,
|
32
|
+
title: 'Notes, if applicable:',
|
33
|
+
type: 'textarea',
|
34
|
+
optional: true
|
35
|
+
|
36
|
+
run do
|
37
|
+
assert valid_state_error_response_handling_correct == 'true',
|
38
|
+
'Resource Holder does not redirect with an `access_denied` error code when the `state`
|
39
|
+
value is valid on an error response.'
|
40
|
+
pass valid_state_error_response_handling_note if valid_state_error_response_handling_note.present?
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require_relative 'error_handling_group/deny_token_request_test'
|
2
|
+
require_relative 'error_handling_group/general_error_response_test'
|
3
|
+
require_relative 'error_handling_group/invalid_id_token_test'
|
4
|
+
require_relative 'error_handling_group/invalid_idp_test'
|
5
|
+
require_relative 'error_handling_group/invalid_redirection_uri_test'
|
6
|
+
require_relative 'error_handling_group/prompt_none_test'
|
7
|
+
require_relative 'error_handling_group/state_mismatch_test'
|
8
|
+
require_relative 'error_handling_group/unauthenticated_user_test'
|
9
|
+
require_relative 'error_handling_group/valid_state_error_response_test'
|
10
|
+
|
11
|
+
module UDAPSecurityTestKit
|
12
|
+
class ErrorHandlingAttestationGroup < Inferno::TestGroup
|
13
|
+
id :udap_server_v100_error_handling_group
|
14
|
+
title 'Error Handling'
|
15
|
+
|
16
|
+
run_as_group
|
17
|
+
test from: :udap_security_invalid_idp_error
|
18
|
+
test from: :udap_security_invalid_id_token_error
|
19
|
+
test from: :udap_security_deny_token_request
|
20
|
+
test from: :udap_security_prompt_none_error
|
21
|
+
test from: :udap_security_invalid_redirection_uri
|
22
|
+
test from: :udap_security_state_mismatch_error
|
23
|
+
test from: :udap_security_unauthenticated_user_error
|
24
|
+
test from: :udap_security_valid_state_error_response
|
25
|
+
:udap_security_general_error_response
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module UDAPSecurityTestKit
|
2
|
+
class AccessTokenValidationAttestationTest < Inferno::Test
|
3
|
+
title 'Validates access token correctly'
|
4
|
+
id :udap_security_access_token_validation
|
5
|
+
description %(
|
6
|
+
Data Holder validates the Access Token as per the Access Token validation rules,
|
7
|
+
including:
|
8
|
+
- Verifying the token's integrity.
|
9
|
+
- Checking claims such as `exp` and other relevant attributes.
|
10
|
+
)
|
11
|
+
verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@283',
|
12
|
+
'hl7.fhir.us.udap-security_1.0.0@290'
|
13
|
+
|
14
|
+
input :access_token_validation_correct,
|
15
|
+
title: 'ID Token and Access Token Validation: Validates access token correctly',
|
16
|
+
description: %(
|
17
|
+
I attest that the Data Holder validates the Access Token as per the Access Token validation rules,
|
18
|
+
including:
|
19
|
+
- Verifying the token's integrity.
|
20
|
+
- Checking claims such as `exp` and other relevant attributes.
|
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 :access_token_validation_note,
|
37
|
+
title: 'Notes, if applicable:',
|
38
|
+
type: 'textarea',
|
39
|
+
optional: true
|
40
|
+
|
41
|
+
run do
|
42
|
+
assert access_token_validation_correct == 'true',
|
43
|
+
'Access Token validation is not implemented correctly as per the Access Token validation rules.'
|
44
|
+
pass access_token_validation_note if access_token_validation_note.present?
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|