Bug 1339129 - ipa vault-archive overwrites an existing value without warning
Summary: ipa vault-archive overwrites an existing value without warning
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: Kaleem
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-24 08:33 UTC by Marc Muehlfeld
Modified: 2018-10-30 10:56 UTC (History)
7 users (show)

Fixed In Version: ipa-4.6.4-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 10:55:57 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3187 0 None None None 2018-10-30 10:56:33 UTC

Description Marc Muehlfeld 2016-05-24 08:33:17 UTC
Description of problem:
The "ipa vault-archive" command overwrites an existing value without any warning.



Version-Release number of selected component (if applicable):
ipa-admintools-4.2.0-15.el7_2.15.x86_64


How reproducible:
Always.



Steps to Reproduce:
1. Add a value to a vault:
   # ipa vault-archive my-first-vault --data AbcD3fg8
   -----------------------------------------
   Archived data into vault "my-first-vault"
   -----------------------------------------

2. Verify that the value was stored in the vault:
   # ipa vault-retrieve my-first-vault
   ------------------------------------------
   Retrieved data from vault "my-first-vault"
   ------------------------------------------
     Data: AbcD3fg8

3. Re-run the "ipa vault-archive" with a different value for --data:
   # ipa vault-archive my-first-vault --data dmVyeSBzZWNyZXQ=
   -----------------------------------------
   Archived data into vault "my-first-vault"
   -----------------------------------------

4. Verify what's in the vault:
   # ipa vault-retrieve my-first-vault
   ------------------------------------------
   Retrieved data from vault "my-first-vault"
   ------------------------------------------
     Data: dmVyeSBzZWNyZXQ=



Actual results:
Existing data in the vault is overwritten without any notice.


Expected results:
If there is already data in the vault, the user should be notified or ask for confirmation before overwriting.

Comment 2 Petr Vobornik 2016-06-01 14:55:38 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/5922

Comment 3 Petr Vobornik 2016-06-01 14:59:40 UTC
Current behavior is consistent with other IPA commands. None of ipa mod commands asks for confirmation and therefore it should be the same here.

But it may not be clear that vault can contain only one value. So this behavior can be documented better - both in vault help and Linux Identity and Management guide.

Comment 4 Aneta Šteflová Petrová 2016-06-06 07:28:06 UTC
I agree that with mod commands, it's not necessary to have a warning. Whenever someone is modifying something, they should expect that something to be changed or replaced.

However, from my understanding of the RFE, the purpose of "ipa vault-archive" is to save data (not to change it). So as a user, I wouldn't expect anything to be rewritten -- that's why I agree with Marc that a request for confirmation would be nice.

Comment 7 Florence Blanc-Renaud 2018-05-22 15:05:22 UTC
Fixed upstream
master:
https://pagure.io/freeipa/c/e06c7566fdc540734eb62eb2ff1d149a6378e97a

Comment 8 Florence Blanc-Renaud 2018-05-23 07:29:19 UTC
Fixed upstream
ipa-4-6:
https://pagure.io/freeipa/c/9864ea2313978de7a6e6333b611390a7d2320338

Comment 11 Sudhir Menon 2018-08-07 09:52:42 UTC
Fix is seen in the "ipa vault help" 
Verified on Red Hat Enterprise Linux Server release 7.6 Beta (Maipo)  using

ipa-server-4.6.4-3.el7.x86_64
sssd-1.16.2-11.el7.x86_64
389-ds-base-1.3.8.4-9.el7.x86_64
krb5-server-1.15.1-34.el7.x86_64
pki-server-10.5.9-4.el7.noarch
selinux-policy-3.13.1-211.el7.noarch


[root@master]# ipa-kra-install 
The ipa-kra-install command was successful

[root@master yubico]# ipa vault-add
Vault name: my-first-vault
New password: 
Enter New password again to verify: 
----------------------------
Added vault "my-first-vault"
----------------------------
  Vault name: my-first-vault
  Type: symmetric
  Salt: 8eIXcphEJ1mlXil/iI/jgw==
  Owner users: admin
  Vault user: admin
[root@master yubico]# ipa vault-archive my-first-vault --data AbcD3fg8
Password: 
-----------------------------------------
Archived data into vault "my-first-vault"
-----------------------------------------
[root@master yubico]# ipa vault-retrieve my-first-vault
Password: 
------------------------------------------
Retrieved data from vault "my-first-vault"
------------------------------------------
  Data: AbcD3fg8
[root@master yubico]# ipa vault-archive my-first-vault --data dmVyeSBzZWNyZXQ=
Password: 
-----------------------------------------
Archived data into vault "my-first-vault"
-----------------------------------------

[root@master ~]# ipa help vault
Vaults
Manage vaults.

Vault is a secure place to store a secret. One vault can only
store one secret. When archiving a secret in a vault, the
existing secret (if any) is overwritten.

Comment 13 errata-xmlrpc 2018-10-30 10:55:57 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://access.redhat.com/errata/RHBA-2018:3187


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