Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 GA Release 🎉🎉 #163

Merged
merged 54 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
d9ccd92
README driven design
monde Sep 8, 2023
def5838
Merge pull request #132 from okta/design_by_readme
MikeMondragon-okta Sep 18, 2023
8d5ddbd
Refactor to subcommands: web, m2m, debug. Stub out m2m subcommand.
monde Sep 22, 2023
ac0924f
`make qc` -> QC'd the code.
monde Sep 22, 2023
c5b3324
Merge pull request #138 from okta/m2m_subcommands
MikeMondragon-okta Sep 22, 2023
b5e01de
M2M auth access token request
monde Sep 22, 2023
c500fb4
Session token is better described as a domain of Web SSO authentication.
monde Sep 27, 2023
f41d14c
VCR tests for websso is classic org, device auth, and access token re…
monde Sep 27, 2023
2cb8ac6
Merge pull request #139 from okta/m2m_access_token
MikeMondragon-okta Sep 27, 2023
371ab63
Fetching IAM creds with assume role with web identity.
monde Sep 28, 2023
4d25572
Disable cobra's default completion command.
monde Sep 28, 2023
a495d95
MVP for v2.0.0-beta.0, which is Custom Authz Server Oriented
monde Sep 28, 2023
cd11cf2
Also works with the "default" authorization server.
monde Sep 29, 2023
5ab08d1
qc
monde Sep 29, 2023
34dfdc0
Tidy up tests
monde Sep 29, 2023
3e94594
Update release.yml to allow builds off m2m_feature branch
monde Sep 29, 2023
ab270ee
Merge pull request #140 from okta/m2m_sts_assume_role
MikeMondragon-okta Sep 29, 2023
feb2742
clean up instructions
monde Sep 29, 2023
88ac9f5
Adjust CHANGELOG notes
monde Sep 29, 2023
5dbf79f
Adjust User-Agent values/calculation
monde Sep 29, 2023
772dd94
AWS CLI Process credential provider JSON output. Feature request
monde Oct 2, 2023
ff7650f
Stop flogging those requesting support for non-standard options that
monde Oct 2, 2023
1269a4b
Merge pull request #143 from okta/m2m_process_credentials
MikeMondragon-okta Oct 2, 2023
9722e54
Add 'exec' subcommand to avoid writing credentials to disk or injecting
monde Oct 5, 2023
36c0373
Writing the aws creds file became broken with all the other v2 work.
monde Oct 5, 2023
f6ddcaa
Merge pull request #144 from okta/m2m_exec_from_command
MikeMondragon-okta Oct 5, 2023
47a50b2
bump version
monde Oct 5, 2023
59ce79f
Silently support old ENV VAR names/values for `OKTA_ORG_DOMAIN`,
monde Oct 9, 2023
0f0fa1a
For `web` command gather all roles for an IdP such that they can all be
monde Oct 10, 2023
914ae1b
Update docs
monde Oct 11, 2023
2915994
Merge pull request #146 from okta/m2m_collect_all_idps_and_roles
monde Oct 11, 2023
b382cf4
Prep 2.0.0-beta.3 release
monde Oct 11, 2023
6050a83
Factor out Credential interface and pass around a CredentialContainer.
monde Oct 11, 2023
87e2ce0
Improve All Profiles implementation.
monde Oct 12, 2023
cc51343
Customized open browser command.
monde Oct 12, 2023
f69f202
qc'd!
monde Oct 12, 2023
4272e84
bump go version in GH actions
monde Oct 12, 2023
30d97ee
Merge pull request #147 from okta/m2m_alt_open_browser
monde Oct 12, 2023
09e43ea
ARN values used for friendly labels can be regular expressions.
monde Oct 13, 2023
1477487
Merge pull request #148 from okta/m2m_wildcard_friendly_labels
monde Oct 13, 2023
41a1b8b
formatting
monde Oct 17, 2023
c207ba2
fix(cli): allow running --version without a subcommand
malept Oct 27, 2023
2e98960
Merge pull request #150 from getoutreach/malept/fix/root-version
monde Oct 30, 2023
3561c6f
Fix error when flawed okta.yaml can cause a panic if error not checked.
monde Nov 2, 2023
1990996
Add `--private-key-file` arg for m2m to designate a file to read the …
monde Nov 2, 2023
a10827b
Prep v2.0.0-beta.6 release
monde Nov 2, 2023
589ad31
Merge pull request #152 from okta/fix_nil_prompt_for_idp
monde Nov 2, 2023
e74230c
Update README.md
monde Nov 21, 2023
b573dc7
Don't swallow the whole open browser command error
monde Jan 24, 2024
6d8f939
prep v2 GA release
monde Jan 25, 2024
a5afaa5
go mod tidy
monde Jan 25, 2024
4499d74
Merge branch 'master' into m2m_feature
monde Jan 25, 2024
c9fb912
Yell that m2m is not for human use.
monde Jan 25, 2024
b1d1e62
go mod tidy
monde Jan 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OKTA_ORG_DOMAIN=
OKTA_OIDC_CLIENT_ID=
OKTA_AWS_ACCOUNT_FEDERATION_APP_ID=
OKTA_AWSCLI_ORG_DOMAIN=
OKTA_AWSCLI_OIDC_CLIENT_ID=
OKTA_AWSCLI_AWS_ACCOUNT_FEDERATION_APP_ID=
OKTA_AWSCLI_IAM_IDP=
OKTA_AWSCLI_IAM_ROLE=
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568
with:
go-version: 1.19
go-version: 1.21

- name: Setup Go Tools
run: make tools
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 #v3.5.0
with:
go-version: 1.19
go-version: 1.21
-
name: Import GPG key
id: import_gpg
Expand Down
193 changes: 193 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,198 @@
# Changelog

## 2.0.0 (January 25, 2024)

V2 GA Release 🎉🎉

### New commands

`okta-aws-cli`'s functions are encapsulated as (sub)commands e.g. `$ okta-aws-cli [sub-command]`

| Command | Description |
|-----|-----|
| `web` | Human oriented retrieval of temporary IAM credentials through Okta authentication and device authorization. Note: if `okta-aws-cli` is not given a command it defaults to this original `web` command. |
| `m2m` | Machine/headless oriented retrieval of temporary IAM credentials through Okta authentication with a private key. |
| `debug` | Debug okta.yaml config file and exit. |

### Environment variable name changes

A small number of environment variable names have been renamed to be consistent
in the naming convention for `okta-aws-cli` specific names.

| old name | new name |
|----------|----------|
| `OKTA_ORG_DOMAIN` | `OKTA_AWSCLI_ORG_DOMAIN` |
| `OKTA_OIDC_CLIENT_ID` | `OKTA_AWSCLI_OIDC_CLIENT_ID` |
| `OKTA_AWS_ACCOUNT_FEDERATION_APP_ID` | `OKTA_AWSCLI_AWS_ACCOUNT_FEDERATION_APP_ID` |

### Process credential provider output as JSON

