GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - johnthethird/keymaster: TouchID access to Mac Keychain via CLI

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
LICENSE
LICENSE
 
 
README.md
README.md
 
 
keymaster.swift
keymaster.swift
 
 

Repository files navigation

Keymaster

Keymaster is a small binary written in Swift that allows scripts to access the Mac Keychain guarded by TouchID.

Macs come with the security command which can get and set secrets to the Keychain:

# Save a key/value to the default "login" keychain, with key "MyKeyName", update if exists (-U), 
# allow no app to access without a prompt (-T ""), and prompt for secret to store (-w)
security add-generic-password -a login -s "MyKeyName" -T "" -U -w

# Get the secret value from a key
security find-generic-password -s "MyKeyName" -w

You can use security in a script, but (AFAIK) you can't tell it to use biometrics to guard secrets, you have to enter the password each time, or "always allow" the security binary to access the secret.

🔑 Keymaster fixes this.

Building Keymaster

Compile the keymaster.swift into a binary:

swiftc keymaster.swift

Put the binary somewhere in your path.

Save a secret to the keychain

keymaster set MyKeyName MySecret

Retrieve a secret

keymaster get MyKeyName

The first time you get the secret, you should "always allow" the keymaster binary. Upon subsequent accesses, you will always be prompted for TouchID in order to access the secret.

To change the secret, you can use the Keychain Access.app that comes with your Mac.

You can use keymaster in bash scripts or Automator Workflows, or wherever you need secure access to a secret.

About

TouchID access to Mac Keychain via CLI

Topics

clitouchid

Resources

Readme
MIT license
Activity

Stars

36 stars

Watchers

1 watching

Forks

23 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.