Bug 1253458

Summary: ipa vault-add creates user vault with non-existent user
Product: Red Hat Enterprise Linux 7 Reporter: Scott Poore <spoore>
Component: ipaAssignee: IPA Maintainers <ipa-maint>
Status: CLOSED NOTABUG QA Contact: Namita Soman <nsoman>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: pvoborni, rcritten
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-15 17:54:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Scott Poore 2015-08-13 17:51:56 UTC
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):
ipa-server-4.2.0-4.el7.x86_64

How reproducible:
always

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-14 01:13:49 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/5216

Comment 3 Petr Vobornik 2015-08-26 16:56:18 UTC
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 15:33:03 UTC
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.


Thanks,
Scott

Comment 5 Petr Vobornik 2015-12-15 11:29:37 UTC
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 15:07:24 UTC
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 17:54:12 UTC
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.