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

feat(coderd): plumb through dbcrypt package#9433

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 merge2 commits intocj/dbcrypt_1fromcj/dbcrypt_2

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedAug 30, 2023
edited
Loading

See#9523 instead.

This commit builds upon#9421. It is recommended to read this first.

  • Adds a commanddbcrypt-rotate to re-enncrypt encrypted data
  • Plumbs throughdbcrypt inenterprise/coderd (including unit tests)
  • Enables database encryption indevelop.sh by default
  • Adds documentation inadmin/encryption.md

@johnstcnjohnstcn self-assigned thisAug 30, 2023
johnstcnand others added2 commitsAugust 30, 2023 11:57
- Adds a command dbcrypt-rotate to re-enncrypt encrypted data- Plumbs through dbcrypt in enterprise/coderd (including unit tests)- Enables database encryption in develop.sh by defaultCo-authored-by: Kyle Carberry <kyle@coder.com>
return xerrors.Errorf("get users: %w", err)
}
for idx, usr := range users {
userLinks, err := cryptDB.GetUserLinksByUserID(ctx, usr.ID)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should put comments everywhere so people forget to add something in one place and forget it here.

johnstcn reacted with thumbs up emoji
database. The value must be a comma-separated list of base64-encoded
keys. A maximum of two keys may be provided. Each key, when
base64-decoded, must be exactly 32 bytes in length. The first key will
be used to encrypt new values. Subsequent keys will be used as a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It seems a little confusing that there's a maximum of two keys but this refers to "subsequent keys". Maybe it should say "the optional second key" instead?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Based on other comments, I'm considering removing the restriction on the number of keys. I can see a legitimate use case for needing to have three keys for a period of time.

aaronlehmann reacted with thumbs up emoji
opts = vals.Options()
)
cmd := &clibase.Cmd{
Use: "dbcrypt-rotate --postgres-url <postgres_url> --external-token-encryption-keys <new-key>,<old-key>",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

running this from the CLI that has to have direct DB access is kind of obnoxious from an operator's standpoint.

What about making it an API call you could make to an appropriately-keyed Coderd? We could still have the CLI command, but you could run it from anywhere with Coder access. We could also consider a button on the front end at some later date.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

While this would be a nice usability improvement, it has precedence already with thereset-password CLI command. It's a good candidate for a follow-up PR though!

@johnstcn
Copy link
MemberAuthor

Closing in favour of#9523

@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 5, 2023
@johnstcnjohnstcn deleted the cj/dbcrypt_2 branchOctober 13, 2023 12:19
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@aaronlehmannaaronlehmannaaronlehmann left review comments

@spikecurtisspikecurtisspikecurtis requested changes

@deansheatherdeansheatherdeansheather approved these changes

@kylecarbskylecarbsAwaiting requested review from kylecarbs

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@johnstcn@spikecurtis@aaronlehmann@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp