From 992c1810a9cf561eebd69b8a3707deb05ccc9795 Mon Sep 17 00:00:00 2001 From: Bruce Weygandt Date: Tue, 17 Nov 2026 14:29:18 -0700 Subject: [PATCH] validators: add Keycloak realm security validators --- ...keycloak_admin_events_details_enabled.yaml | 17 +++++++++ .../_cases/keycloak_admin_events_enabled.yaml | 17 +++++++++ .../keycloak_brute_force_lockout_enabled.yaml | 17 +++++++++ .../_cases/keycloak_login_events_enabled.yaml | 17 +++++++++ ...ak_phishing_resistant_always_required.yaml | 17 +++++++++ .../_cases/keycloak_realm_settings_read.yaml | 17 +++++++++ .../_cases/keycloak_remember_me_disabled.yaml | 17 +++++++++ .../keycloak_self_registration_disabled.yaml | 17 +++++++++ ...cloak_session_idle_timeout_15_minutes.yaml | 37 +++++++++++++++++++ ...eycloak_terms_and_conditions_required.yaml | 17 +++++++++ .../set_EVD-KEYCLOAK-REALM-SECURITY.yaml | 17 +++++++++ validators/common/collection_succeeded.yaml | 1 + ...keycloak_admin_events_details_enabled.yaml | 17 +++++++++ .../keycloak_admin_events_enabled.yaml | 19 ++++++++++ .../keycloak_brute_force_lockout_enabled.yaml | 18 +++++++++ .../keycloak_login_events_enabled.yaml | 18 +++++++++ ...ak_phishing_resistant_always_required.yaml | 20 ++++++++++ .../keycloak_realm_settings_read.yaml | 18 +++++++++ .../keycloak_remember_me_disabled.yaml | 17 +++++++++ .../keycloak_self_registration_disabled.yaml | 18 +++++++++ ...cloak_session_idle_timeout_15_minutes.yaml | 19 ++++++++++ ...eycloak_terms_and_conditions_required.yaml | 19 ++++++++++ 22 files changed, 391 insertions(+) create mode 100644 validators/_cases/keycloak_admin_events_details_enabled.yaml create mode 100644 validators/_cases/keycloak_admin_events_enabled.yaml create mode 100644 validators/_cases/keycloak_brute_force_lockout_enabled.yaml create mode 100644 validators/_cases/keycloak_login_events_enabled.yaml create mode 100644 validators/_cases/keycloak_phishing_resistant_always_required.yaml create mode 100644 validators/_cases/keycloak_realm_settings_read.yaml create mode 100644 validators/_cases/keycloak_remember_me_disabled.yaml create mode 100644 validators/_cases/keycloak_self_registration_disabled.yaml create mode 100644 validators/_cases/keycloak_session_idle_timeout_15_minutes.yaml create mode 100644 validators/_cases/keycloak_terms_and_conditions_required.yaml create mode 100644 validators/_cases/set_EVD-KEYCLOAK-REALM-SECURITY.yaml create mode 100644 validators/keycloak/keycloak_admin_events_details_enabled.yaml create mode 100644 validators/keycloak/keycloak_admin_events_enabled.yaml create mode 100644 validators/keycloak/keycloak_brute_force_lockout_enabled.yaml create mode 100644 validators/keycloak/keycloak_login_events_enabled.yaml create mode 100644 validators/keycloak/keycloak_phishing_resistant_always_required.yaml create mode 100644 validators/keycloak/keycloak_realm_settings_read.yaml create mode 100644 validators/keycloak/keycloak_remember_me_disabled.yaml create mode 100644 validators/keycloak/keycloak_self_registration_disabled.yaml create mode 100644 validators/keycloak/keycloak_session_idle_timeout_15_minutes.yaml create mode 100644 validators/keycloak/keycloak_terms_and_conditions_required.yaml diff --git a/validators/_cases/keycloak_admin_events_details_enabled.yaml b/validators/_cases/keycloak_admin_events_details_enabled.yaml new file mode 100644 index 00000000..cebc6374 --- /dev/null +++ b/validators/_cases/keycloak_admin_events_details_enabled.yaml @@ -0,0 +1,17 @@ +validator: keycloak_admin_events_details_enabled +cases: + - name: compliant + expect: PASS + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: non_compliant + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": false, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: unread_null + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": null, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: renamed + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled_renamed": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' diff --git a/validators/_cases/keycloak_admin_events_enabled.yaml b/validators/_cases/keycloak_admin_events_enabled.yaml new file mode 100644 index 00000000..4ad14757 --- /dev/null +++ b/validators/_cases/keycloak_admin_events_enabled.yaml @@ -0,0 +1,17 @@ +validator: keycloak_admin_events_enabled +cases: + - name: compliant + expect: PASS + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: non_compliant + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": false, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: unread_null + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": null, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: renamed + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled_renamed": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' diff --git a/validators/_cases/keycloak_brute_force_lockout_enabled.yaml b/validators/_cases/keycloak_brute_force_lockout_enabled.yaml new file mode 100644 index 00000000..d1e831bd --- /dev/null +++ b/validators/_cases/keycloak_brute_force_lockout_enabled.yaml @@ -0,0 +1,17 @@ +validator: keycloak_brute_force_lockout_enabled +cases: + - name: compliant + expect: PASS + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: non_compliant + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": false, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: unread_null + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": null, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: renamed + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected_renamed": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' diff --git a/validators/_cases/keycloak_login_events_enabled.yaml b/validators/_cases/keycloak_login_events_enabled.yaml new file mode 100644 index 00000000..c77780ca --- /dev/null +++ b/validators/_cases/keycloak_login_events_enabled.yaml @@ -0,0 +1,17 @@ +validator: keycloak_login_events_enabled +cases: + - name: compliant + expect: PASS + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: non_compliant + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": false, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: unread_null + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": null, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: renamed + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled_renamed": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' diff --git a/validators/_cases/keycloak_phishing_resistant_always_required.yaml b/validators/_cases/keycloak_phishing_resistant_always_required.yaml new file mode 100644 index 00000000..5d53bc4c --- /dev/null +++ b/validators/_cases/keycloak_phishing_resistant_always_required.yaml @@ -0,0 +1,17 @@ +validator: keycloak_phishing_resistant_always_required +cases: + - name: compliant + expect: PASS + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: non_compliant + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": false, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: unread_null + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": null, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: renamed + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required_renamed": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' diff --git a/validators/_cases/keycloak_realm_settings_read.yaml b/validators/_cases/keycloak_realm_settings_read.yaml new file mode 100644 index 00000000..6c8c382a --- /dev/null +++ b/validators/_cases/keycloak_realm_settings_read.yaml @@ -0,0 +1,17 @@ +validator: keycloak_realm_settings_read +cases: + - name: compliant + expect: PASS + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: non_compliant + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": false, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: unread_null + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": null, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: renamed + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled_renamed": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' diff --git a/validators/_cases/keycloak_remember_me_disabled.yaml b/validators/_cases/keycloak_remember_me_disabled.yaml new file mode 100644 index 00000000..9eb349b5 --- /dev/null +++ b/validators/_cases/keycloak_remember_me_disabled.yaml @@ -0,0 +1,17 @@ +validator: keycloak_remember_me_disabled +cases: + - name: compliant + expect: PASS + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: non_compliant + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": true, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: unread_null + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": null, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: renamed + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled_renamed": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' diff --git a/validators/_cases/keycloak_self_registration_disabled.yaml b/validators/_cases/keycloak_self_registration_disabled.yaml new file mode 100644 index 00000000..c6a1bf54 --- /dev/null +++ b/validators/_cases/keycloak_self_registration_disabled.yaml @@ -0,0 +1,17 @@ +validator: keycloak_self_registration_disabled +cases: + - name: compliant + expect: PASS + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: non_compliant + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": true, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: unread_null + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": null, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: renamed + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed_renamed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' diff --git a/validators/_cases/keycloak_session_idle_timeout_15_minutes.yaml b/validators/_cases/keycloak_session_idle_timeout_15_minutes.yaml new file mode 100644 index 00000000..b14c2879 --- /dev/null +++ b/validators/_cases/keycloak_session_idle_timeout_15_minutes.yaml @@ -0,0 +1,37 @@ +validator: keycloak_session_idle_timeout_15_minutes +cases: + - name: fifteen_minutes + expect: PASS + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: five_minutes + expect: PASS + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 5.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: seven_and_a_half + expect: PASS + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 7.5, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: thirty_minutes + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 30.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: fifteen_and_a_half + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.5, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: one_fifty + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 150.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: zero_never_expires + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 0.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: unread_null + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": null, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: renamed + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes_renamed": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' diff --git a/validators/_cases/keycloak_terms_and_conditions_required.yaml b/validators/_cases/keycloak_terms_and_conditions_required.yaml new file mode 100644 index 00000000..60bc87ff --- /dev/null +++ b/validators/_cases/keycloak_terms_and_conditions_required.yaml @@ -0,0 +1,17 @@ +validator: keycloak_terms_and_conditions_required +cases: + - name: compliant + expect: PASS + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: non_compliant + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": false, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: unread_null + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": null, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: renamed + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action_renamed": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' diff --git a/validators/_cases/set_EVD-KEYCLOAK-REALM-SECURITY.yaml b/validators/_cases/set_EVD-KEYCLOAK-REALM-SECURITY.yaml new file mode 100644 index 00000000..3fa5ae37 --- /dev/null +++ b/validators/_cases/set_EVD-KEYCLOAK-REALM-SECURITY.yaml @@ -0,0 +1,17 @@ +evidence_set: EVD-KEYCLOAK-REALM-SECURITY +cases: + - name: all_compliant + expect: PASS + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: phishing_resistant_optional + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": false, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' + + - name: realm_unread + expect: FAIL + artifact: '{"metadata": {"exit_code": 0, "status": "success"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": null, "admin_events_details_enabled": null, "admin_events_enabled": null, "browser_flow": null, "browser_flow_alternative_authenticators": null, "browser_flow_always_required_authenticators": null, "browser_flow_conditional_authenticators": null, "browser_flow_phishing_resistant_always_required": null, "brute_force_protected": null, "default_required_actions": null, "event_listeners": null, "identity_provider_types": null, "identity_providers_enabled": null, "lockout_failure_threshold": null, "lockout_max_wait_minutes": null, "login_events_enabled": null, "login_events_expiration_days": null, "password_expiry_days": null, "password_history": null, "password_min_length": null, "password_policy_rules": null, "permanent_lockout": null, "realm_enabled": null, "registration_allowed": null, "remember_me_enabled": null, "reset_credentials_authenticators": null, "ssl_required": null, "sso_session_idle_timeout_minutes": null, "sso_session_max_lifespan_minutes": null, "terms_and_conditions_default_action": null, "terms_and_conditions_enabled": null, "user_federation_providers": null}}}' + + - name: collection_failed + expect: FAIL + artifact: '{"metadata": {"exit_code": 1, "status": "error"}, "payload": {"metadata": {"api_failures": [], "base_url": "https://keycloak.admin.example.com", "datetime": "2026-11-17T00:00:00Z", "partial_failure": false, "realm": "uds"}, "results": {}, "summary": {"access_token_lifespan_minutes": 1.0, "admin_events_details_enabled": true, "admin_events_enabled": true, "browser_flow": "UDS Authentication", "browser_flow_alternative_authenticators": [], "browser_flow_always_required_authenticators": ["auth-x509-client-username-form", "webauthn-authenticator"], "browser_flow_conditional_authenticators": [], "browser_flow_phishing_resistant_always_required": true, "brute_force_protected": true, "default_required_actions": ["TERMS_AND_CONDITIONS", "webauthn-register"], "event_listeners": ["jboss-logging"], "identity_provider_types": ["oidc"], "identity_providers_enabled": 1, "lockout_failure_threshold": 3, "lockout_max_wait_minutes": 15.0, "login_events_enabled": true, "login_events_expiration_days": 90.0, "password_expiry_days": 60, "password_history": 24, "password_min_length": 15, "password_policy_rules": ["forceExpiredPasswordChange", "length", "notUsername", "passwordHistory"], "permanent_lockout": true, "realm_enabled": true, "registration_allowed": false, "remember_me_enabled": false, "reset_credentials_authenticators": ["reset-credential-email", "reset-credentials-choose-user"], "ssl_required": "all", "sso_session_idle_timeout_minutes": 15.0, "sso_session_max_lifespan_minutes": 600.0, "terms_and_conditions_default_action": true, "terms_and_conditions_enabled": true, "user_federation_providers": 1}}}' diff --git a/validators/common/collection_succeeded.yaml b/validators/common/collection_succeeded.yaml index 0643eb82..fd780fd6 100644 --- a/validators/common/collection_succeeded.yaml +++ b/validators/common/collection_succeeded.yaml @@ -70,3 +70,4 @@ evidence_sets: - EVD-FEDRAMP-VENDOR-CERTIFICATION - EVD-FEDRAMP-WORKSPACE-VENDOR-CERTIFICATION - EVD-ORGANIZATIONS-SCP + - EVD-KEYCLOAK-REALM-SECURITY diff --git a/validators/keycloak/keycloak_admin_events_details_enabled.yaml b/validators/keycloak/keycloak_admin_events_details_enabled.yaml new file mode 100644 index 00000000..8affe913 --- /dev/null +++ b/validators/keycloak/keycloak_admin_events_details_enabled.yaml @@ -0,0 +1,17 @@ +key: keycloak_admin_events_details_enabled +name: 'Keycloak: Admin Change Logs Include What Changed' +type: AUTOMATED +role: configuration +statement: > + Admin events include the full representation of what changed (admin_events_details_enabled is true). + Supports KSI-MLA-LET. Does not check whether the collection run succeeded. + +regex: '"admin_events_details_enabled":\s*true\b' +rules_summary: MATCH_COUNT NOT_EQUALS 0 +validation_rules: + - regexOperation: { type: MATCH_COUNT } + criteria: NOT_EQUALS + value: { type: CUSTOM_TEXT, customText: "0" } + +evidence_sets: + - EVD-KEYCLOAK-REALM-SECURITY diff --git a/validators/keycloak/keycloak_admin_events_enabled.yaml b/validators/keycloak/keycloak_admin_events_enabled.yaml new file mode 100644 index 00000000..a49e50ee --- /dev/null +++ b/validators/keycloak/keycloak_admin_events_enabled.yaml @@ -0,0 +1,19 @@ +key: keycloak_admin_events_enabled +name: 'Keycloak: Admin Changes Are Logged' +type: AUTOMATED +role: configuration +statement: > + Keycloak stores admin events (admin_events_enabled is true): every change made through the admin + console or API, including account, role and credential changes. Supports KSI-MLA-LET. Does not show + the events reach a SIEM or how long they are kept. Does not check whether the collection run + succeeded. + +regex: '"admin_events_enabled":\s*true\b' +rules_summary: MATCH_COUNT NOT_EQUALS 0 +validation_rules: + - regexOperation: { type: MATCH_COUNT } + criteria: NOT_EQUALS + value: { type: CUSTOM_TEXT, customText: "0" } + +evidence_sets: + - EVD-KEYCLOAK-REALM-SECURITY diff --git a/validators/keycloak/keycloak_brute_force_lockout_enabled.yaml b/validators/keycloak/keycloak_brute_force_lockout_enabled.yaml new file mode 100644 index 00000000..ab38b883 --- /dev/null +++ b/validators/keycloak/keycloak_brute_force_lockout_enabled.yaml @@ -0,0 +1,18 @@ +key: keycloak_brute_force_lockout_enabled +name: 'Keycloak: Repeated Failed Sign-Ins Lock the Account' +type: AUTOMATED +role: configuration +statement: > + Brute-force detection is on for the realm (brute_force_protected is true), so repeated failed + sign-ins lock the account; the threshold and lockout length are in the evidence. Supports + KSI-IAM-SUS. Does not check whether the collection run succeeded. + +regex: '"brute_force_protected":\s*true\b' +rules_summary: MATCH_COUNT NOT_EQUALS 0 +validation_rules: + - regexOperation: { type: MATCH_COUNT } + criteria: NOT_EQUALS + value: { type: CUSTOM_TEXT, customText: "0" } + +evidence_sets: + - EVD-KEYCLOAK-REALM-SECURITY diff --git a/validators/keycloak/keycloak_login_events_enabled.yaml b/validators/keycloak/keycloak_login_events_enabled.yaml new file mode 100644 index 00000000..34604f95 --- /dev/null +++ b/validators/keycloak/keycloak_login_events_enabled.yaml @@ -0,0 +1,18 @@ +key: keycloak_login_events_enabled +name: 'Keycloak: Sign-In Events Are Logged' +type: AUTOMATED +role: configuration +statement: > + Keycloak stores login events (login_events_enabled is true), including failed sign-ins. Supports + KSI-MLA-LET. Does not show the events reach a SIEM or how long they are kept. Does not check whether + the collection run succeeded. + +regex: '"login_events_enabled":\s*true\b' +rules_summary: MATCH_COUNT NOT_EQUALS 0 +validation_rules: + - regexOperation: { type: MATCH_COUNT } + criteria: NOT_EQUALS + value: { type: CUSTOM_TEXT, customText: "0" } + +evidence_sets: + - EVD-KEYCLOAK-REALM-SECURITY diff --git a/validators/keycloak/keycloak_phishing_resistant_always_required.yaml b/validators/keycloak/keycloak_phishing_resistant_always_required.yaml new file mode 100644 index 00000000..c348995c --- /dev/null +++ b/validators/keycloak/keycloak_phishing_resistant_always_required.yaml @@ -0,0 +1,20 @@ +key: keycloak_phishing_resistant_always_required +name: 'Keycloak: Phishing-Resistant Authenticator Required at Every Browser Sign-In' +type: AUTOMATED +role: configuration +statement: > + Every browser sign-in to the realm must pass a phishing-resistant authenticator (a WebAuthn security + key or passkey, or an X.509 client certificate such as a CAC or PIV card): it is REQUIRED in the + browser flow and every subflow above it is REQUIRED, so no ALTERNATIVE path skips it. Supports + KSI-IAM-APM. Covers the browser flow only, not direct grants or other clients' flow overrides. Does + not check whether the collection run succeeded. + +regex: '"browser_flow_phishing_resistant_always_required":\s*true\b' +rules_summary: MATCH_COUNT NOT_EQUALS 0 +validation_rules: + - regexOperation: { type: MATCH_COUNT } + criteria: NOT_EQUALS + value: { type: CUSTOM_TEXT, customText: "0" } + +evidence_sets: + - EVD-KEYCLOAK-REALM-SECURITY diff --git a/validators/keycloak/keycloak_realm_settings_read.yaml b/validators/keycloak/keycloak_realm_settings_read.yaml new file mode 100644 index 00000000..de797349 --- /dev/null +++ b/validators/keycloak/keycloak_realm_settings_read.yaml @@ -0,0 +1,18 @@ +key: keycloak_realm_settings_read +name: 'Keycloak: Realm Settings Read and Realm Enabled' +type: AUTOMATED +role: integrity +statement: > + The realm's settings were read and the realm is enabled (realm_enabled is true). The other Keycloak + checks on this set read the same settings, so a null here means they are judged on nothing. Does not + check whether the collection run succeeded. + +regex: '"realm_enabled":\s*true\b' +rules_summary: MATCH_COUNT NOT_EQUALS 0 +validation_rules: + - regexOperation: { type: MATCH_COUNT } + criteria: NOT_EQUALS + value: { type: CUSTOM_TEXT, customText: "0" } + +evidence_sets: + - EVD-KEYCLOAK-REALM-SECURITY diff --git a/validators/keycloak/keycloak_remember_me_disabled.yaml b/validators/keycloak/keycloak_remember_me_disabled.yaml new file mode 100644 index 00000000..fafbfef1 --- /dev/null +++ b/validators/keycloak/keycloak_remember_me_disabled.yaml @@ -0,0 +1,17 @@ +key: keycloak_remember_me_disabled +name: 'Keycloak: Remember Me Is Off' +type: AUTOMATED +role: configuration +statement: > + The sign-in page does not offer remember me (remember_me_enabled is false), so no session runs under + the longer remember-me timeouts. Does not check whether the collection run succeeded. + +regex: '"remember_me_enabled":\s*false\b' +rules_summary: MATCH_COUNT NOT_EQUALS 0 +validation_rules: + - regexOperation: { type: MATCH_COUNT } + criteria: NOT_EQUALS + value: { type: CUSTOM_TEXT, customText: "0" } + +evidence_sets: + - EVD-KEYCLOAK-REALM-SECURITY diff --git a/validators/keycloak/keycloak_self_registration_disabled.yaml b/validators/keycloak/keycloak_self_registration_disabled.yaml new file mode 100644 index 00000000..d87371d2 --- /dev/null +++ b/validators/keycloak/keycloak_self_registration_disabled.yaml @@ -0,0 +1,18 @@ +key: keycloak_self_registration_disabled +name: 'Keycloak: Self-Registration Is Off' +type: AUTOMATED +role: configuration +statement: > + Users cannot register themselves on the sign-in page (registration_allowed is false), so accounts + come only from administrators or federation. Does not show that every identity comes from one + directory. Does not check whether the collection run succeeded. + +regex: '"registration_allowed":\s*false\b' +rules_summary: MATCH_COUNT NOT_EQUALS 0 +validation_rules: + - regexOperation: { type: MATCH_COUNT } + criteria: NOT_EQUALS + value: { type: CUSTOM_TEXT, customText: "0" } + +evidence_sets: + - EVD-KEYCLOAK-REALM-SECURITY diff --git a/validators/keycloak/keycloak_session_idle_timeout_15_minutes.yaml b/validators/keycloak/keycloak_session_idle_timeout_15_minutes.yaml new file mode 100644 index 00000000..d3998334 --- /dev/null +++ b/validators/keycloak/keycloak_session_idle_timeout_15_minutes.yaml @@ -0,0 +1,19 @@ +key: keycloak_session_idle_timeout_15_minutes +name: 'Keycloak: Idle Sessions End Within 15 Minutes' +type: AUTOMATED +role: configuration +statement: > + An idle sign-in session ends within 15 minutes (sso_session_idle_timeout_minutes is above 0 and at + most 15). The threshold is the FedRAMP Moderate inactivity period (AC-11); change it here if the + organization's policy sets another. Does not show that a role or authenticator change forces a new + sign-in. Does not check whether the collection run succeeded. + +regex: '"sso_session_idle_timeout_minutes":\s*(?:(?:[1-9]|1[0-4])(?:\.\d+)?|15(?:\.0+)?)(?![\d.])' +rules_summary: MATCH_COUNT NOT_EQUALS 0 +validation_rules: + - regexOperation: { type: MATCH_COUNT } + criteria: NOT_EQUALS + value: { type: CUSTOM_TEXT, customText: "0" } + +evidence_sets: + - EVD-KEYCLOAK-REALM-SECURITY diff --git a/validators/keycloak/keycloak_terms_and_conditions_required.yaml b/validators/keycloak/keycloak_terms_and_conditions_required.yaml new file mode 100644 index 00000000..99a2b9c1 --- /dev/null +++ b/validators/keycloak/keycloak_terms_and_conditions_required.yaml @@ -0,0 +1,19 @@ +key: keycloak_terms_and_conditions_required +name: 'Keycloak: Users Must Accept Terms and Conditions' +type: AUTOMATED +role: configuration +statement: > + The terms and conditions required action is enabled and is a default action + (terms_and_conditions_default_action is true), so every new user must accept it before signing in. + Keycloak shows it once per user until it is reset, not at every sign-in, and this does not show the + text is the approved system use notification. Does not check whether the collection run succeeded. + +regex: '"terms_and_conditions_default_action":\s*true\b' +rules_summary: MATCH_COUNT NOT_EQUALS 0 +validation_rules: + - regexOperation: { type: MATCH_COUNT } + criteria: NOT_EQUALS + value: { type: CUSTOM_TEXT, customText: "0" } + +evidence_sets: + - EVD-KEYCLOAK-REALM-SECURITY