#7503 multiple occurrences of profileId in certprofile causes incorrect behaviour
Closed: fixed 6 years ago Opened 6 years ago by ftweedal.

Issue

In certprofile-import if the config file contains two profileId directives with different
values, the profile can be imported under an incorrect ID.

e.g. if profile config contains:

profileId=test1
profileId=test2

And you import the profile into FreeIPA as test1, i.e. ipa certprofile-import test1 ...,
then the profile will be imported into Dogtag as test2. The actual certprofile-import operation fails:

# ipa certprofile-import test1 --file test1.cfg --store 1 --desc test1
ipa: ERROR: Request failed with status 500: Non-2xx response from CA REST API: 500. 

And no IPA entry for the profile has been created (either as test1 or test2):

# ipa certprofile-show test1
ipa: ERROR: test1: Certificate Profile not found
# ipa certprofile-show test2
ipa: ERROR: test2: Certificate Profile not found

But the profile HAS been imported into Dogtag, as test2

# ldapsearch -D cn=directory\ manager -w secret123 -b 'ou=certificateProfiles,ou=ca,o=ipaca' 1.1 |grep test
# test2, certificateProfiles, ca, ipaca
dn: cn=test2,ou=certificateProfiles,ou=ca,o=ipaca

A subsequent attempt to issue a cert using profile test1 fails:

# ipa cert-request --principal alice --profile test1 alice.csr                                                   
ipa: ERROR: Request failed with status 400: Non-2xx response from CA REST API: 400. Profile test1 Not Found

This operation against Dogtag should probably not even have been attempted, since no
IPA object for the profile was created.

Similarly, attempting to issue using test2 also fails, because that profile has not been
enabled yet:

# ipa cert-request --principal alice --profile test2 alice.csr                                                   
ipa: ERROR: Request failed with status 400: Non-2xx response from CA REST API: 400. Profile test2 not enabled

And again, it should probably not have even been attempted.

Expected behavior

The presense of two profileId directives in the profile configuration should be detected by FreeIPA, and the configuration rejected.


Metadata Update from @ftweedal:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/1830

6 years ago

master:

  • a7b1837 certprofile: reject config with multiple profileIds
  • 0f85933 certprofile: add tests for config profileId scenarios

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

6 years ago

ipa-4-6:

  • 1a6acd5 certprofile: reject config with multiple profileIds
  • 5fb3475 certprofile: add tests for config profileId scenarios

Metadata Update from @pvoborni:
- Issue set to the milestone: FreeIPA 4.6.4

6 years ago

Login to comment on this ticket.

Metadata