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.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/lib/udap_security_test_kit/authorization_code_received_test.rb +8 -0
  3. data/lib/udap_security_test_kit/authorization_code_redirect_test.rb +3 -0
  4. data/lib/udap_security_test_kit/authorization_code_token_exchange_test.rb +2 -0
  5. data/lib/udap_security_test_kit/authorization_endpoint_field_test.rb +5 -1
  6. data/lib/udap_security_test_kit/client_suite/access_ac_group.rb +2 -0
  7. data/lib/udap_security_test_kit/client_suite/authorization_request_verification_test.rb +5 -0
  8. data/lib/udap_security_test_kit/client_suite/registration_ac_verification_test.rb +34 -0
  9. data/lib/udap_security_test_kit/client_suite/registration_cc_verification_test.rb +30 -0
  10. data/lib/udap_security_test_kit/client_suite/token_request_ac_verification_test.rb +47 -0
  11. data/lib/udap_security_test_kit/client_suite/token_request_cc_verification_test.rb +25 -0
  12. data/lib/udap_security_test_kit/client_suite.rb +11 -0
  13. data/lib/udap_security_test_kit/discovery_group.rb +2 -0
  14. data/lib/udap_security_test_kit/dynamic_client_registration_group.rb +3 -0
  15. data/lib/udap_security_test_kit/endpoints/mock_udap_server.rb +2 -2
  16. data/lib/udap_security_test_kit/grant_types_supported_field_test.rb +3 -0
  17. data/lib/udap_security_test_kit/reg_endpoint_jwt_signing_alg_values_supported_field_test.rb +6 -0
  18. data/lib/udap_security_test_kit/registration_endpoint_field_test.rb +3 -0
  19. data/lib/udap_security_test_kit/registration_failure_invalid_contents_test.rb +4 -1
  20. data/lib/udap_security_test_kit/registration_failure_invalid_jwt_signature_test.rb +2 -0
  21. data/lib/udap_security_test_kit/registration_success_contents_test.rb +3 -0
  22. data/lib/udap_security_test_kit/registration_success_test.rb +3 -0
  23. data/lib/udap_security_test_kit/requirements/generated/udap-security-test-kit_requirements_coverage.csv +317 -0
  24. data/lib/udap_security_test_kit/requirements/generated/udap_security_client_requirements_coverage.csv +146 -0
  25. data/lib/udap_security_test_kit/requirements/generated/udap_security_requirements_coverage.csv +164 -0
  26. data/lib/udap_security_test_kit/requirements/hl7.fhir.us.udap-security_1.0.0_reqs.xlsx +0 -0
  27. data/lib/udap_security_test_kit/requirements/udap_security_test_kit_requirements.csv +308 -0
  28. data/lib/udap_security_test_kit/signed_metadata_contents_test.rb +17 -0
  29. data/lib/udap_security_test_kit/signed_metadata_field_test.rb +4 -1
  30. data/lib/udap_security_test_kit/token_endpoint_auth_methods_supported_field_test.rb +2 -0
  31. data/lib/udap_security_test_kit/token_endpoint_auth_signing_alg_values_supported_field_test.rb +5 -0
  32. data/lib/udap_security_test_kit/token_endpoint_field_test.rb +3 -0
  33. data/lib/udap_security_test_kit/udap_auth_extensions_required_field_test.rb +3 -0
  34. data/lib/udap_security_test_kit/udap_auth_extensions_supported_field_test.rb +3 -0
  35. data/lib/udap_security_test_kit/udap_certifications_required_field_test.rb +3 -0
  36. data/lib/udap_security_test_kit/udap_certifications_supported_field_test.rb +2 -0
  37. data/lib/udap_security_test_kit/udap_profiles_supported_field_test.rb +5 -0
  38. data/lib/udap_security_test_kit/udap_versions_supported_field_test.rb +2 -0
  39. data/lib/udap_security_test_kit/version.rb +2 -2
  40. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/b2b_authorization_extension_object_test.rb +77 -0
  41. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/client_authorization_code_usage_test.rb +47 -0
  42. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/client_security_csrf_protection_test.rb +50 -0
  43. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/cryptographic_algorithms_test.rb +44 -0
  44. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/data_holder_auth_request_scope_test.rb +42 -0
  45. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/idp_authentication_compliance_test.rb +44 -0
  46. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/idp_supports_required_scopes_test.rb +42 -0
  47. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/jti_reuse_prevention_test.rb +44 -0
  48. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/metadata_interpretation_test.rb +47 -0
  49. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/oauth2_protocol_compliance_test.rb +50 -0
  50. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/preferred_identity_provider_test.rb +45 -0
  51. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/private_key_authentication_test.rb +47 -0
  52. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/resource_holder_authentication_test.rb +45 -0
  53. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/software_statement_registration_test.rb +49 -0
  54. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/token_request_authentication_test.rb +51 -0
  55. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/trust_community_query_parameters_test.rb +43 -0
  56. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client/validation_confidentiality_test.rb +49 -0
  57. data/lib/udap_security_test_kit/visual_inspection_and_attestation/client_attestation_group.rb +48 -0
  58. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authentication_requests_group/authentication_request_construction_test.rb +56 -0
  59. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authentication_requests_group/authentication_request_validation_test.rb +60 -0
  60. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authentication_requests_group.rb +13 -0
  61. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authorization_code_token_requests_group/access_token_lifetime_test.rb +42 -0
  62. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authorization_code_token_requests_group/access_token_request_validation_test.rb +51 -0
  63. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authorization_code_token_requests_group/authorization_code_usage_test.rb +45 -0
  64. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authorization_code_token_requests_group/resource_holder_authorization_flow_test.rb +37 -0
  65. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/authorization_code_token_requests_group.rb +17 -0
  66. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/client_authentication_group/client_certificate_storage_test.rb +36 -0
  67. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/client_authentication_group/no_client_credentials_native_apps_test.rb +38 -0
  68. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/client_authentication_group.rb +13 -0
  69. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/dynamic_client_registration_group/certification_handling_test.rb +45 -0
  70. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/dynamic_client_registration_group/client_id_modification_test.rb +42 -0
  71. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/dynamic_client_registration_group/dynamic_client_registration_validation_test.rb +48 -0
  72. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/dynamic_client_registration_group.rb +15 -0
  73. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/deny_token_request_test.rb +42 -0
  74. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/general_error_response_test.rb +39 -0
  75. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/invalid_id_token_test.rb +43 -0
  76. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/invalid_idp_test.rb +39 -0
  77. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/invalid_redirection_uri_test.rb +43 -0
  78. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/prompt_none_test.rb +39 -0
  79. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/state_mismatch_test.rb +43 -0
  80. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/unauthenticated_user_test.rb +42 -0
  81. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group/valid_state_error_response_test.rb +43 -0
  82. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/error_handling_group.rb +27 -0
  83. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/id_token_access_token_validation_group/access_token_validation_test.rb +47 -0
  84. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/id_token_access_token_validation_group/id_token_validation_test.rb +45 -0
  85. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/id_token_access_token_validation_group/token_response_validation_test.rb +47 -0
  86. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/id_token_access_token_validation_group.rb +15 -0
  87. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/identity_provider_interaction_group/idp_authentication_request_test.rb +45 -0
  88. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/identity_provider_interaction_group/idp_dynamic_registration_test.rb +45 -0
  89. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/identity_provider_interaction_group/idp_metadata_validation_test.rb +44 -0
  90. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/identity_provider_interaction_group/idp_token_exchange_test.rb +46 -0
  91. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/identity_provider_interaction_group.rb +17 -0
  92. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group/jwt_certificate_chain_validation_test.rb +36 -0
  93. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group/jwt_grant_parameter_validation_test.rb +36 -0
  94. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group/jwt_jti_reuse_test.rb +35 -0
  95. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group/jwt_signature_validation_test.rb +36 -0
  96. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group/jwt_token_request_validation_test.rb +43 -0
  97. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/jwt_security_group.rb +19 -0
  98. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group/udap_authorization_extensions_required_test.rb +43 -0
  99. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group/udap_community_parameter_support_test.rb +44 -0
  100. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group/udap_metadata_endpoint_error_handling_test.rb +43 -0
  101. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group/udap_metadata_representation_test.rb +42 -0
  102. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group/udap_profiles_supported_test.rb +43 -0
  103. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/metadata_server_capabilities_group.rb +19 -0
  104. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/security_measures_group/csrf_protection_test.rb +49 -0
  105. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/security_measures_group/obtain_authorization_scopes_test.rb +44 -0
  106. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/security_measures_group/state_parameter_test.rb +48 -0
  107. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/security_measures_group/unauthenticated_client_security_test.rb +47 -0
  108. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server/security_measures_group.rb +17 -0
  109. data/lib/udap_security_test_kit/visual_inspection_and_attestation/server_attestation_group.rb +33 -0
  110. data/lib/udap_security_test_kit/well_known_endpoint_test.rb +4 -0
  111. data/lib/udap_security_test_kit.rb +10 -0
  112. metadata +85 -4
@@ -15,6 +15,9 @@ module UDAPSecurityTestKit
15
15
  input :udap_well_known_metadata_json
16
16
  output :udap_certifications_required
17
17
 
18
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@34',
19
+ 'hl7.fhir.us.udap-security_1.0.0@35'
20
+
18
21
  run do
19
22
  assert_valid_json(udap_well_known_metadata_json)
20
23
  config = JSON.parse(udap_well_known_metadata_json)
@@ -13,6 +13,8 @@ module UDAPSecurityTestKit
13
13
 
14
14
  input :udap_well_known_metadata_json
15
15
 
16
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@33'
17
+
16
18
  run do
17
19
  assert_valid_json(udap_well_known_metadata_json)
18
20
  config = JSON.parse(udap_well_known_metadata_json)
@@ -20,6 +20,11 @@ module UDAPSecurityTestKit
20
20
 
21
21
  input :udap_well_known_metadata_json
22
22
 
23
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@23',
24
+ 'hl7.fhir.us.udap-security_1.0.0@24',
25
+ 'hl7.fhir.us.udap-security_1.0.0@25',
26
+ 'hl7.fhir.us.udap-security_1.0.0@26'
27
+
23
28
  run do
24
29
  assert_valid_json(udap_well_known_metadata_json)
25
30
  config = JSON.parse(udap_well_known_metadata_json)
