freeipa/ipatests
Christian Heimes 4911a3f055 Prevent local account takeover
It was found that if an account was created with a name corresponding to
an account local to a system, such as 'root', was created via IPA, such
account could access any enrolled machine with that account, and the local
system privileges. This also bypass the absence of explicit HBAC rules.

root principal alias
-------------------

The principal "root@REALM" is now a Kerberos principal alias for
"admin". This prevent user with "User Administrator" role or
"System: Add User" privilege to create an account with "root" principal
name.

Modified user permissions
-------------------------

Several user permissions no longer apply to admin users and filter on
posixaccount object class. This prevents user managers from modifying admin
acounts.

- System: Manage User Certificates
- System: Manage User Principals
- System: Manage User SSH Public Keys
- System: Modify Users
- System: Remove Users
- System: Unlock user

``System: Unlock User`` is restricted because the permission also allow a
user manager to lock an admin account. ``System: Modify Users`` is restricted
to prevent user managers from changing login shell or notification channels
(mail, mobile) of admin accounts.

New user permission
-------------------

- System: Change Admin User password

The new permission allows manipulation of admin user password fields. By
default only the ``PassSync Service`` privilege is allowed to modify
admin user password fields.

Modified group permissions
--------------------------

Group permissions are now restricted as well. Group admins can no longer
modify the admins group and are limited to groups with object class
``ipausergroup``.

- System: Modify Groups
- System: Remove Groups

The permission ``System: Modify Group Membership`` was already limited.

Notes
-----

Admin users are mostly unaffected by the new restrictions, except for
the fact that admins can no longer change krbPrincipalAlias of another
admin or manipulate password fields directly. Commands like ``ipa passwd
otheradmin`` still work, though. The ACI ``Admin can manage any entry``
allows admins to modify other entries and most attributes.

Managed permissions don't install ``obj.permission_filter_objectclasses``
when ``ipapermtargetfilter`` is set. Group and user objects now have a
``permission_filter_objectclasses_string`` attribute that is used
by new target filters.

Misc changes
------------

Also add new exception AlreadyContainsValueError. BaseLDAPAddAttribute
was raising a generic base class for LDAP execution errors.

Fixes: https://pagure.io/freeipa/issue/8326
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1810160
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2020-06-15 22:44:42 +03:00
..
azure azure: do not run test_commands due to failures in low memory cases 2020-05-27 17:57:39 +03:00
man Simplify ipa-run-tests script 2019-07-16 13:23:21 +03:00
prci_definitions ipatests: Update the pki-master-f32 image version 2020-06-15 14:13:55 +02:00
pytest_ipa ipatests: fix the disable_dnssec_validation method 2020-06-11 10:33:33 +02:00
test_cmdline pytest: Migrate unittest/nose to Pytest fixtures 2020-02-12 18:08:32 +02:00
test_install pytest: Migrate unittest/nose to Pytest fixtures 2020-02-12 18:08:32 +02:00
test_integration Prevent local account takeover 2020-06-15 22:44:42 +03:00
test_ipaclient Fix Pytest4.x warning about message 2019-06-19 19:20:14 +10:00
test_ipalib Fix detection logic for api.env.in_tree 2020-05-14 18:16:20 +02:00
test_ipaplatform Don't configure KEYRING ccache in containers 2019-01-18 11:33:11 +01:00
test_ipapython Silence W601 .has_key() is deprecated 2020-05-05 10:42:46 +02:00
test_ipaserver Overhaul bind upgrade process 2020-06-10 16:07:07 +02:00
test_ipatests_plugins ipatests: Allow zero-length arguments 2020-02-14 09:29:20 +02:00
test_webui WebUI tests: Test all available fields on "Kerberos Ticket Policy" page 2020-05-26 13:33:57 +02:00
test_xmlrpc tests: account for ID overrides as members of groups and roles 2020-06-08 12:39:34 -04:00
__init__.py Make an ipa-tests package 2013-06-17 19:22:50 +02:00
conftest.py Hard-code in_tree=True for tests 2020-05-14 18:16:20 +02:00
create_external_ca.py Test external CA with DNS name constraints 2019-08-06 12:39:46 +02:00
data.py Fix more bytes/unicode issues 2015-10-22 18:34:46 +02:00
i18n.py Sprinkle raw strings across the code base 2018-09-27 10:23:03 +02:00
ipa-run-tests ipatests: Specify shell implementation 2020-04-21 13:24:50 +02:00
ipa-test-config Rename pytest_plugins to ipatests.pytest_ipa 2018-08-02 17:07:43 +02:00
ipa-test-task Rename pytest_plugins to ipatests.pytest_ipa 2018-08-02 17:07:43 +02:00
Makefile.am Build: fix distribution of static files for web UI 2016-11-09 13:08:32 +01:00
setup.cfg Port all setup.py to setuptools 2016-10-20 18:43:37 +02:00
setup.py Simplify ipa-run-tests script 2019-07-16 13:23:21 +03:00
test_util.py Fix E712 comparison to True / False 2020-05-05 10:42:46 +02:00
util.py ipatests: Remove no longer needed 'skip' compatibility 2020-04-21 13:24:50 +02:00