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 1250093 - ipa certprofile-import accepts invalid config
Summary: ipa certprofile-import accepts invalid config
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ipa
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: IPA Maintainers
QA Contact: Namita Soman
URL:
Whiteboard:
Depends On: 1253045
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-04 13:46 UTC by Scott Poore
Modified: 2015-11-19 12:04 UTC (History)
4 users (show)

Fixed In Version: ipa-4.2.0-5.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 12:04:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2362 0 normal SHIPPED_LIVE ipa bug fix and enhancement update 2015-11-19 10:40:46 UTC

Description Scott Poore 2015-08-04 13:46:06 UTC
Description of problem:

ipa certprofile-import is accepting configs with invalid settings.

[root@master ~]# cp /usr/share/ipa/profiles/caIPAserviceCert.cfg /tmp/bad_profile.cfg
[root@master ~]# sed -i 's/profileId=.*$/profileId=bad_profile/' /tmp/bad_profile.cfg
[root@master ~]# sed -i 's/desc=.*$/desc=My Bad Profile/' /tmp/bad_profile.cfg 
[root@master ~]# sed -i 's/^name=.*$/name=bad_profile/' /tmp/bad_profile.cfg 
[root@master ~]# ipa certprofile-import bad_profile --file=/tmp/bad_profile.cfg --store=False --desc="Bad Profile"
------------------------------
Imported profile "bad_profile"
------------------------------
  Profile ID: bad_profile
  Profile description: Bad Profile
  Store issued certificates: FALSE


This should fail or throw warnings at least since the ipa profile one copied above has variables and not filled in values.

Version-Release number of selected component (if applicable):
ipa-server-4.2.0-3.el7.x86_64
pki-ca-10.2.5-4.el7.noarch

How reproducible:
always

Steps to Reproduce:
1.  Install IPA 4.2 or above.
2.  Prepare invalid config:

cp /usr/share/ipa/profiles/caIPAserviceCert.cfg /tmp/bad_profile.cfg
sed -i 's/profileId=.*$/profileId=bad_profile/' /tmp/bad_profile.cfg
sed -i 's/desc=.*$/desc=My Bad Profile/' /tmp/bad_profile.cfg
sed -i 's/^name=.*$/name=bad_profile/' /tmp/bad_profile.cfg

3.  import bad config:

ipa certprofile-import bad_profile --file=/tmp/bad_profile.cfg --store=False --desc="Bad Profile"

Actual results:

imports

Expected results:

should fail with warning about config file 

Additional info:

Comment 2 Fraser Tweedale 2015-08-05 04:36:01 UTC
This issue is fixed in Dogtag 10.2.6.

Upstream ticket: https://fedorahosted.org/pki/ticket/1462

Comment 3 Jan Cholasta 2015-08-05 05:24:25 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/5140

Comment 6 Scott Poore 2015-08-20 16:35:21 UTC
I'm not seeing pki 10.2.6 installed on RHEL7.2 box with ipa 4.2.0-5:

[root@master log]# rpm -q ipa-server pki-ca
ipa-server-4.2.0-5.el7.x86_64
pki-ca-10.2.5-5.el7.noarch

And I'm still seeing the bad profile imported:

[root@master ~]# cp /usr/share/ipa/profiles/caIPAserviceCert.cfg /tmp/bad_profile.cfg
[root@master ~]# sed -i 's/profileId=.*$/profileId=bad_profile/' /tmp/bad_profile.cfg
[root@master ~]# sed -i 's/desc=.*$/desc=My Bad Profile/' /tmp/bad_profile.cfg 
[root@master ~]# sed -i 's/^name=.*$/name=bad_profile/' /tmp/bad_profile.cfg 
[root@master ~]# ipa certprofile-import bad_profile --file=/tmp/bad_profile.cfg --store=False --desc="Bad Profile"
------------------------------
Imported profile "bad_profile"
------------------------------
  Profile ID: bad_profile
  Profile description: Bad Profile
  Store issued certificates: FALSE

Is this correct?

Comment 7 Jan Cholasta 2015-08-21 06:14:55 UTC
pki-core-10.2.5-5.el7 is the correct pki-core version, but it does not contain the fix. My bad, let me sort it out.

Comment 8 Fraser Tweedale 2015-08-21 07:16:35 UTC
Also note that there are some "bad" profiles whose badness cannot be detected on import, e.g. if there are interpolations that reference nonexistant data.
There are many possible errors that will not be detected at import time,
but will cause certificate issuance to fail.  The default profile template may
be one such case of this.

Only blatant syntax errors and certain bogus configuration will be detected
at import time.

Comment 9 Scott Poore 2015-08-28 01:23:55 UTC
Verified.

Version ::

ipa-server-4.2.0-8.el7.x86_64

Results ::

[root@master ~]# ipa certprofile-show caIPAserviceCert --out=/tmp/default_profile.cfg
---------------------------------------------------------------
Profile configuration stored in file '/tmp/default_profile.cfg'
---------------------------------------------------------------
  Profile ID: caIPAserviceCert
  Profile description: Standard profile for network services
  Store issued certificates: TRUE

[root@master ~]# cp /tmp/default_profile.cfg /tmp/profile_unknown_classid.cfg

[root@master ~]# cp /tmp/default_profile.cfg /tmp/profile_invalid_list_value.cfg

[root@master ~]# vi /tmp/profile_unknown_classid.cfg

[root@master ~]# vim /tmp/profile_invalid_list_value.cfg


[root@master ~]# diff /tmp/default_profile.cfg /tmp/profile_unknown_classid.cfg
6c6
< input.i1.class_id=certReqInputImpl
---
> input.i1.class_id=certReqInputImplInvalid
108d107
< profileId=caIPAserviceCert


[root@master ~]# diff /tmp/default_profile.cfg /tmp/profile_invalid_list_value.cfg
107,108c107
< policyset.serverCertSet.list=1,2,3,4,5,6,7,8,9,10,11
< profileId=caIPAserviceCert
---
> policyset.serverCertSet.list=1,2,3,4,5,6,7,8,9,10,11,99


[root@master ~]# ipa certprofile-import --store=False --desc=desc profile_unknown_classid --file=/tmp/profile_unknown_classid.cfg 
ipa: ERROR: Non-2xx response from CA REST API: 400 Bad Request. Invalid profile data

[root@master ~]# ipa certprofile-import profile_invalid_list_value --store=False --desc=desc --file=/tmp/profile_invalid_list_value.cfg
ipa: ERROR: Non-2xx response from CA REST API: 400 Bad Request. Invalid profile data

Comment 10 errata-xmlrpc 2015-11-19 12:04:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2362.html


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