@@ -11,6 +11,8 @@ module UDAPSecurityTestKit
11
11
 
12
12
  input :udap_well_known_metadata_json
13
13
 
14
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@22'
15
+
14
16
  run do
15
17
  assert_valid_json(udap_well_known_metadata_json)
16
18
  config = JSON.parse(udap_well_known_metadata_json)
@@ -1,4 +1,4 @@
1
1
  module UDAPSecurityTestKit
2
- VERSION = '0.11.5'.freeze
3
- LAST_UPDATED = '2025-05-14'.freeze
2
+ VERSION = '0.12.0'.freeze
3
+ LAST_UPDATED = '2025-07-21'.freeze
4
4
  end
@@ -0,0 +1,77 @@
1
+ module UDAPSecurityTestKit
2
+ class B2BAuthorizationExtensionObjectAttestationTest < Inferno::Test
3
+ title 'Complies with requirements for the B2B Flow and Authorization Extension Object'
4
+ id :udap_security_b2b_authorization_extension_object
5
+ description %(
6
+ Client application complies with requirements for the B2B Flow and Authorization Extension Object and:
7
+ - Includes `subject_name` parameter if it is known for human or non-human requestors.
8
+ - Includes `subject_id` parameter for human requestors when the `subject_name` parameter is present.
9
+ - Uses the National Provider Identifier (NPI) as the value for `subject_id` for human requestors in the US Realm.
10
+ - Ensures that the `consent_reference` parameter includes URLs that are resolvable by the receiving party.
11
+ - Omits `consent_reference` if `consent_policy` is not present.
12
+ - Ensures that the Requestor’s User, if applicable, is using the app only as authorized by the Requestor.
13
+ - Omits the `extensions` claim for client apps using the `authorization_code` flow.
14
+ - Includes the `subject_role` value if known for human requestors when the `subject_name` parameter is
15
+ present, and for US Realm, uses values/formats constrained by trust communities (preferably from the
16
+ NUCC Provider Taxonomy Code Set).
17
+ - Includes the `organization_id` value, using a URI scheme defined by the trust community.
18
+ )
19
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@187',
20
+ 'hl7.fhir.us.udap-security_1.0.0@199',
21
+ 'hl7.fhir.us.udap-security_1.0.0@203',
22
+ 'hl7.fhir.us.udap-security_1.0.0@204',
23
+ 'hl7.fhir.us.udap-security_1.0.0@205',
24
+ 'hl7.fhir.us.udap-security_1.0.0@206',
25
+ 'hl7.fhir.us.udap-security_1.0.0@207',
26
+ 'hl7.fhir.us.udap-security_1.0.0@208',
27
+ 'hl7.fhir.us.udap-security_1.0.0@213',
28
+ 'hl7.fhir.us.udap-security_1.0.0@219',
29
+ 'hl7.fhir.us.udap-security_1.0.0@220',
30
+ 'hl7.fhir.us.udap-security_1.0.0@221'
31
+
32
+ input :b2b_authorization_extension_object_compliance,
33
+ title: 'Complies with requirements for the B2B Flow and Authorization Extension Object',
34
+ description: %(
35
+ I attest that the client application complies with requirements for the B2B Flow and Authorization
36
+ Extension Object and:
37
+ - Includes `subject_name` parameter if it is known for human or non-human requestors.
38
+ - Includes `subject_id` parameter for human requestors when the `subject_name` parameter is present.
39
+ - Uses the National Provider Identifier (NPI) as the value for `subject_id` for human requestors in the
40
+ US Realm.
41
+ - Ensures that the `consent_reference` parameter includes URLs that are resolvable by the receiving party.
42
+ - Omits `consent_reference` if `consent_policy` is not present.
43
+ - Ensures that the Requestor’s User, if applicable, is using the app only as authorized by the Requestor.
44
+ - Omits the `extensions` claim for client apps using the `authorization_code` flow.
45
+ - Includes the `subject_role` value if known for human requestors when the `subject_name` parameter is
46
+ present, and for US Realm, uses values/formats constrained by trust communities (preferably from the
47
+ NUCC Provider Taxonomy Code Set).
48
+ - Includes the `organization_id` value, using a URI scheme defined by the trust community.
49
+ ),
50
+ type: 'radio',
51
+ default: 'false',
52
+ options: {
53
+ list_options: [
54
+ {
55
+ label: 'Yes',
56
+ value: 'true'
57
+ },
58
+ {
59
+ label: 'No',
60
+ value: 'false'
61
+ }
62
+ ]
63
+ }
64
+ input :b2b_authorization_extension_object_compliance_note,
65
+ title: 'Notes, if applicable:',
66
+ type: 'textarea',
67
+ optional: true
68
+
69
+ run do
70
+ assert b2b_authorization_extension_object_compliance == 'true',
71
+ 'Client application did not comply with requirements for the B2B Authorization Extension Object.'
72
+ if b2b_authorization_extension_object_compliance_note.present?
73
+ pass b2b_authorization_extension_object_compliance_note
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,47 @@
1
+ module UDAPSecurityTestKit
2
+ class ClientAuthorizationCodeUsageAttestationTest < Inferno::Test
3
+ title 'Uses authorization code correctly'
4
+ id :udap_security_client_auth_code_usage
5
+ description %(
6
+ Client application uses the authorization code correctly by:
7
+ - Ensuring the authorization code is not used more than once.
8
+ - Requesting an authorization code as per [Section 4.1.1](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.1)
9
+ of RFC 6749.
10
+ )
11
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@136',
12
+ 'hl7.fhir.us.udap-security_1.0.0@188'
13
+
14
+ input :authorization_code_usage_correctly,
15
+ title: 'Uses authorization code correctly',
16
+ description: %(
17
+ I attest that the client application uses the authorization code correctly by:
18
+ - Ensuring the authorization code is not used more than once.
19
+ - Requesting an authorization code as per [Section 4.1.1](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.1)
20
+ of RFC 6749.
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 :authorization_code_usage_correctly_note,
37
+ title: 'Notes, if applicable:',
38
+ type: 'textarea',
39
+ optional: true
40
+
41
+ run do
42
+ assert authorization_code_usage_correctly == 'true',
43
+ 'Client application did not demonstrate correct usage of the authorization code.'
44
+ pass authorization_code_usage_correctly_note if authorization_code_usage_correctly_note.present?
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,50 @@
1
+ module UDAPSecurityTestKit
2
+ class ClientSecurityAndCSRFProtectionAttestationTest < Inferno::Test
3
+ title 'Complies with Client Security and CSRF Protection'
4
+ id :udap_security_client_security_csrf_protection
5
+ description %(
6
+ Client applications complies with the requirements for Client Security and CSRF Protection:
7
+ - Implements CSRF protection for its redirection URI.
8
+ - Uses a binding value for CSRF protection that contains a non-guessable value.
9
+ - Ensures the user-agent's authenticated state is accessible only to the client and user-agent, protected by
10
+ the same-origin policy.
11
+ )
12
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@275',
13
+ 'hl7.fhir.us.udap-security_1.0.0@276',
14
+ 'hl7.fhir.us.udap-security_1.0.0@277'
15
+
16
+ input :csrf_protection_implementation,
17
+ title: 'Complies with the requirements for Client Security and CSRF Protection',
18
+ description: %(
19
+ I attest that the client application complies with the requirements for Client Security and CSRF Protection:
20
+ - Implements CSRF protection for its redirection URI.
21
+ - Uses a binding value for CSRF protection that contains a non-guessable value.
22
+ - Ensures the user-agent's authenticated state is accessible only to the client and user-agent, protected by
23
+ the same-origin policy.
24
+ ),
25
+ type: 'radio',
26
+ default: 'false',
27
+ options: {
28
+ list_options: [
29
+ {
30
+ label: 'Yes',
31
+ value: 'true'
32
+ },
33
+ {
34
+ label: 'No',
35
+ value: 'false'
36
+ }
37
+ ]
38
+ }
39
+ input :csrf_protection_implementation_note,
40
+ title: 'Notes, if applicable:',
41
+ type: 'textarea',
42
+ optional: true
43
+
44
+ run do
45
+ assert csrf_protection_implementation == 'true',
46
+ 'Client application did not comply with the requirements for Client Security and CSRF Protection.'
47
+ pass csrf_protection_implementation_note if csrf_protection_implementation_note.present?
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,44 @@
1
+ module UDAPSecurityTestKit
2
+ class CryptographicAlgorithmsAndSecurityProtocolsAttestationTest < Inferno::Test
3
+ title 'supports the RS256 signature algorithm'
4
+ id :udap_security_crypto_algorithms_and_protocols
5
+ description %(
6
+ Client application supports the RS256 signature algorithm as defined in as defined in
7
+ [RFC 7518](https://datatracker.ietf.org/doc/html/rfc7518#section-3.1) for UDAP workflows.
8
+ )
9
+ verifies_requirements 'hl7.fhir.us.udap-security_1.0.0@4'
10
+
11
+ input :crypto_algorithms_and_protocols_compliance,
12
+ title: 'Supports the RS256 signature algorithm',
13
+ description: %(
14
+ I attest that the client application supports the RS256 signature algorithm as defined in as defined in
15
+ [RFC 7518](https://datatracker.ietf.org/doc/html/rfc7518#section-3.1) for UDAP workflows.
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 :crypto_algorithms_and_protocols_compliance_note,
33
+ title: 'Notes, if applicable:',
34
+ type: 'textarea',
35
+ optional: true
36
+
37
+ run do
38
+ assert crypto_algorithms_and_protocols_compliance == 'true',
39
+ 'Client application did not comply with cryptographic algorithms and security protocols requirements
40
+ (RS256 support).'
41
+ pass crypto_algorithms_and_protocols_compliance_note if crypto_algorithms_and_protocols_compliance_note.present?
42
+ end
43
+ end
44
+ end
@@ -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