Bug 1251579 - ipa vault-add --user should set container owner equal to user on first run
ipa vault-add --user should set container owner equal to user on first run
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ipa (Show other bugs)
Unspecified Unspecified
medium Severity unspecified
: rc
: ---
Assigned To: IPA Maintainers
Namita Soman
Depends On:
  Show dependency treegraph
Reported: 2015-08-07 15:15 EDT by Scott Poore
Modified: 2015-11-19 07:05 EST (History)
3 users (show)

See Also:
Fixed In Version: ipa-4.2.0-5.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-11-19 07:05:09 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Scott Poore 2015-08-07 15:15:15 EDT
Description of problem:

Right now if you run vault-add --user=testuser as admin, the owner is set to admin.  I think it would be preferable to set this to the user from --user option.

Here is an example:

[root@master ~]# ipa vault-add new_test_vault --user=testuser
Added vault "new_test_vault"
  Vault name: new_test_vault
  Type: standard
  Owner users: admin

[root@master ~]# ldapsearch -xLLL -D 'cn=Directory Manager' -w Secret123 -b cn=users,cn=vaults,cn=kra,dc=testrelm,dc=test cn=testuser
dn: cn=testuser,cn=users,cn=vaults,cn=kra,dc=testrelm,dc=test
objectClass: ipaVaultContainer
objectClass: top
owner: uid=admin,cn=users,cn=accounts,dc=testrelm,dc=test
cn: testuser

This has the potential to cause problems described in the doc bug #1251576

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.  Install IPA Server (ipa-server-insipa-server-4.2.0-3.el7.x86_64
2.  Install KRA (ipa-kra-install)
3.  Add user
ipa user-add newuser 

4.  Add vault for user as admin
ipa vault-add testvault --user=newuser

Actual results:
Owner of new vault is admin

Expected results:
Owner of new vault should be newuser

Additional info:
Comment 2 Endi Sukma Dewata 2015-08-10 15:33:16 EDT
Clarification, the problem is with the vault container ownership, not the vault itself. A private vault container should be owned by the user/service (just like a home directory), but the vault itself should still be owned by the creator (just like a file). An admin may want to create an admin-owned vault for a user in which the user is only a member. If necessary later the admin can transfer the ownership to the user using the vault-add-owner command.

Upstream ticket:
Comment 3 Petr Vobornik 2015-08-10 17:06:39 EDT
Upstream ticket:
Comment 6 Scott Poore 2015-08-20 21:41:53 EDT

Version ::


Results ::

[root@master ipa]# ipa user-add newuser
First name: adsf
Last name: asdf
Added user "newuser"
  User login: newuser
  First name: adsf
  Last name: asdf
  Full name: adsf asdf
  Display name: adsf asdf
  Initials: aa
  Home directory: /home/newuser
  GECOS: adsf asdf
  Login shell: /bin/sh
  Kerberos principal: newuser@TESTRELM.TEST
  Email address: newuser@testrelm.test
  UID: 744800003
  GID: 744800003
  Password: False
  Member of groups: ipausers
  Kerberos keys available: False

[root@master ipa]# ipa-kra-install
Directory Manager password: 

This program will setup Dogtag KRA for the IPA Server.

Configuring KRA server (pki-tomcatd). Estimated time: 2 minutes 6 seconds
  [1/7]: configuring KRA instance
  [2/7]: add RA user to KRA agent group
  [3/7]: restarting KRA
  [4/7]: configure certmonger for renewals
  [5/7]: configure certificate renewals
  [6/7]: configure HTTP to proxy connections
  [7/7]: add vault container
Done configuring KRA server (pki-tomcatd).
Restarting the directory server
The ipa-kra-install command was successful

[root@master ipa]# ipa vault-add testvault --user=newuser
Added vault "testvault"
  Vault name: testvault
  Type: standard
  Owner users: admin
  Vault user: newuser

[root@master ipa]# ldapsearch -xLLL -D "cn=Directory Manager" -w Secret123 -b cn=users,cn=vaults,cn=kra,dc=testrelm,dc=test cn=newuser
dn: cn=newuser,cn=users,cn=vaults,cn=kra,dc=testrelm,dc=test
objectClass: ipaVaultContainer
objectClass: top
owner: uid=newuser,cn=users,cn=accounts,dc=testrelm,dc=test
cn: newuser
Comment 7 errata-xmlrpc 2015-11-19 07:05:09 EST
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.


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