-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Add certutil http command #49827
Add certutil http command #49827
Conversation
This adds a new "http" sub-command to the certutil CLI tool. The http command generates certificates/CSRs for use on the http interface of an elasticsearch node/cluster. It is designed to be a guided tool that provides explanations and sugestions for each of the configuration options. The generated zip file output includes extensive "readme" documentation and sample configuration files for core Elastic products.
Pinging @elastic/es-security (:Security/Network) |
This currently only supports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a first round today, I want to look at this once more, from a user's perspective this time as in actually using the tool, and I'll put in additional comments. Impressive amount of user-friendliness here @tvernum :)
.../security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
Show resolved
Hide resolved
.../security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
Outdated
Show resolved
Hide resolved
.../security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
Outdated
Show resolved
Hide resolved
.../cli/src/main/resources/org/elasticsearch/xpack/security/cli/certutil-http/ca-readme-p12.txt
Outdated
Show resolved
Hide resolved
.../cli/src/main/resources/org/elasticsearch/xpack/security/cli/certutil-http/ca-readme-p12.txt
Outdated
Show resolved
Hide resolved
.../security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
Show resolved
Hide resolved
.../security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
Outdated
Show resolved
Hide resolved
.../security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
Show resolved
Hide resolved
.../security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
Outdated
Show resolved
Hide resolved
...rity/cli/src/test/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommandTests.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kibana related pieces look good to me and everything seems to be in order (apart from minor path related issue). I assume PKI auth between Kibana and Elasticsearch is out of scope of this PR. Is there anything specific you want us to look at @tvernum?
Impressive amount of user-friendliness here @tvernum :)
I want to second this, the guidance is super clear and helpful!
.../security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
Outdated
Show resolved
Hide resolved
.../cli/src/main/resources/org/elasticsearch/xpack/security/cli/certutil-http/kibana-sample.yml
Outdated
Show resolved
Hide resolved
} | ||
|
||
static FileType guessFileType(Path path, Terminal terminal) { | ||
// trust the extension for some file-types rather then inspecting the contents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// trust the extension for some file-types rather then inspecting the contents | |
// trust the extension for some file-types rather than inspecting the contents |
return types.get(0); | ||
default: | ||
if (types.contains(FileType.PEM_KEY)) { | ||
// A Key and something else. Could be a cert + key paired, but we don't support that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// A Key and something else. Could be a cert + key paired, but we don't support that | |
// A Key and something else. Could be a cert + key pair, but we don't support that |
It is. I'd like to include it down the track, but I suspect that most people who decide to implement mutual TLS have an existing tool set that they're comfortable with, so I'll be prioritising the config other component (beats, language clients, etc) first.
If the Kibana setup makes sense (except for my path problem) then the main feedback I'm after is any suggestions for improvements in the text (or other UI feedback such as changing the order of the questions, etc). |
.../security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
Outdated
Show resolved
Hide resolved
.../security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
Show resolved
Hide resolved
.../security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
Show resolved
Hide resolved
.../security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
Show resolved
Hide resolved
.../security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
Outdated
Show resolved
Hide resolved
private CertificateTool.CAInfo findExistingCA(Terminal terminal, Environment env) throws UserException { | ||
printHeader("What is the path to your CA?", terminal); | ||
|
||
terminal.println("Please enter the full pathname to the Certificate Authority that you wish to"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path is ( can be ) relevant to the ES_PATH_CONF of the elasticsearch installation. I am not sure if this is worth pointing out but, if users don't enter a full path ( starting with /
) the error message can be somewhat confusing.
.../security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
Show resolved
Hide resolved
.../security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
Outdated
Show resolved
Hide resolved
printHeader("What password do you want for your private keys?", terminal); | ||
char[] password; | ||
if (csr) { | ||
terminal.println("Your private keys will be stored as a PEM formatted file."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
terminal.println("Your private keys will be stored as a PEM formatted file."); | |
terminal.println("Your private key(s) will be stored as PEM formatted file(s)."); |
.../security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java
Outdated
Show resolved
Hide resolved
@jkakavas I've addressed most of your comments. If I missed any that you still think are important, let me know and we'll work out a solution. |
Thanks for the iterations Tim. I have no more blocking feedback, I'd be very happy to see this merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @jkakavas |
This adds a new "http" sub-command to the certutil CLI tool. The http command generates certificates/CSRs for use on the http interface of an elasticsearch node/cluster. It is designed to be a guided tool that provides explanations and sugestions for each of the configuration options. The generated zip file output includes extensive "readme" documentation and sample configuration files for core Elastic products. Backport of: elastic#49827
This adds a new "http" sub-command to the certutil CLI tool. The http command generates certificates/CSRs for use on the http interface of an elasticsearch node/cluster. It is designed to be a guided tool that provides explanations and sugestions for each of the configuration options. The generated zip file output includes extensive "readme" documentation and sample configuration files for core Elastic products. Backport of: #49827
This adds a new "http" sub-command to the certutil CLI tool. The http command generates certificates/CSRs for use on the http interface of an elasticsearch node/cluster. It is designed to be a guided tool that provides explanations and sugestions for each of the configuration options. The generated zip file output includes extensive "readme" documentation and sample configuration files for core Elastic products.
This adds a new "http" sub-command to the certutil CLI tool.
The http command generates certificates/CSRs for use on the http
interface of an elasticsearch node/cluster.
It is designed to be a guided tool that provides explanations and
sugestions for each of the configuration options. The generated zip
file output includes extensive "readme" documentation and sample
configuration files for core Elastic products.