IcingaDB Web protected vars behavior

Hi, I am currently trying out the permissions for Icinga DB Web and I am a but confused whether this is the desired behavior or if I should open a bug.

If I create two roles, both restricting the user to not see certain custom vars, the result is that only the intersection of those two restrictions will be applied.

For example if roleA has a restriction on *password* and roleB has a restriction on *token*, then a user with both roleA and roleB can see all variables, except those containing BOTH password and token. So api_password or jwt_token are visible, only e.g. password_token would be really hidden.

The same goes also if roleB would inherit for roleA. Unless roleB copies all the restrictions from roleA before adding new ones, it will be ignored.

When looking at the audit functionality of icingaweb2 however, it will show the permissions as *password*,*token* which in my opinion is the much more sensible approach, so that you don’t accidentally leak information because two roles don’t have overlapping restrictions.

This is caused, because the query for the objects uses a Filter::any instread of a Filter::all here: icingadb-web/library/Icingadb/Common/Auth.php at 9080b563a4571a54965603b9f98cbfab64580504 · Icinga/icingadb-web · GitHub

Any insights would be highly appreciated. I did not find much about this behavior in the actual documentation.

It’s expected.

Both roles express basically: NOT *password* OR NOT *token*
api_password matches with NOT *token* and jwt_token does with NOT *password*.
password_token however does not match at all and is hidden as result.

Restrictions from multiple roles are always combined this way. That is also documented:

Restrictions are expressions that limit access. What this exactly means is up to how the restriction is being utilized. Without any restriction, a user is supposed to see everything . A user that occupies multiple roles, which all define a restriction of the same type, will see more.
Security - Icinga Web

To achieve what you want, you need to define the protections in a single role. A base role for example.

1 Like

Are there any plans to bring back the Security tab? I want a feature to assure that what you see is actually what you get. I don’t feel comfortable adding it to a role, if any other role might break the rules, without carefully reviewing all other roles to make sure none overlap with mine for any users…

Are there any plans to bring back the Security tab?

No. The sole intention of making the protections a restriction was to make it possible to configure it dependent on role memberships.

I want a feature to assure that what you see is actually what you get

That’s what the Audit view is for. And careful consideration who can when edit authorization configuration :wink: