1password Brew
If you are an avid Amazon AWS user, you may have noticed that the AWS CLI command line tools nowadays support sourcing credentials from external processes. This feature can be combined with 1Password's command line tool, which allows you to query 1Password items using the op shell command.
On a Mac with homebrew, you can do brew install 1password-cli. Ability for forget arbitrary accounts, not just the one currently signed in; API mapping on to all of op's various commands and subcommands; API to get complete or partial JSON for an item; Unit testing. When the release has shipped and the blog post has been merged, tweet the blog post as the @MacHomebrew Twitter account or tweet it yourself and retweet it with the @MacHomebrew Twitter account (credentials are in 1Password). Consider whether to submit it to other sources e.g. Hacker News, Reddit. Pros: gets a wider reach and user feedback.
To check for updates to the 1Password command-line tool: op update If a newer version is available, the tool can download it for you. You can see a list of all commands with op -help, or learn about a specific command with op -help. Learn how to use the 1Password command-line tool. 1Password (armbrew) 何はともあれ 1Password です。色々なアプリに対して認証が必要になるので一番最初にインストールします。私は買取版のライセンスを利用しているため、cask でインストールします。 cask ' 1password '. Homebrew’s package index. Name: 1Password CLI Command-line helper for the 1Password password manager.
By moving the AWS credentials to 1Password, you will be able to delete your ~/.aws/credentials file, which is otherwise an attractive target for malware and other hacking attempts (but check the caveats section below before you do that).
Installation
First, install all the required software.
- Install the AWS CLI if you haven't already.
- Install the 1Password CLI tool.
- Install the jq tool, for instance using brew install jq on macOS.
Credential setup
Then, move your credentials from the local AWS credentials file to 1Password.
- Create a 1Password item to hold your AWS credentials. Use two custom fields to store the Access Key Id and Secret Access Key. In this example, the fields are named aws_access_key_id and aws_secret_access_key.
- Follow the 1Password instructions on how to perform the first sign-in using the op signin command, and how to sign in more easily after that (omitting the secret key).
- If you want to, remove the old credentials from ~/.aws/credentials.
Configuration
Next, add an entry that looks like this in your local ~/.aws/config file:
Make sure that Name Of Item matches the name you entered for the 1Password item, and that aws_access_key_id and aws_secret_access_key match the custom field names you used to store your Access Key Id and Secret Access Key. The above script assumes that they are in the first section. If you put them in a separate section, you may need to change the sections[0] clause to match it.
If you are on a platform that doesn't support the sh shell, you may neet to figure out how to perform a similar piping operation. Alternatively you could also create a separate script file somewhere, and move the complex script command line from ~/.aws/config to there.
Testing
Once the entry in ~/.aws/config is in place, you should be able to test the integration using AWS CLI:
If you see a valid-looking User JSON response that includes your AWS IAM UserId, UserName and Arn, congratulations, it's working properly. If you see an error, you may need to refresh your sign-in session first (op signin) and try again.
Caveats
When you remove your credentials from ~/.aws/credentials and use the credential_process
option instead, some third party tools that use AWS SDK may stop working. For instance, I have created an issue about this in the Serverless Framework project. It's not quite clear whether Amazon plans to support this automatically in all AWS SDK based apps, or whether it's intended to be an AWS CLI only feature.
Since Homebrew 1.0.0 most Homebrew users (those who haven’t run a dev-cmd
orset HOMEBREW_DEVELOPER=1
which is ~99.9% based on analytics data) require tagson the Homebrew/brew repositoryin order to get new versions of Homebrew. There are a few steps in making a newHomebrew release:
- Check the Homebrew/brew pull requests,issues,Homebrew/homebrew-core issues andHomebrew/discussions (forum) to see if there isanything pressing that needs to be fixed or merged before the next release.If so, fix and merge these changes.
- Ensure that no code changes have happened for at least a couple of hours (ideally 4 hours),at least one Homebrew/homebrew-core pull request CI job has completed successfully,checked the state of the Homebrew/brew
master
CI job (i.e. main jobs green or green after rerunning),and that you are confident there are no major regressions on the currentmaster
,branch. - Run
brew release
to create a new draft release. For major or minor version bumps,pass--major
or--minor
, respectively. - Publish the draft release on GitHub.
If this is a major or minor release (e.g. X.0.0 or X.Y.0) then there are a few more steps:
- Before creating the tag you should delete any
odisabled
code, make anyodeprecated
codeodisabled
, uncomment any# odeprecated
code and addany newodeprecations
that are desired. - Write up a release notes blog post to https://brew.she.g. brew.sh#319.This should use the output from
brew release [--major|--minor]
as input buthave the wording adjusted to be more human readable and explain not just what has changed but why. - When the release has shipped and the blog post has been merged, tweet theblog post as the @MacHomebrew Twitter accountor tweet it yourself and retweet it with the @MacHomebrew Twitter account(credentials are in 1Password).
- Consider whether to submit it to other sources e.g. Hacker News, Reddit.
- Pros: gets a wider reach and user feedback
- Cons: negative comments are common and people take this as a chance to complain about Homebrew (regardless of their usage)
1password Browser Chrome
Please do not manually create a release based on older commits on the master
branch.It’s very hard to judge whether these have been sufficiently tested by users or if they willcause negative side-effects with the current state of Homebrew/homebrew-core.If a new branch is needed ASAP but there are things on master
that cannot be released yet(e.g. new deprecations and you want to make a patch release) then revert the relevant PRs,follow the process above and then revert the reverted PRs to reapply them on master
.