#9938 ipa-migrate doesn't process users' sshpublickeys
Closed: fixed by rjeffman. Opened by kororland.

What were you trying to do that didn't work?

during migration, ipasshpubkey attribute is removed from all the entries, including user ones

What is the impact of this issue to you?

manual transfer for public keys is required

Please provide the package NVR for which the bug is seen:

ipa-common-4.12.2-22.el9_7.1

How reproducible is this bug?:

always

Steps to reproduce

  • add key to a user in old deployment
  • migrate
  • key is not there

Expected results

Keys are not migrated

Actual results

Not migrated - same goes for id overrides, staged and preserved users

Analysis

from ipa_migrate_constraints.py:

# Atributes to strip from users/groups
STRIP_ATTRS = [
    'krbextradata',
    'krblastfailedauth',
    'krblastpwdchange',
    'krbloginfailedcount',
    'krbticketflags',
    'krbmkey',
    'ipasshpubkey',  # We keep this for users (handled in clean_entry())    << here
    'mepmanagedentry',  # It will be rebuilt on new server
    'memberof',
    # from ds-migrate....
    'krbprincipalkey', 'memberofindirect', 'memberindirect',  # User
    'memberofindirect', 'memberindirect',  # Groups
]

but the actual function does

    def clean_entry(self, entry_dn, entry_type, entry_attrs):
...
        # Set the attrs we want to remove
        remove_list = []
        remove_attrs = STRIP_ATTRS + STRIP_OP_ATTRS
        if self.args.mode != "prod-mode":
            remove_attrs += PROD_ATTRS
...
        # Walk the entry normalizing and marking attrs to remove as needed
        for attr in entry_attrs:
            if attr.lower() in remove_attrs:
                remove_list.append(attr)
                continue
... (doesn't apply filters because of continue)
        # Cleanup up entry attributes
        for remove_attr in remove_list:
            del entry_attrs[remove_attr]

Cloned from https://issues.redhat.com/browse/RHEL-147173


PR - https://github.com/freeipa/freeipa/pull/8165

Metadata Update from @dhanina:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/8165
- Custom field rhbz adjusted to https://issues.redhat.com/browse/RHEL-147173

master:

  • b2766a65740f2c3c5b78e4fcd808bfc19c74802c ipa-migrate: migrate ssh public keys for users and overrides

ipa-4-12:

  • c660da59d54a478943f9126b699347d8acbf60b6 ipa-migrate: migrate ssh public keys for users and overrides

ipa-4-13:

  • f236684691f0ce764aca4887d790f31906ea2044 ipa-migrate: migrate ssh public keys for users and overrides

Metadata Update from @rjeffman:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata Update from @frenaud:
- Custom field rhbz adjusted to https://issues.redhat.com/browse/RHEL-147173, https://issues.redhat.com/browse/RHEL-151560 (was: https://issues.redhat.com/browse/RHEL-147173)

Metadata