安全设置(Security settings)#
功能可用性
安全设置适用于商业版和企业版计划。某些设置需要特定的许可证功能。不适用于你计划的设置会显示 升级 徽章。
安全设置让你管理实例范围的安全策略。你可以对所有用户强制实现双因素身份验证,并控制用户在其个人空间中可以执行的操作。
🌐 Security settings let you manage instance-wide security policies. You can enforce two-factor authentication for all users and control what users can do in their personal spaces.
要访问安全设置,请导航至 设置 > 安全。
🌐 To access security settings, navigate to Settings > Security.
启用双因素身份验证(Enforce two-factor authentication)#
你可以要求你实例上的所有用户在使用电子邮件和密码登录时设置两因素认证(2FA)。
🌐 You can require all users on your instance to set up two-factor authentication (2FA) when they sign in with email and password.
仅适用于电子邮件和密码登录
2FA 强制适用于使用电子邮件和密码进行身份验证的用户。通过 SSO(SAML 或 OIDC)登录的用户不受此设置影响。
要强制使用双重认证:
🌐 To enforce 2FA:
- 导航到 设置 > 安全。
- 在 强制两因素身份验证 部分,打开开关。
当你启用此设置时:
🌐 When you enable this setting:
- 所有用户必须在继续使用该实例之前设置双重身份验证。
- 尚未配置双因素认证的用户将在下次登录时被提示进行配置。
要停止强制执行双重身份验证,请关闭开关。已经设置双重身份验证的用户仍然保持启用,但新用户不再需要配置它。
🌐 To stop enforcing 2FA, toggle the switch off. Users who already set up 2FA keep it enabled but new users are no longer required to configure it.
有关个人用户如何设置两步验证的更多信息,请参阅双因素认证。
🌐 Refer to Two-factor authentication for more information on how individual users can set up 2FA.
个人空间政策(Personal space policies)#
个人空间策略允许实例管理员控制用户是否可以从他们的个人空间共享和发布工作流及凭据。
🌐 Personal space policies let instance admins control whether users can share and publish workflows and credentials from their personal spaces.
共享工作流程和凭证(Sharing workflows and credentials)#
控制用户是否可以将其个人空间中的工作流和凭据与其他用户或项目共享。
🌐 Controls whether users can share workflows and credentials from their personal space with other users or projects.
要管理共享:
🌐 To manage sharing:
- 导航到 设置 > 安全。
- 在 个人空间 部分,找到 共享工作流程和凭据。
- 切换开关以启用或禁用共享。
当你禁用共享时:
🌐 When you disable sharing:
- 现有的共享保持不变。该设置仅影响新的共享操作。
- 当前共享的工作流程和凭据数量显示在切换开关下方。
发布工作流程(Publishing workflows)#
控制用户是否可以将工作流从个人空间发布,使其可用于执行。
🌐 Controls whether users can publish workflows from their personal space to make them available for execution.
管理发布:
🌐 To manage publishing:
- 导航到 设置 > 安全。
- 在 个人空间 部分,找到 发布工作流程。
- 切换开关以启用或禁用发布。
当你禁用发布时:
🌐 When you disable publishing:
- 当前已发布的工作流程仍然保持发布状态。此设置仅影响新的发布操作。
- 当前已发布的个人工作流程数量显示在切换按钮下方。
使用环境变量配置安全策略(Configure security policy with environment variables)#
你还可以通过环境变量而不是通过 UI 来管理安全策略设置。从 n8n v2.18.0 开始可用。将 N8N_SECURITY_POLICY_MANAGED_BY_ENV 设置为 true 并提供以下变量。有关激活模式的工作原理,请参阅 使用环境变量管理实例设置。
🌐 You can also manage security policy settings from environment variables instead of through the UI. Available from n8n v2.18.0. Set N8N_SECURITY_POLICY_MANAGED_BY_ENV to true and provide the variables below. See Manage instance settings using environment variables for how the activation pattern works.
当 N8N_SECURITY_POLICY_MANAGED_BY_ENV 为 true 时,此页面上的 强制两步验证 和 个人空间 切换将变为只读。
🌐 When N8N_SECURITY_POLICY_MANAGED_BY_ENV is true, the Enforce two-factor authentication and Personal Space toggles on this page become read-only.
| Variable | Type | Default | Description |
|---|---|---|---|
N8N_SECURITY_POLICY_MANAGED_BY_ENV |
Boolean | false |
Set to true to manage the security policy from environment variables. When true, n8n applies the security policy variables on every startup and locks the matching UI controls. |
N8N_MFA_ENFORCED_ENABLED |
Boolean | false |
Whether to enforce two-factor authentication for all users (true) or not (false). |
N8N_PERSONAL_SPACE_PUBLISHING_ENABLED |
Boolean | true |
Whether users can publish from their personal space (true) or not (false). |
N8N_PERSONAL_SPACE_SHARING_ENABLED |
Boolean | true |
Whether users can share resources from their personal space (true) or not (false). |