Commit Graph
3892 Commits
Author SHA1 Message Date
Alexander Bokovoy ec22295fed sysaccounts: extend permissions to include description and account lock
Security Architect role was supposed to manage sysaccount objects. But
since description attribute is missing from the list of the managed
permissions, the role is unable to modify 'description' field. Same for
nsAccountLock which needs an explicit ACI.

Fixes: https://pagure.io/freeipa/issue/9875

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-11-12 17:16:48 +01:00
Alexander Bokovoy f2fc104f06 sysaccount: make sure nsaccountlock is always present
Commands sysaccount-enable/sysaccount-disable allow to lock/unlock the
account.  This is exposed via operational attribute `nsAccountLock`
which has to be explicitly requested to query the state. However, if
account wasn't explicitly disabled before, `nsAccountLock` will not be
returned by the LDAP server.

Ensure the nsaccountlock attribute is always retrieved, validated, and
normalized across sysaccount operations.

- Invoke validate_nsaccountlock in create and modify pre-callbacks to
  enforce valid values

- Invoke convert_nsaccountlock in create, modify, list, reset, and
  policy post-callbacks to normalize the nsaccountlock attribute and
  default to False in case it is absent.

Fixes: https://pagure.io/freeipa/issue/9842

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Thomas Woerner <twoerner@redhat.com>
2025-11-11 14:44:00 +01:00
Florence Blanc-Renaud bd8288476f Backup-restore: backup krb5.conf.d snippet files
The installation of ipa server creates snippets in /etc/krb5.conf.d/
- freeipa-realm
- freeipa-server

Include these files in the backup

Fixes: https://pagure.io/freeipa/issue/9870
Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-11-07 15:50:56 +01:00
Alexander Bokovoy 24e4fd5c0c Add system accounts (sysaccounts)
Introduce support for LDAP-based system accounts by adding a dedicated
sysaccount plugin with full CLI commands, extending role membership to
include system accounts, and providing warnings for passsync
configuration updates across servers, along with corresponding
documentation and tests.

New Features:

    Implement system accounts LDAP object with CLI commands for add,
delete, modify, find, show, enable, and disable.

Enhancements:

    Extend role and baseldap plugins to support sysaccount membership
and manage passsync managers with a ServerSysacctMgrUpdateRequired
warning.

Documentation:

    Add a design document for system accounts and regenerate API docs
for sysaccount commands and role membership.

Tests:

    Update existing role and service plugin tests to cover sysaccount
membership.

Fixes: https://pagure.io/freeipa/issue/9842

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rafael Guterres Jeffman <rjeffman@redhat.com>
Reviewed-By: Thomas Woerner <twoerner@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2025-11-03 17:18:05 -05:00
Alexander Bokovoy 7a6391f245 Require krb5.conf.d because we install snippets there
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-11-03 10:07:30 +01:00
Alexander Bokovoy 890474ae3c krb5.conf templates: move IPA domain configuration into a separate snippet
Instead of modifying /etc/krb5.conf with all IPA realm configuration, follow
the practice of creating a separate config snippet file owned by IPA.

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-11-03 10:07:30 +01:00
Alexander Bokovoy 166dbfb630 krb5.conf templates: remove Kerberos 4 support
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-11-03 10:07:30 +01:00
Rob Crittenden 3b5caf9dbd Include the HSM token name when creating LWCAs
In order to generate the private key for a a LWCA (subca)
on an HSM the name of the subca needs to be the HSM token
name : name_of_subca, e.g. ipa_token:test.

This works fine now without any code changes but it requires
that admins always remember to include the prefix which is
unlikely (everyone makes mistakes). So do it for them if
an HSM is present and a token is not provided. We only support
one token at a time in IPA so for now this is sufficient.

One can also mix-and-match including the token and not.
For example you can run:

$ ipa ca-add test --subject cn=test
$ ipa ca-show ipa_token:test

It shouldn't be an issue if a lwca name contains a colon.

