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

meta-issue: improvements to password authentication #51601

Closed
knz opened this issue Jul 20, 2020 · 2 comments
Closed

meta-issue: improvements to password authentication #51601

knz opened this issue Jul 20, 2020 · 2 comments
Labels
A-authentication Pertains to authn subsystems A-cc-enablement Pertains to current CC production issues or short-term projects A-security C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) meta-issue Contains a list of several other issues. T-server-and-security DB Server & Security X-server-triaged-202105

Comments

@knz
Copy link
Contributor

knz commented Jul 20, 2020

This issue is intended to serve as high-level overview of the strategy for password authn in CockroachDB/CC.

It outlines how the engineering discussions were orienting towards a "blue" strategy with limitations. It also explains how a different "green" strategy was developed recently. It explains why/how we are going to target "green" and de-prioritize "blue".

Background

Over the past two years a number of issues have been raised over seemingly disconnected aspects of pw authn, including but not limited to:

This collection of issues bury their lede: what is the high-level problem to solve?

They also point to conflicting directions: if we persist to use bcrypt-based authn, that precludes SCRAM-SHA-256 which is desirable for e.g. compatibility. Which one should we choose?

Objectives: security and compatibility

  • There are 3 security objectives:

    A. protect CockroachDB/CC clusters against Denial-of-Service attacks, where a malicious users exhausts resources. This can be achieved today using e.g. many connections performing unsuccessful password authn attempts.

    B. protect CockroachDB/CC clusters against various spoofing attacks, where a malicious user gains access to a SQL session they don't have legitimate access to.

    C. make it possible for CC to offer services securely to end-users without requiring allow-listing of client IP addresses.

    This objective partially overlaps with objectives A and B above, but restricts the range of allowable solutions.

    We also want to offer some protection against the consequences of a CC node compromise (either server compromise or SQL escalation of privileges). We want that a successful attack of this type does not give the attacker access to other CC clusters from the same user/customer.

  • We also have one compatibility objective:

    D. Whatever solution is adopted should enable client authn by existing pg drivers, without introducing non-standard authn algorithms.

Two strategies

Over the past year, there have been two strategies discussed to achieve the goals identified above.

  • The Blue strategy:

    • has been discussed on Slack and in-between the lines of various issues linked above.
    • The historical proponent of this strategy was Ben.
    • This strategy has grown and consolidated itself organically through discussions from the CockroachDB community and on-prem users.
    • Analysis of the strategy reveals that it does not cover all the goals identified above.
  • The Green strategy:

    • has emerged after careful analysis of CockroachCloud requirements and the "Free tier" CC project, but is also satisfying various demands by on-prem users.
    • The proponents of this strategy are the entire security team.
    • This strategy is recent and stems from first principles.
    • It does cover all the goals identified above.

Blue strategy: narrative

In the gray strategy, we perform some incremental changes to various pieces in CockroachDB and achieve 60% of the security objectives.

Green strategy: narrative

In the white strategy, we adopt a more principled approach.

Detailed explanation here: https://docs.google.com/document/d/1HOpN_P9fJOIyh-bCvOti6lBNLDS4Ia-2nrJEPGeUnA0/edit#

Summary: aiming for green

Strategy Blue strategy Green strategy
Objective A Partial Strong
Objective B Partial Strong
Objective C Not covered Strong
Objective D OK OK

So we're going to aim for the "green" strategy and de-prioritize the proposals from the "blue" strategy.

@blathers-crl
Copy link

blathers-crl bot commented Jul 20, 2020

Hi @knz, I've guessed the C-ategory of your issue and suitably labeled it. Please re-label if inaccurate.

While you're here, please consider adding an A- label to help keep our repository tidy.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@blathers-crl blathers-crl bot added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Jul 20, 2020
@knz knz added the A-security label Jul 20, 2020
@rafiss rafiss added the meta-issue Contains a list of several other issues. label Jan 21, 2021
@jlinder jlinder added the T-server-and-security DB Server & Security label Jun 16, 2021
@knz knz added A-authentication Pertains to authn subsystems A-cc-enablement Pertains to current CC production issues or short-term projects labels Jul 29, 2021
@knz
Copy link
Contributor Author

knz commented Feb 15, 2022

we've achieved most of the stated goals on this.

@knz knz closed this as completed Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-authentication Pertains to authn subsystems A-cc-enablement Pertains to current CC production issues or short-term projects A-security C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) meta-issue Contains a list of several other issues. T-server-and-security DB Server & Security X-server-triaged-202105
Projects
None yet
Development

No branches or pull requests

3 participants