Giter Site home page Giter Site logo

1poshword's Introduction

1Poshword

PowerShell client for 1Password

demo

  • Cross-platform (Windows/OSX/Linux, PowerShell v4.0+)
  • agilekeychain and opvault support
  • Login, Password, Secure Note, and Generic Account decryption
  • Metadata for all entries
  • Tab completion (agilekeychain only)
  • Output formats
    • PSCredential
    • SecureString
    • Plaintext
    • Clipboard
  • Complete Get-Help documentation

Quickstart

Install from the PowerShell Gallery (Windows-only, PS v5+):

PS> Install-Module -Name 1Poshword

Direct download:

'1Poshword.psd1','1Poshword.psm1','lib.ps1','pbkdf2.cs' |% {
    Invoke-WebRequest https://raw.githubusercontent.com/latkin/1poshword/master/$_ -OutFile ./$_
}

Import-Module ./1Poshword.psd1

Get-1PEntry

Lists 1Password entries. Alias g1p.

PS> g1p

Name               Type       LastUpdated          Location
----               ----       -----------          --------
Twitter            Login      11/29/15 11:53:44 PM https://twitter.com/
Github             Login      11/29/15 11:58:12 PM https://github.com/login
Gmail - Personal   Login      11/30/15 12:11:50 AM https://accounts.google.com/ServiceLogin
Gmail - Work       Login      2/8/16 4:23:38 PM    https://accounts.google.com/ServiceLogin
SSH                Password   2/10/16 1:30:34 PM
Gmail Backup Codes SecureNote 6/8/16 8:41:44 AM
...

Details

PS> g1p twitter | fl *

Name          : Twitter
Id            : E61537A747044159BE8F2A412614C83F
VaultPath     : /Users/lincoln/Dropbox/1Password/1Password.agilekeychain
SecurityLevel : SL5
KeyId         : 
KeyData       : 
Location      : https://twitter.com/
Type          : Login
CreatedAt     : 10/27/15 8:53:36 PM
LastUpdated   : 11/29/15 11:53:44 PM
EncryptedData : U2FsdGVkX198K5razrhlihDvUrIC2FTp29PcqQpmO48MApG758vljLe+z...

Unprotect-1PEntry

Derypts a particular 1Password entry to a variety of formats. Alias 1p.

Add flag -PasswordOnly (alias -po) to output only an entry's password field.

(Yes, "unprotect" is weird, but that's the approved verb for decryption so we're going with it.)

Output Note
PSCredential Default for
  • Login
  • Generic Account
PS> 1p twitter
1Password vault password: ***************

UserName Password


LincolnAtkinson System.Security.SecureString

SecureString Default for
  • Secure Note
  • Password
PS> 1p ssh
1Password vault password: ***************

System.Security.SecureString

Plaintext
PS> 1p github -plain
1Password vault password: ***************

latkin p@ssw0rd1

Clipboard
PS> 1p 'Gmail - Personal' -clip
1Password vault password: ***************

Tips

Password-only output
# output password as SecureString
PS> 1p twitter -po

output password as plaintext

PS> 1p twitter -plain -po

copy password to clipboard

PS> 1p twitter -clip -po

Custom vault path
# at import
PS> Import-Module 1Poshword.psd1 -args <.agilekeychain or .opvault path>

per-command

PS> 1p entryname -VaultPath <.agilekeychain or .opvault path>

change default

PS> Set-1PDefaultVaultPath <.agilekeychain or .opvault path>

Specify password programmatically
PS> $p = Read-Host -AsSecureString 'Speak, friend, and enter'
Speak, friend, and enter: ***************

PS> 1p github $p -plain

latkin p@ssw0rd1

Piping
PS> g1p twitter | 1p
"Reveal" behavior
PS> 1p 'gmail backup codes' -plain | less

Thanks

1Pass, as the original inspiration for this. The first draft of 1Poshword was mostly just a transcription of 1Pass.

Medo, for the C# Pbkdf2-with-arbitrary-HMAC implementation.

AgileBits, for the excellent docs describing the opvault data format.

This project is not supported or endorsed by AgileBits. "1Password" is a registered trademark of Agile Web Solutions, Inc.

1poshword's People

Contributors

latkin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

johnjohnsp1

1poshword's Issues

Should check entry type before requesting master password

Ideally we should not prompt for the master password unless other args have successfully validated.

That is currently the case for checking if the requested entry exists and is unique, but is not the case for checking that the requested entry has an appropriate type given the other arguments (e.g. AsCredential for a Secure Note)

Add items (logons) to vault

Thanks for this project! I love the idea of being able to easily create a PSCredential from a logon. Have you looked into the difficulty of adding items, particularly logons, to a vault?

Fixes to support Mac/Linux

Code is written to support Powershell Core, however some things won't work correctly on Mac/Linux.

Known issues:

  • Default dropbox\1password directory is wrong
  • Paths all use Windows-style backslash
  • Does clipboard stuff work?

Better output format picking system

-OutputFormat PSCredential or -OutputFormat PasswordOnly is pretty verbose.

Proposed new system: switches -AsCredential, -PasswordOnly, etc

Update README

Need to fill out the README with more complete description, examples, etc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.