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

Print warning when 'tls_cipher_suites' includes only blacklisted cipher suites #6300

Merged
merged 6 commits into from
Mar 1, 2019

Conversation

michelvocks
Copy link
Contributor

HTTP/2 with TLS 1.2 blacklists several cipher suites: https://tools.ietf.org/html/rfc7540#appendix-A

I added a warning which will be printed to the screen when all configured cipher suites (e.g. 'tls_cipher_suites') are blacklisted.
Since the CLI (net/http) automatically uses HTTP/2 with TLS 1.2, the CLI will stop working if all configured cipher suites are blacklisted.

Output format:
screenshot 2019-02-27 at 15 00 55

@jefferai
Copy link
Member

Unfortunately this won't solve the original problem, because they aren't using only blacklisted ciphers, they're using some -- and since they're not including the compatibility one mandated in the HTTP/2 spec, there is no compatible set of ciphers.

I think the behavior needs to be:

  1. Check each cipher to see if it's been blacklisted. Set a var to true if any are found. Set another to true if all are blacklisted.
  2. Check for the list to include the mandated cipher. Set another var to true if found.
  3. If all ciphers are blacklisted, print an error and fail startup, or
  4. If some ciphers are blacklisted and the compatibility cipher is included, log a warning indicating that some ciphers specified are blacklisted, or
  5. If some are blacklisted and the compatibility cipher isn't included, log a warning indicating this and that connections may fail. I'm not sure whether in this case we should actually block Vault from starting up, but if they're also specifically choosing ciphers on the client side they may still be able to get a valid connection, so probably not.

…sted. Added warning when some ciphers are blacklisted.
@michelvocks
Copy link
Contributor Author

@jefferai Please have another look 😄

@michelvocks michelvocks requested a review from jefferai February 28, 2019 09:28
}
}
if badCiphersCount == len(ciphers) {
return nil, nil, nil, errors.New("all defined cipher suites by 'tls_cipher_suites' are blacklisted by the HTTP/2 specification")
Copy link
Member

Choose a reason for hiding this comment

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

I'm wavering on whether this should be an error or a warning. If their client is also appropriately configured things could still work even if it's out of spec. I'm leaning towards this being a warning as well, WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. I think some people will be frustrated if Vault will not start because of this and since HTTP/2 is still new for many enterprise companies it might be worth to stick to a warning instead of a hard failure.

@michelvocks michelvocks requested a review from jefferai March 1, 2019 07:28
Copy link
Member

@jefferai jefferai left a comment

Choose a reason for hiding this comment

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

Looks good!

@michelvocks michelvocks merged commit 9617832 into master Mar 1, 2019
@michelvocks michelvocks deleted the cipher_suites_http2_test branch March 1, 2019 15:48
@michelvocks michelvocks added this to the 1.0.4 milestone Mar 1, 2019
@briankassouf briankassouf modified the milestones: 1.0.4, 1.1.1, 1.1 Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants