认证与授权
通过 Secret 配置 LDAP 密码
要配置 Neo4j Helm 部署以通过 Secret 使用 LDAP 系统密码,您需要创建一个包含 LDAP 密码的 Kubernetes Secret,然后将 Secret 名称和挂载路径添加到 values.yaml 文件中。
-
运行以下命令创建一个包含 LDAP 密码的 Secret。该 Secret 必须包含一个名为
LDAP_PASS
的键。kubectl create secret generic <secret-name> --from-literal=LDAP_PASS=<ldap-password>
-
将 Secret 名称添加到 values.yaml 文件中。
# ldapPasswordFromSecret defines the secret which holds the password for ldap system account # Secret key name must be LDAP_PASS # This secret is accessible by Neo4j at the path defined in ldapPasswordMountPath ldapPasswordFromSecret: "" (1) # The above secret gets mounted to the path mentioned here ldapPasswordMountPath: "" (2)
1 — 在 Kubernetes 集群中显示的 Secret 名称。 2 — Secret 将作为卷挂载到 Neo4j 容器中的路径。
配置 SSO
Neo4j 通过实现 OpenID Connect (OIDC) 标准的身份提供程序支持 SSO 认证和授权。
要配置 Neo4j Helm 部署以使用 SSO 认证,首先,您需要配置您的身份提供程序以使用 ID 令牌进行认证和授权。然后,您可以通过将所有 SSO 配置添加到 values.yaml 文件中,来配置 Neo4j Helm 部署以使用该身份提供程序进行认证。
有关如何配置身份提供程序以及应定义哪些设置的更多信息,请参阅 Neo4j 单点登录 (SSO) 配置。
config:
dbms.security.oidc.azure.audience: "00f3a7d3-d855-4849-9e3c-57d7b6e12794"
dbms.security.oidc.azure.params: "client_id=00f3a7d3-d855-4849-9e3c-57d7b6e12794;response_type=code;scope=openid profile email"
dbms.security.oidc.azure.well_known_discovery_uri: "https://login.microsoftonline.com/da501982-4ca7-420c-8926-1e65b5bf565f/v2.0/.well-known/openid-configuration"
dbms.security.authorization_providers: "oidc-azure,native"
dbms.security.authentication_providers: "oidc-azure,native"
dbms.security.oidc.azure.display_name: "Azure SSO on K8s"
dbms.security.oidc.azure.auth_flow: "pkce"
server_type_principal=id_token;token_type_authentication=id_token"
dbms.security.oidc.azure.config: "principal=unique_name;code_challenge_method=S256;
dbms.security.oidc.azure.claims.username: "sub"
dbms.security.oidc.azure.claims.groups: "groups"
dbms.security.oidc.azure.authorization.group_to_role_mapping: "group1=editor;group2=editor,publisher"
|
配置服务帐户
在某些部署场景中,可能需要为 Neo4j Pod 分配一个 Kubernetes 服务帐户。例如,如果 Pod 中的进程需要连接到需要服务帐户授权的服务。要配置 Neo4j Pod 使用 Kubernetes 服务帐户,请将 podSpec.serviceAccountName
设置为要使用的服务帐户名称。
例如
# neo4j-values.yaml
neo4j:
password: "my-password"
podSpec:
serviceAccountName: "neo4j-service-account"
服务帐户必须已存在。在集群的情况下,Neo4j Helm 图表会创建并配置服务帐户。 |