Fixes: https://pagure.io/freeipa/issue/9865

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-10-27 18:20:45 -03:00
Rob Crittenden 9605ea9a0b Use Augeas when updating dbmodules in krb5.conf
This repalces the straight string parsing from IPAv3.0.0.

It should be much more robust and result in a valid
configuration file when complete. aug.save() will
assure that as it will raise an error otherwise.

This will handle the following cases:
 * db_library = ipadb.so : do nothing
 * db_library is missing, set to ipadb.so
 * db_library is something else, replace wih ipadb.so

Fixes: https://pagure.io/freeipa/issue/9862
Related: https://pagure.io/freeipa/issue/5913

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-10-10 16:52:50 +05:30
Rob Crittenden 892fea881a Add support for libpwpolicy credit to password policy
We already have libpwquality plumbed in. The ask here was
to support the quality credits as well.

There are four credits: digits, uppers, lowers and others

These either count complexity towards satisfying the minimum
length or set the minimum number of a type allowed.

If any of the four credits is configured then it will cause
the password policy plugin to go through the libpwquality.

Reminder that libpwquality sets its own min password length
floor that should be overridden already.

If min_classes is set as well then that is still enforced.

Fixes: https://pagure.io/freeipa/issue/9835

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: David Hanina <dhanina@redhat.com>
2025-10-03 15:29:40 -04:00
David Hanina 563f20e2a4 Add info about modern webui
Adds a small information note, regarding launching modern webui with
redirect link.

Signed-off-by: David Hanina <dhanina@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-09-25 17:07:35 +02:00
Rob Crittenden 46b7c16be1 Don't let lack of subca in PKI prevent LDAP deletion
If a subCA only exists in LDAP then it couldn't be removed.

Allow the process to continue. It will fail in the same way if
it doesn't exist on both Dogtag and IPA.

Related: https://pagure.io/freeipa/issue/9738

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-09-18 17:20:01 +02:00
Alexander Bokovoy 2f3c035e2b GetEntryFromLDIF: handle DNs case-insensitive
LDAP expects case-insensitive DNs, so modify LDIF parser to
compare DNs as case-insensitive strings and use case-preserving but
case-insensitive dictionary.

Fixes: https://pagure.io/freeipa/issue/9854

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-09-18 13:29:32 +05:30
Alexander Bokovoy ae8e850708 dcerpc: Support Samba 4.23
Samba 4.23 ignores trust to PIM and 'within the forest' domains. It
didn't know what to do with them in past as well but starting with 4.23
the domain trust entries which have trust attributes with
LSA_TRUST_ATTRIBUTE_PIM_TRUST and LSA_TRUST_ATTRIBUTE_WITHIN_FOREST bits
set will be ignored.

FreeIPA did default to LSA_TRUST_ATTRIBUTE_WITHIN_FOREST for domains
stored with trusted attributes set to 0 or missing. This was behavior in
past for Samba as well. Since FreeIPA only supports forest trust and an
external trust, in both cases we should set explicit LSA trust attribute
bits:
 - LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE for the forest trust
 - LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE for the external trust

Fixes: https://pagure.io/freeipa/issue/9852

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Julien Rische <jrische@redhat.com>
2025-09-12 14:03:09 +02:00
Alexander Bokovoy 96c3d2d1ad dcerpc: make sure forest trust info structure version is 1
[MS-DRSR] 5.64 FOREST_TRUST_INFORMATION defines version of the
ForestTrustInfo structure as 1. We didn't set it so it was defaulting to
zero. Samba validates the version number and rejects ForestTrustInfo
structures from FreeIPA.

Make sure new structures are always set to version 1 and old strutures
fixed up to have version 1.

Fixes: https://pagure.io/freeipa/issue/9852

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Julien Rische <jrische@redhat.com>
2025-09-12 14:03:09 +02:00
Florence Blanc-Renaud c0994948b5 DNS over TLS: use system trust store
When a client or server is configured with DoT, the installer
creates /etc/unbound/conf.d/zzz-ipa.conf with
    tls-cert-bundle: /etc/pki/tls/certs/ca-bundle.crt

This certificate bundle does not exist any more in fedora 43+
(https://fedoraproject.org/wiki/Changes/droppingOfCertPemFile)
and the missing file prevents unbound service from starting.

The configuration should rather set
    tls-system-cert: yes
in order to rely on the systemwide trust store.

The upgrade is also handled by this change.

Fixes: https://pagure.io/freeipa/issue/9838
Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2025-09-01 13:52:09 +02:00
Antonio Torres e6445b88ab dns: disable all previous Unbound configuration before deploying ours
Previous configuration from another packages might break our Unbound
setup. Rename the config files to disable them before deploying our
configuration.

Fixes: https://pagure.io/freeipa/issue/9814
Signed-off-by: Antonio Torres <antorres@redhat.com>
Reviewed-By: Thomas Woerner <twoerner@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-07-29 17:14:45 +02:00
Stanislav Levin 7e436ff6fe install: make use of shared temp directory for hsm validation
During hsm validation temporary directory and files are prepared
by root in base temporary directory which can be private and
thereby not readable by anybody but root. The validation in its
turn, run some checks as pkiuser and fail to read not accessible
resources in such a case.

Hence, to make them available some shared place need to be used,
e.g. /tmp.

Fixes: https://pagure.io/freeipa/issue/9831
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-07-25 16:00:15 -04:00
Rafael Guterres Jeffman 9d7689f959 Use correct capitalization for GitHub and GitLab
The correct third party trademarks are GitHub and GitLab, and this is
the capitalization that needs to be used for documentation and messages,
when referring to each service.

Fixes: https://pagure.io/freeipa/issue/9811
Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-07-10 14:02:58 -04:00
Antonio Torres 76b3a342d5 dns: only overwrite resolv.conf during eDNS setup when needed
Don't overwrite resolv.conf if it already points to 127.0.0.1. This
ensures compatibility with read-only containers.

Fixes: https://pagure.io/freeipa/issue/9813
Signed-off-by: Antonio Torres <antorres@redhat.com>
Reviewed-By: Thomas Woerner <twoerner@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-07-01 15:36:19 +02:00
Thomas Woerner 47626a950f Replica: Request cert for DoT before setting up bind
Deploying a replica with DNS support using an IPA server DNS with DoT
fails while setting up DNS over TLS. The request for the certificate for
DoT using IPA CA is done after the DNS server for the replica is configured.

The nameserver in /etc/resolv.conf has been changed to 127.0.0.1, but
unbound was not yet configured as a forwarder.

The solution is to move the cert request before the DNS server
configuration. The unbound config from the client deployment is still
working at that moment.

Fixes: https://pagure.io/freeipa/issue/9808
Signed-off-by: Thomas Woerner <twoerner@redhat.com>
Reviewed-By: Antonio Torres <antorres@redhat.com>
2025-06-26 12:08:50 +02:00
Thomas Woerner 0bc089681c ipaserver/install/dns.py: Allow to Turn off DNSSEC validation for unbound
Unbound is by default configured to do DNSSEC validation with the validator
module. The solution is to set module-config to "iterator".

When the server is built with EDNS client subnet support this should be
changed to "subnetcache iterator" according to the unbound man page.

Fixes: https://pagure.io/freeipa/issue/9805
Signed-off-by: Thomas Woerner <twoerner@redhat.com>
Reviewed-By: Antonio Torres <antorres@redhat.com>
Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com>
2025-06-26 08:19:51 +02:00
Mark Reynolds 878b800e87 ipa-migrate - only remove repl state attribute options
Improve how we process attributes that might include replication state
data. Previously we only cared about ";binary" but there are other
attribute options that are used in IPA. Now we completely break down the
attribute into each option and rebuild it without any repl state options

Fixes: https://pagure.io/freeipa/issue/9784

Signed-off-by: Mark Reynolds <mreynolds@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-06-23 08:15:21 +02:00
Julien Rische fb12d9e14e Use ipaplatform tasks for krb5 enctypes
Provide the master key encryption type and the list of supported
encryption types as ipaplatform.<platform>.tasks methods. This allows
to generate the list at runtime based on the environment (e.g. FIPS) and
override the list depending of the platform.

3DES HMAC-SHA1 encryption type is now removed from supported encryption
types if it is present.

Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-06-20 17:24:23 +02:00
Rob Crittenden 6346ca71d7 Add token options to immutables for pki override
Setting the HSM options in a pki-override-file will
result in a successful installation but it affects the
storage of the token library path. It is stored as None.

We could also instead save the provided value from the
override but an override isn't necessary in this case
since IPA provides command-line options to enable it.

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-06-20 16:30:04 +02:00
Florence Blanc-Renaud 5323b77013 ipa-idrange-fix: check that IPA server is installed
If ipa-idrange-fix is called on a system where the server is not configured,
it crashes with a Traceback when trying to access api.env.basedn.

Check that IPA server is configured before processing further

ipatests: add test launching ipa-idrange-fix on unconfigured server

Fixes: https://pagure.io/freeipa/issue/9809
Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: David Hanina <dhanina@redhat.com>
2025-06-19 13:48:18 +02:00
Rob Crittenden 6b9400c135 Set krbCanonicalName=admin@REALM on the admin user
The admin must always own this name. If another entry has this
value set then remove it.

There is a uniqueness plugin for this attribute so the only two
possibilities are:

- no entry has this value set
- the admin user has this value set
- a different entry has the value set

Still, for robustness purposes, the upgrade plugin will handle
more entries.

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
2025-06-17 09:48:44 +02:00
David Hanina b36c163fe8 Warn when UID is out of local ID ranges
Provides simple warning when creating new user with uid out of
all local ranges, as this is the main culprit of breaking Kerberos, by
not generating ipantsecurityidentifier. We don't have to check for
user-mod, because modification never changes ipantsecurityidentifier.
We do not have to check groups, as groups are ignored for ipa without
AD trust. It's reasonable to revisit this in the future for group
creation and warn against groups out of ranges as well as
warn for users with groups without SID, in case AD trust is enabled.

Fixes: https://pagure.io/freeipa/issue/9781
Signed-off-by: David Hanina <dhanina@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-06-03 15:46:56 +02:00
Florence Blanc-Renaud e4a3d46e89 ipa config-mod: fix internalerror when setting an empty ipaconfigstring
When ipa config-mod is called with --ipaconfigstring="", the command
fails with an InternalError.
This happens because the code added for 32bits uid did not properly
handle this case.

Same issue if ipa subid-stats is called with a null ipaconfigstring.

This commit now handles when ipaconfigstring is empty or None, and adds
a test.

Fixes: https://pagure.io/freeipa/issue/9794
Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Francisco Trivino <ftrivino@redhat.com>
2025-05-27 09:33:13 +02:00
David Hanina 247adf4313 Require baserid and secondarybaserid
This has been already required for some time, just not really enforced.
Also adds few new tests, and removes test without providing rid.

Fixes: https://pagure.io/freeipa/issue/9779

Signed-off-by: David Hanina <dhanina@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-05-26 08:31:43 +02:00
Miro Hrončok ac791f7372 Stop using deprecated pkg_resources
Use packaging.version and importlib.metadata instead.

Note that packaging.version only parses versions compatible with Python packaging
(originally defined in PEP 440).
https://packaging.python.org/en/latest/specifications/version-specifiers/

Fixes https://pagure.io/freeipa/issue/9676

Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-05-06 13:48:35 +02:00
Alexander Bokovoy 94a0552cc6 pylint: do not use return at the end of flow
pylint 3.3+ considers the last 'return' in the flow 'useless':

contrib/perflog:89: [R1711(useless-return), parselog.display_times] Useless return at end of function or method)
ipatests/pytest_ipa/integration/tasks.py:1342: [R1711(useless-return), two_connected_topo] Useless return at end of function or method)
ipaserver/plugins/baseldap.py:575: [R1711(useless-return), host_is_master] Useless return at end of function or method)
ipaserver/install/replication.py:1425: [R1711(useless-return), ReplicationManager.initialize_replication] Useless return at end of function or method)

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-05-06 13:48:35 +02:00
Alexander Bokovoy b9579fe08c ipa-dnskeysyncd: use systemd-tmpfiles to handle tokens
ipa-dnskeysyncd daemon relies on both OpenDNSSEC and BIND accessing the
same cryptographic token. We use SoftHSMv2 here and store token in
DNSSEC_TOKENS_DIR, defined by the IPA platform.

