Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
Former Member
5 years agoCommand-line tool v1.12.2: op create item --template=file.json
We have added a new, smoother, more secure method of creating an item using the command-line tool!
Get a template for the category of item you want to create, and save
it to a file:op get template "Login" > file.jsonEdit the template to add your information.
Create the item from the template file:
op create item "Login" --template=file.jsonWhen you’re finished, remove the template file.
You no longer need to use op encode, which is now officially deprecated and will be removed in our next major release.
https://app-updates.agilebits.com/product_history/CLI#v1120201
1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
3 Replies
- jscarleOccasional Contributor
See, there's my issue with that. Creating a temporary file leaves traces in the file system that could be recovered (undeleted) and would effectively compromise security.
What about allowing input of the template through stdin in a similar way to the
create documentcommand? - Former Member
jscarle We are not removing any functionality in the v1 releases. Any breaking changes to the command-line tool’s inputs would be done in a v2 release.
Passing your about-to-be-created vault item details to
opas a command-line argument is insecure on a multi-user system or on a system where untrusted processes are running. It is possible for other users or processes to see the arguments that are passed to any program, which means that they would be able to see your vault item details for the window thatop create itemis running. We want to make it hard for users to be insecure when using 1Password, so we are encouraging users to start using the--templateflag instead.For your .NET wrapper, may I suggest creating a temporary file that only the current user can access, writing that JSON template to it (no need to base64-encode it), and then removing it after the
create itemcommand finishes. - jscarleOccasional Contributor
I am not using op encode directly, but I do create an item based on a template as follows:
string command = $"create item \"{template.Name}\" \"{template.Details.ToBase64()}\"";
See: https://github.com/jscarle/OnePassword.NET/blob/master/OnePassword.NET/OnePasswordManager.cs#L110
Are you saying that you're removing the entire Base64 command line functionality?