-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
## Summary Fixes #3103 ### Time to review: __10 mins__ ## Changes proposed Changed the way we call the OAuth token endpoint to use private_key_jwt Added docs for how to setup Login.gov certs ## Context for reviewers For the first pass, I setup the call to the token endpoint to use client_id, but actual Login.gov uses private_key_jwt for this instead (which includes the client ID). Luckily it seems our local mock is fine with that and can take in this as well. It doesn't do any validation on the key itself, so any private key is fine. Effectively, this form of "auth" is just passing the client ID + a hash that could have only been created by our private key, and login.gov is configured to have our public key. ## Additional information For testing this, I actually connected it to our dev login.gov app which I setup alongside it. It works! Also verified exactly what we need to set for many of the env vars to get everything happy. You get directed first to: ![Screenshot 2024-12-11 at 4 14 39 PM](https://github.com/user-attachments/assets/25474a57-afb8-42dd-8c74-599f4ac3edab) And then back to our API and then the final endpoint with a token that works locally. --------- Co-authored-by: nava-platform-bot <[email protected]>
- Loading branch information
1 parent
41be850
commit e9c710d
Showing
11 changed files
with
111 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,3 +51,33 @@ out the instance count. Effectively using the instance count scaling might requi | |
When scaling openSearch, consider which attribute changes will trigger blue/green deploys, versus which attributes | ||
can be edited in place. [You can find that information here](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-configuration-changes.html). Requiring blue/green changes for the average configuration change is a | ||
notable constraint of OpenSearch, relative to ECS and the Database. | ||
|
||
# Yearly Rotations | ||
|
||
We manage several secret values that need to be rotated yearly. | ||
|
||
## Login.gov Certificates | ||
|
||
*These certificates were last updated in December 2024* | ||
|
||
We need to manage a public certificate with login.gov for [private_jwt_auth](https://developers.login.gov/oidc/token/#client_assertion) in each of our environments. | ||
|
||
To generate a certificate run: | ||
```shell | ||
openssl req -nodes -x509 -days 365 -newkey rsa:2048 -keyout private.pem -out public.crt -subj "/C=US/ST=Washington DC/L=Washington DC/O=Nava PBC/OU=Engineering/CN=Simpler Grants.gov/[email protected]" | ||
``` | ||
|
||
Navigate to the [login.gov service provider page](https://dashboard.int.identitysandbox.gov/service_providers) | ||
and for each application edit it, and upload the public.crt file. Leave any prior cert files alone until we have | ||
switched the API to using the new one. | ||
|
||
Go to SSM parameter store and change the value that maps to the `LOGIN_GOV_CLIENT_ASSERTION_PRIVATE_KEY` value | ||
for the given environment to be the value from the `private.pem` key you generated. | ||
|
||
After the next deployment in an environment, we should be using the new keys, and can cleanup the old certificate. | ||
|
||
### Prod Login.gov | ||
|
||
Prod login.gov does not update immediately, and you must [request a deployment](https://developers.login.gov/production/#changes-to-production-applications) to get a certificate rotated. | ||
|
||
For Prod, assume it will take at least two weeks from creating the certificate, before it is available for the API, and until it is, do not change the API's configured key. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters