Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WIP] feat(enterprise): encrypt external access tokens (oidc, git auth) in the database#9339

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
johnstcn wants to merge67 commits intomainfromcj/dbcrypt

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedAug 25, 2023
edited
Loading

Encrypt exernal access tokens

Note: this PR has gotten rather big, so I am breaking it up into smaller chunks. Keeping this around for reference.
#9421
#9433

This PR adds enterprise-only functionality to encrypt external database access tokens. This builds upon@kylecarbs' previous work in#7959.

  • Adds a new tabledbcrypt_sentinel which is used as a litmus test for database encryption status.
  • Adds packageenterprise/dbcrypt which handles encryption/decryption for the following fields:
    • dbcrypt_sentinel.value
    • user_links.oauth_access_token
    • user_links.oauth_refresh_token
    • git_auth_links.oauth_access_token
    • git_auth_links.oauth_refresh_token
  • Adds support for specifyingEXTERNAL_TOKEN_ENCRYPTION_KEYS to enterprise server cmd.
    • When specified, thedatabase.Store will be wrapped bydbcrypt.Store.
    • At present, we only allow max. 2 keys; this is to force people to complete key rotation in a timely manner instead of continuously appending old keys.
  • Adds adbcrypt-rotate enterprise subcommand (and associated test) to perform key rotation and re-encryption of affected rows.

Suggested attention:

  • enterprise/dbcrypt - this is the most important piece
  • enterprise/cli - specifically the rotation command
  • enterprise/coderd - specifically the misc. plumbing

Checklist

  • No experimental flags needed
  • Testing:
    • Unit tests have been added
    • Manual testing has been performed using./scripts/dev-oidc.sh
  • User-facing changes:
    • Add documentation under./docs (in progress)

kylecarbsand others added30 commitsMay 30, 2023 16:26
- add external token encryption key to YAML excludes- ensure that secret external token encryption key is  scrubbed from deployment values
@johnstcnjohnstcn changed the title[WIP] encrypt external access tokensfeat(enterprise): encrypt external access tokens (oidc, git auth) in the databaseAug 29, 2023
@johnstcnjohnstcn changed the titlefeat(enterprise): encrypt external access tokens (oidc, git auth) in the database[WIP] feat(enterprise): encrypt external access tokens (oidc, git auth) in the databaseAug 30, 2023
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 30, 2023
@johnstcnjohnstcn deleted the cj/dbcrypt branchOctober 13, 2023 12:19
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers
No reviews
Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@johnstcn@kylecarbs

[8]ページ先頭

©2009-2025 Movatter.jp