Skip to content

Commit 6d6ac03

Browse files
Document AWS-only Google credential storage
1 parent b6cf9aa commit 6d6ac03

2 files changed

Lines changed: 23 additions & 25 deletions

File tree

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ That workflow also reapplies the latest policy code from this repository after
4949
CloudFormation completes, preventing the inline bootstrap implementation from
5050
replacing the maintained runtime code.
5151

52-
Google OAuth credential rotation is performed in Google Cloud and the encrypted
53-
`SHARED_AUTH_GOOGLE_CLIENT_ID` / `SHARED_AUTH_GOOGLE_CLIENT_SECRET` repository
54-
secrets in `DataTalksClub/aws-infra`.
52+
Google OAuth credential rotation is performed in Google Cloud and AWS Secrets
53+
Manager. GitHub stores neither the client ID nor the client secret; the
54+
CloudFormation service role resolves them entirely within AWS.
5555

5656
See [Google authentication setup](docs/google-auth-setup.md) for the complete
5757
initial setup, rotation, deployment, and verification procedure.
58-

docs/google-auth-setup.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ You need:
1212

1313
- permission to manage a Google Cloud project associated with the
1414
`datatalks.club` Google Workspace organization;
15-
- permission to update Actions secrets in `DataTalksClub/aws-infra`;
15+
- permission to update `dtcdev-shared-auth/google-oauth` in AWS Secrets Manager;
1616
- permission to run that repository's shared-auth deployment workflow;
1717
- access to one `@datatalks.club` Google account for the allowed test and one
1818
non-domain Google account for the rejection test.
@@ -61,23 +61,22 @@ The client ID is not confidential; the client secret is.
6161

6262
## 3. Store the credentials for deployment
6363

64-
Store both values as encrypted GitHub Actions secrets in
65-
`DataTalksClub/aws-infra`:
64+
Open AWS Secrets Manager in `us-east-1` and create a secret named:
6665

67-
- `SHARED_AUTH_GOOGLE_CLIENT_ID`
68-
- `SHARED_AUTH_GOOGLE_CLIENT_SECRET`
66+
```text
67+
dtcdev-shared-auth/google-oauth
68+
```
6969

70-
Use **Repository settings → Secrets and variables → Actions → New repository
71-
secret**, or run these commands in an interactive terminal from a trusted
72-
machine:
70+
Choose **Other type of secret** and store two key/value pairs:
7371

74-
```bash
75-
gh secret set SHARED_AUTH_GOOGLE_CLIENT_ID --repo DataTalksClub/aws-infra
76-
gh secret set SHARED_AUTH_GOOGLE_CLIENT_SECRET --repo DataTalksClub/aws-infra
77-
```
72+
| Key | Value |
73+
|---|---|
74+
| `client_id` | The Google OAuth client ID |
75+
| `client_secret` | The matching Google OAuth client secret |
7876

79-
Each command reads the value without putting it in source control. Do not add
80-
the values to `.env`, CloudFormation parameter files, or this repository.
77+
GitHub stores neither value. The GitHub deployment role can inspect only the
78+
secret's version metadata; the CloudFormation service role resolves the actual
79+
values within AWS and supplies them directly to Cognito.
8180

8281
## 4. Deploy the Cognito provider
8382

@@ -88,8 +87,9 @@ gh workflow run deploy-shared-auth.yml --repo DataTalksClub/aws-infra
8887
```
8988

9089
The workflow uses GitHub OIDC to assume the least-privilege AWS deployment
91-
role, passes the two secrets as `NoEcho` CloudFormation parameters, updates the
90+
role, reads the current non-secret version ID, updates the
9291
`dtcdev-shared-auth` stack in `us-east-1`, and verifies the Google provider.
92+
Only CloudFormation's AWS service role can read the credential value.
9393

9494
After it succeeds, this repository's **CI and deploy auth policy** workflow
9595
deploys and verifies the domain-guard Lambda independently. It does not need or
@@ -138,15 +138,14 @@ to recover or reuse a value that may have been exposed.
138138
Use this order to avoid unnecessary downtime:
139139

140140
1. Create the replacement Google OAuth client.
141-
2. Update both `SHARED_AUTH_GOOGLE_CLIENT_*` GitHub secrets.
142-
3. run the `aws-infra` shared-auth deployment workflow;
143-
4. complete an allowed Google sign-in;
141+
2. Create a new version of `dtcdev-shared-auth/google-oauth` in AWS Secrets
142+
Manager with the replacement `client_id` and `client_secret` values.
143+
3. Run the `aws-infra` shared-auth deployment workflow; it passes the new
144+
version ID so Cognito refreshes both values.
145+
4. Complete an allowed Google sign-in.
144146
5. delete the old OAuth client in Google Cloud;
145147
6. rerun the automated verifier and the non-domain rejection test.
146148

147-
The currently deployed Google client secret must be rotated because it appeared
148-
in an AWS diagnostic response during setup verification.
149-
150149
## Troubleshooting
151150

152151
- `redirect_uri_mismatch`: compare the Google client redirect character for

0 commit comments

Comments
 (0)