Configure ipa-dnskeysyncd service to update permissions of the token
files using custom systemd-tmpfiles configuration.

Extend SELinux policy to handle access to the token under a separate
file context. Both token and its pin file need to be accessed by the BIND
rndc tool.

Fixes: https://pagure.io/freeipa/issue/9696

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-05-06 13:48:35 +02:00
Alexander Bokovoy d1e22146d2 DNS: detect when OpenSSL engine should be removed on upgrade
For OpenSSL Provider API use we don't need 'named -E engine-name'
anymore, it has to be removed. The removal process is slightly
complicated because we need to detect '-E engine-name' and compare it
with the engine we know about (pkcs11) but if we are upgrading to the
build that supports OpenSSL Provider API, we don't know the engine name
anymore.

Fixes: https://pagure.io/freeipa/issue/9696

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-05-06 13:48:35 +02:00
Alexander Bokovoy 1311df2e0e Use OpenSSL provider with BIND for Fedora 42+ and RHEL10+
OpenSSL Engine API is deprecated and ability to compile against it is
removed in RHEL10. OpenSSL provider API is the future.

Fedora 42+ also defaults to OpenSSL provider. With pkcs11-provider, the
same PKCS#11 modules can be loaded transparently like with OpenSSL
engines. Thus, we can update configuration to use the provider API.

