Bug 1253458 - ipa vault-add creates user vault with non-existent user
ipa vault-add creates user vault with non-existent user
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ipa (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: IPA Maintainers
Namita Soman
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2015-08-13 13:51 EDT by Scott Poore
Modified: 2016-02-15 12:54 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-02-15 12:54:12 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-13 13:51:56 EDT
Description of problem:
[root@master ~]# ipa vault-add vname --user=user_dne
Added vault "vname"
  Vault name: vname
  Type: standard
  Owner users: admin

[root@master ~]# ipa vault-show vname --user=user_dne
  Vault name: vname
  Type: standard
  Owner users: admin

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

How reproducible:

Steps to Reproduce:
1.  ipa-server-install
2.  ipa-kra-install
3.  kinit admin
4.  ipa vault-add vname --user=user_dne

Actual results:
adds vault

Expected results:
should not add vault if user doesn't exist

Additional info:
Comment 2 Scott Poore 2015-08-13 21:13:49 EDT
Upstream ticket:
Comment 3 Petr Vobornik 2015-08-26 12:56:18 EDT
Was discussed offline and was decided that creating a vault for non-existent user/service is a valid use-case.
Comment 4 Scott Poore 2015-09-08 11:33:03 EDT
Reopening this bug for either more detailed clarification of why adding a non-existent user is valid or to get this resolved.

IMHO, we should not add a user vault until after the user is added.

Comment 5 Petr Vobornik 2015-12-15 06:29:37 EST
The reason is consistency with delete operation. Vault is not deleted when user is deleted to preserve secrets. So the state can be achieved even if it is not permitted.

Maybe the add operation can print a warning that the user|service doesn't exist, e.g. to solve "typo" mistakes.
Comment 6 Scott Poore 2015-12-17 10:07:24 EST
A warning on add would be good but, is it possible instead to add a warning on user-del?  To me it seems better to error on vault-add and show a warning on user-del (if possible) that the vaults and containers must be manually removed.  This would prevent adding an initial orphan and/or prevent adding new ones for already deleted users.
Comment 7 Petr Vobornik 2016-02-15 12:54:12 EST
I've opened https://fedorahosted.org/freeipa/ticket/5674 to reflect comment 6. 

It will be resolved according to the triage.

Since the proposal will be resolved elsewhere I'm closing this bug again.

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