Emits IAM temporary credentials as JSON in [process
credentials](https://docs.aws.amazon.com/sdkref/latest/guide/feature-process-credentials.html)
format.

```
# In $/.aws/config
[default]
# presumes OKTA_AWSCLI_* env vars are set
credential_process = okta-aws-cli m2m --format process-credentials
```

### Execute follow-on command

Instead of scripting and/or eval'ing `okta-aws-cli` into a shell and then
running another command have `okta-aws-cli` run the command directly passing
along the IAM credentials as environment variables.

```
# CLI exec's anything after the double dash "--" arguments terminator as another command.
$ okta-aws-cli web \
--org-domain test.okta.com \
--oidc-client-id 0oa5wyqjk6Wm148fE1d7 \
--exec -- aws ec2 describe-instances
```

### Collect all roles for all AWS Fed Apps (IdP) at once

`okta-aws-cli web` will collect all available AWS IAM Roles for all Okta AWS
Federation apps (IdP) at once. This is a feature specific to writing the
`$HOME/.aws/credentials` file. Roles will be AWS account alias name (if STS list
aliases is available on the given role) then `-` then abbreviated role name.


```
# AWS account alias "myorg", given IdP associated with "AWS Account Federation"
# and an app associated with two roles.

$ okta-aws-cli web \
--org-domain test.okta.com \
--oidc-client-id 0oa5wyqjk6Wm148fE1d7 \
--write-aws-credentials \
--all-profiles

Web browser will open the following URL to begin Okta device authorization for the AWS CLI

https://test.okta.com/activate?user_code=QHDMVQTZ

Updated profile "devorg-idp1-role1" in credentials file "/Users/me/.aws/credentials".
Updated profile "devorg-idp1-role2" in credentials file "/Users/me/.aws/credentials".
Updated profile "devorg-idp2-role1" in credentials file "/Users/me/.aws/credentials".
Updated profile "prodorg-idp1-role1" in credentials file "/Users/me/.aws/credentials".
```

### Alternate web browser open command

The `web` command will open the system's default web browser when the
`--open-browser` flag is present. It is convenient to have the browser open on a
separate profile. If the command to open the browser is known for the host
system an alternate open command can be specified.

```
# Use macOS open to open browser in Chrome incognito mode
$ okta-aws-cli web \
--org-domain test.okta.com \
--oidc-client-id 0oa5wyqjk6Wm148fE1d7 \
--open-browser-command "open -na \"Google\ Chrome\" --args --incognito"
```

```
# Open browser in Chrome "Profile 1" on macOS calling the Chrome executable directly
$ okta-aws-cli web \
--org-domain test.okta.com \
--oidc-client-id 0oa5wyqjk6Wm148fE1d7 \
--open-browser-command "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --profile-directory=\"Profile\ 1\""
```

Windows examples
```
> okta-aws-cli web \
--oidc-client-id abc \
--org-domain test.okta.com \
--open-browser-command "cmd.exe /C start msedge"

> okta-aws-cli web \
--oidc-client-id abc \
--org-domain test.okta.com \
--open-browser-command "cmd.exe /C start chrome"

> okta-aws-cli web \
--oidc-client-id abc \
--org-domain test.okta.com \
--open-browser-command "cmd.exe /C start chrome --incognito"

> okta-aws-cli web \
--oidc-client-id abc \
--org-domain test.okta.com \
--open-browser-command "cmd.exe /C start chrome --profile-directory=\"Profile\ 1\""
```

### Friendly label matching with regular expressions

Friendly label matching for IdPs and Roles with `$HOME/.okta/okta.yaml` file can
be regular expressions.

Example: your organization uses the same role naming convention across many
different AWS accounts:

```yaml
---
awscli:
idps:
"arn:aws:iam::123456789012:saml-provider/company-okta-idp": "Data Production"
"arn:aws:iam::012345678901:saml-provider/company-okta-idp": "Data Development"
"arn:aws:iam::901234567890:saml-provider/company-okta-idp": "Marketing Production"
"arn:aws:iam::890123456789:saml-provider/company-okta-idp": "Marketing Development"
roles:
"arn:aws:iam::.*:role/admin": "Admin"
"arn:aws:iam::.*:role/operator": "Ops"
```

```
? Choose an IdP:
> Data Production
Data Development
Marketing Production
Marketing Development

? Choose a Role: [Use arrows to move, type to filter]
> Admin
Ops
```

## 2.0.0-beta.6 (November 2, 2023)

* New m2m flag `--private-key-file` read private key from file
* Bug fix panic when okta.yaml is not established (it doesn't have to be established either)
* Bug fix allowing `--version` w/o sub command [#150](https://github.com/okta/okta-aws-cli/pull/150), thanks [@malept](https://github.com/malept)!

## 2.0.0-beta.5 (October 13, 2023)

Friendly label matching for IdPs and Roles with `$HOME/.okta/okta.yaml` file can be regular expressions.

## 2.0.0-beta.4 (October 12, 2023)

`okta-aws-cli web` can have it's open browser command customized.

## 2.0.0-beta.3 (October 10, 2023)

`okta-aws-cli web` can collect all roles for all AWS Federation Apps (IdP) to an
AWS credentials file in one invocation of the CLI.

## 2.0.0-beta.2 (October 5, 2023)

Execute a subcommand directly from `okta-aws-cli`

## 2.0.0-beta.1 (October 2, 2023)

Support for AWS CLI [process credential provider](https://docs.aws.amazon.com/sdkref/latest/guide/feature-process-credentials.html)

## 2.0.0-beta.0 (September 29, 2023)

`okta-aws-cli`'s functions are encapsulated as (sub)commands `web`, `m2m`, `debug`

A small number of environment variable names have been renamed to be consistent
in the naming convention for `okta-aws-cli` specific names.

## 1.2.2 (August 30, 2023)

* Ensure evaluation of CLI flag for profile is in the same order as the other flags [#124](https://github.com/okta/okta-aws-cli/pull/124)
Expand Down
Loading
Loading