While Fedora 41 also defaults to OpenSSL provider, we need BIND version
that supports using OpenSSL provider API. This backport was only done in
Fedora 42.

Fixes: https://pagure.io/freeipa/issue/9696

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-05-06 13:48:35 +02:00
Mark Reynolds 6cdabdacc9 ipa-migrate - improve suffix replacement
When values are "normalized/converted" to a new domain the order in
which the host/release/suffix are converted matters. Replacing the
suffix first can lead to incorrect results, so convert the host/realm
before converting the suffix

Signed-off-by: Mark Reynolds <mreynolds@redhat.com>
relates: https://pagure.io/freeipa/issue/9776
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-05-01 15:51:08 -04:00
Mark Reynolds 1fb3e7fedc ipa-migrate - do not process AD entgries in staging mode
Only migrate AD entries in production mode due to schema conflicts
created when removing certain AD attributes (e.g.
ipantsecurityidentifier)

SIgned-off-by: Mark Reynolds <mreynolds@redhat.com>
relates: https://pagure.io/freeipa/issue/9776
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-05-01 15:48:55 -04:00
Mark Reynolds 4e06a4179e ipa-migrate - remove replication state information
Remove replication state information (happens when LDIFs are used).
State information is written like:

     attribute;adcsn=<CSN>

But we also support ";binary" which should not be removed so special
handling is needed in that case.

Signed-off-by: Mark Reynolds <mareynol@redhat.com>
Fixes: https://pagure.io/freeipa/issue/9776
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-05-01 15:47:33 -04:00
Aleksandr Sharov ac6eee670d Add a check into ipa-cert-fix tool to avoid updating certs if CA is close to being expired.
Fixes: https://pagure.io/freeipa/issue/9760
Signed-off-by: Aleksandr Sharov <asharov@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-03-25 10:33:06 +01:00
Antonio Torres f1c30c5f6b dns: don't populate forwarders with DoT forwarders
DNS over TLS setup overrides global forwarder to point to Unbound, so no
need to setup regular forwarders.

Resolves: https://pagure.io/freeipa/issue/9748
Signed-off-by: Antonio Torres <antorres@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-03-25 12:26:52 +05:30
Rob Crittenden f91b677ada Don't require certificates to have unique ipaCertSubject
In the wild a public CA issued a new subordinate CA certificate
with an identical subject to another, with a new private key.
This was uninstallable using ipa-cacert-manage because it would
fail with "subject public key info mismatch" during verification
because a different certificate with the same subject but
different public key was installed.

