【问题标题】:Icinga2 permissions for all LDAP users所有 LDAP 用户的 Icinga2 权限
【发布时间】:2016-07-22 12:04:08
【问题描述】:

我有一个以 Active Directory 作为身份验证后端和 Icinga Web 2 作为前端运行的 Icinga2。

可以使用 Icingaweb2 配置文件夹中的roles.ini 配置前端权限。这就是我在里面的东西:

# roles.ini

[Users]
users = "*"
permissions = "module/monitoring"

如您所见,我想让所有经过身份验证的用户访问监控模块。我没有包含所有用户的组,因此我不能为此使用组。

这不起作用。向所有用户授予权限的正确语法如何?

(当然,使用现有的用户名或组名确实有效,因此后端配置是正确的。)提前非常感谢!

【问题讨论】:

  • 由于角色绑定到用户/用户组,我会默认将新用户添加到默认组。类似于文档中描述的内容:github.com/Icinga/icingaweb2/blob/master/doc/… 如果您可以通过添加通配符用户匹配的功能请求来说服开发人员 - 跳到 dev.icinga.org :)
  • 我也有同样的问题,目前还没有解决办法。通过 Apache+LDAP 进行身份验证,而不是“无权限”,因为 Icingaweb2 无法处理它。

标签: icinga


【解决方案1】:

此功能已在 IcingaWeb2 版本 2.5 中实现,请参阅 https://github.com/Icinga/icingaweb2/pull/3096。这是一个针对AdmissionLoader.php 的非常简单的补丁,您也可以手动单独申请:

commit f495b390da6eb257ca101889deb70ccc22bb99c7
Author: Eric Lippmann <eric.lippmann@icinga.com>
Date:   Thu Nov 16 12:01:06 2017 +0100

    Apply role to all users if the role is defined with users=*

    If the users directive contains at least one single asterisk, the role is applied to all users.
    So, this supports roles which define users=username, ..., * and users=*

    refs #3095

diff --git a/library/Icinga/Authentication/AdmissionLoader.php b/library/Icinga/Authentication/AdmissionLoader.php
index 0a80be127..8ee43dbfb 100644
--- a/library/Icinga/Authentication/AdmissionLoader.php
+++ b/library/Icinga/Authentication/AdmissionLoader.php
@@ -28,6 +28,9 @@ class AdmissionLoader
         $username = strtolower($username);
         if (! empty($section->users)) {
             $users = array_map('strtolower', StringHelper::trimSplit($section->users));
+            if (in_array('*', $users)) {
+                return true;
+            }
             if (in_array($username, $users)) {
                 return true;
             }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-22
    • 1970-01-01
    相关资源
    最近更新 更多