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

[20.10 backport] context: deprecate support for encrypted TLS private keys #3219

Merged

Conversation

thaJeztah
Copy link
Member

backport of #3218 and #3213

relates to #3212

Legacy PEM encryption as specified in RFC 1423 is insecure by design. Since
it does not authenticate the ciphertext, it is vulnerable to padding oracle
attacks that can let an attacker recover the plaintext

From https://go-review.googlesource.com/c/go/+/264159

It's unfortunate that we don't implement PKCS#8 encryption so we can't
recommend an alternative but PEM encryption is so broken that it's worth
deprecating outright.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

From https://go-review.googlesource.com/c/go/+/264159

> It's unfortunate that we don't implement PKCS#8 encryption so we can't
> recommend an alternative but PEM encryption is so broken that it's worth
> deprecating outright.

When linting on Go 1.16:

    cli/context/docker/load.go:69:6: SA1019: x509.IsEncryptedPEMBlock is deprecated: Legacy PEM encryption as specified in RFC 1423 is insecure by design. Since it does not authenticate the ciphertext, it is vulnerable to padding oracle attacks that can let an attacker recover the plaintext.  (staticcheck)
            if x509.IsEncryptedPEMBlock(pemBlock) {
               ^
    cli/context/docker/load.go:70:20: SA1019: x509.DecryptPEMBlock is deprecated: Legacy PEM encryption as specified in RFC 1423 is insecure by design. Since it does not authenticate the ciphertext, it is vulnerable to padding oracle attacks that can let an attacker recover the plaintext.  (staticcheck)
                keyBytes, err = x509.DecryptPEMBlock(pemBlock, []byte(c.TLSPassword))
                                ^

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 2688f25)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
> Legacy PEM encryption as specified in RFC 1423 is insecure by design. Since
> it does not authenticate the ciphertext, it is vulnerable to padding oracle
> attacks that can let an attacker recover the plaintext

From https://go-review.googlesource.com/c/go/+/264159

> It's unfortunate that we don't implement PKCS#8 encryption so we can't
> recommend an alternative but PEM encryption is so broken that it's worth
> deprecating outright.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 15535d4)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@codecov-commenter
Copy link

Codecov Report

Merging #3219 (8437cfe) into 20.10 (f9d091f) will increase coverage by 0.00%.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##            20.10    #3219   +/-   ##
=======================================
  Coverage   58.52%   58.53%           
=======================================
  Files         299      299           
  Lines       21446    21446           
=======================================
+ Hits        12552    12554    +2     
+ Misses       7974     7973    -1     
+ Partials      920      919    -1     

@thaJeztah
Copy link
Member Author

@silvin-lubecki @StefanScherer ptal

Copy link
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit a6f6b5f into docker:20.10 Jul 29, 2021
@thaJeztah thaJeztah deleted the 20.10_backport_deprecate_encrypted_tls branch July 29, 2021 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants