RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1441884 - IPA missing definitions of Kerberos principal in CSR profiles in client code
Summary: IPA missing definitions of Kerberos principal in CSR profiles in client code
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: ipa
Version: 8.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: IPA Maintainers
QA Contact: ipa-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-13 01:07 UTC by Scott Poore
Modified: 2020-11-26 16:30 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-26 16:30:21 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Scott Poore 2017-04-13 01:07:22 UTC
Description of problem:

With the move to support PKINIT, certificates may need to be generated with Kerberos principal.  To do this, we should have a separate certprofile already in place to create user certificates (and maybe service ones?) with kerberos principal included in SAN.

Version-Release number of selected component (if applicable):
4.5.0-4.el7

How reproducible:
always

Steps to Reproduce:
1.  ipa certprofile-show <profile_for_users_with_kerberos_principals>

Actual results:
nothing listed

Expected results:
Shows the certificate profile for creating profiles including kerberos principal.

Additional info:

Comment 4 Alexander Bokovoy 2017-04-13 10:14:13 UTC
Unfortunately, description is wrong.

With FreeIPA 4.5 we have added CSR generator into 'ipa cert-request' flow. When no CSR is supplied but private key is provided either in PEM or NSS DB format, 'ipa cert-request' will attempt to fetch specified or default certificate profile and build CSR according to the profile.

If certificate profile allows to specify Kerberos principal, CSR generator would add this information into CSR. Unfortunatey, it does not add it now because CSR generator profile and rules on client side do not have specification for adding Kerberos principal as SAN OtherName.

Comment 5 Alexander Bokovoy 2017-04-13 10:14:51 UTC
Thus, the bug is in missing definitions of Kerberos principal in CSR profile/rules code.

Comment 6 Scott Poore 2017-04-13 12:33:39 UTC
Alexander,

Sorry, I misunderstood yesterday.  So the CSR profile you're talking about is not a certificate profile managed by the ipa certprofile commands?

Think I should modify the bug name to match what you send in comment #5?

Thanks,
Scott

Comment 7 Alexander Bokovoy 2017-04-13 13:30:29 UTC
Correct. CSR profile/rules/templates are defined in IPA client code: https://pagure.io/freeipa/blob/master/f/ipaclient/csrgen

Comment 8 Petr Vobornik 2017-04-28 13:14:27 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/6912

Comment 14 Alexander Bokovoy 2020-11-26 16:30:21 UTC
This bug is about csrgen component of IPA CLI that doesn't have Kerberos principal component in its own certificate profiles. The profiles here are different from the CA certificate profiles in IPA CA. This functionality is mostly unused because it is not documented and nobody knows about it.

If you look at the help for 'ipa cert-request', you can see that CSR file is optional. The idea was that on the client side, if CSR file was not specified, you can specify private key in NSS database or PEM file.

This is how the code looks in ipaclient/plugins/cert.py:

@register(override=True, no_fail=True)
class cert_request(CertRetrieveOverride):
     takes_options = CertRetrieveOverride.takes_options + (
         Str(
             'database?',
             label=_('Path to NSS database'),
             doc=_('Path to NSS database to use for private key'),
         ),
         Str(
             'private_key?',
             label=_('Path to private key file'),
             doc=_('Path to PEM file containing a private key'),
         ),
         Str(
             'password_file?',
             label=_(
                 'File containing a password for the private key or database'),
         ),
         Str(
             'csr_profile_id?',
             label=_('Name of CSR generation profile (if not the same as'
                     ' profile_id)'),
         ),
     )


However, something is broken and these options are not visible anymore:


$ ipa cert-request --help
Usage: ipa [global-options] cert-request [CSR-FILE] [options]

Submit a certificate signing request.
Options:
   -h, --help            show this help message and exit
   --profile-id=STR      Certificate Profile to use
   --ca=STR              Name of issuing CA
   --principal=PRINCIPAL
                         Principal for this certificate (e.g.
                         HTTP/test.example.com)
   --add                 automatically add the principal if it doesn't exist
                         (service principals only)
   --chain               Include certificate chain in output
   --all                 Retrieve and print all attributes from the server.
                         Affects command output.
   --raw                 Print entries as stored on the server. Only affects
                         output format.
   --certificate-out=FILE
                         Write certificate (chain if --chain used) to file

Not only they aren't visible, they cannot be specified as IPA CLI does not understand them:

$ ipa cert-request --password-file foo
Usage: ipa [global-options] cert-request [CSR-FILE] [options]

ipa: error: no such option: --password-file


This all means the functionality is not usable and not used by anyone in RHEL 7+.

I am closing this bug. For removal of csrgen we can open a different, upstream-only, bug.


Note You need to log in before you can comment on or make changes to this bug.