I'm not sure of the reasoning to prevent this situation but I
see it as giving users flexibility. This may be hurtful to them
but they can always remove any affected certs.

This is backwards compatible with older releases from the client
perspective. Older servers will choke on the duplicates and
won't be able to manage these.

A new serial number option is added for displaying the list of
certificates and for use when deleting one with a duplicate subject.

ipa-cacert-manage delete on systems without this patch will
successfully remove ALL of the requested certificates. There is no
way to distinguish. At least it won't break anything and the
deleted certificates can be re-added.

Fixes: https://pagure.io/freeipa/issue/9652

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2025-03-21 13:26:39 -04:00
David Hanina 1419689113 Disallow removal of dogtag and ipa-dnskeysyncd services on IPA servers
Also removes dogtagldap from unremovable services

Fixes: https://pagure.io/freeipa/issue/9764
Signed-off-by: David Hanina <dhanina@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-03-19 21:40:06 +05:30
Florence Blanc-Renaud 140c3b5477 idrange: use minvalue=0 for baserid and secondarybaserid
With the support of 32 bit idrange, the minvalue was set to 1
but this introduces a regression in the command ipa trust-add
as the range for AD trust is added with baserid=0

Lower the minvalue to 0

Fixes: https://pagure.io/freeipa/issue/9765
Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2025-03-18 22:35:11 +05:30
Alexander Bokovoy 99decb1131 baseuser: allow uidNumber and gidNumber of 32-bit range
JSON format allows to encode integers up to 2^53-1. Linux systems allow
for 32-bit IDs. Permit setting full 32-bit uidNumber and gidNumber
through IPA API. Administrators already can set 32-bit IDs via LDAP.

ID Range also needs to permit larger sizes of RID bases. SIDGEN plugin
already treats RID bases as 1..MAX_UINT32.

Fixes: https://pagure.io/freeipa/issue/9757

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-03-13 21:22:37 +05:30
Alexander Bokovoy cdafe1d3e4 update_dna_shared_config: do not fail when config is not found
The helper function was supposed to return a DN or None.

Related: https://pagure.io/freeipa/issue/9757

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-03-13 21:22:37 +05:30
Alexander Bokovoy cc763d78cc config-mod: allow disabling subordinate ID integration
When full 32-bit ID range usage is required, subordinate ID support have
to be disabled. However, even if ID range for subordinate IDs were to be
removed, it will be restored during the next data upgrade.

Change upgrade code to only apply subID range creation when subID
support is enabled.

Do not allow allocating subIDs if their use is disabled.

Allow full 32-bit uidNumber/gidNumber values in JSON payload.

Fixes: https://pagure.io/freeipa/issue/9757

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2025-03-13 21:22:37 +05:30
David Hanina b917b320a8 Disable --raw and --structured together
Disables --raw and --structured for dnsrecord-* command.
This is being shown in help for structured, as raw is implemented in
almost every command, therefore people are more likely to view
structured. Also contains tests, even though this is newly noted, this
combination has never worked in the past.

Fixes: https://pagure.io/freeipa/issue/9756
Signed-off-by: David Hanina <dhanina@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-03-12 19:35:37 +05:30
Rob Crittenden 6d7f51c115 Drop python 2 support in ipaserver/install/ca.py
Lint issues with unicode

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-03-10 23:06:28 +05:30
Rob Crittenden 4a9c1dde57 Drop python 2 support in installutils.py
Compatibility in python 3.12 is limited and is triggering lint
failures.

Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-03-10 23:06:28 +05:30
Rob Crittenden 56be7b460e Drop python v2 in ipaserver/install/certs.py for lint errors
ipaserver/install/certs.py:908: [W4902(deprecated-method), _CrossProcessLock._read] Using deprecated method readfp())
ipaserver/install/certs.py:908: [I0021(useless-suppression), ] Useless suppression of 'no-member')

Related: https://pagure.io/freeipa/issue/9738

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2025-03-10 23:06:28 +05:30