elasticsearch/docs/reference/commands
Slobodan Adamović 65d152640b
Set keyUsage for generated HTTP certificates and self-signed CA (#126376) (#126448)
* Set `keyUsage` for generated HTTP certificates and self-signed CA (#126376)

The `elasticsearch-certutil http` command, and security auto-configuration,
generate the HTTP certificate and CA without setting the `keyUsage` extension.

This PR fixes this by setting (by default):
- `keyCertSign` and `cRLSign` for self-signed CAs
- `digitalSignature` and `keyEncipherment` for HTTP certificates and CSRs

These defaults can be overridden when running `elasticsearch-certutil http`
command. The user will be prompted to change them as they wish.

For `elasticsearch-certutil ca`, the default value can be overridden by passing
the `--keysage` option, e.g.
```
elasticsearch-certutil ca --keyusage "digitalSignature,keyCertSign,cRLSign" -pem
```

Fixes #117769

(cherry picked from commit 284121ad9f)

# Conflicts:
#	docs/reference/elasticsearch/command-line-tools/certutil.md

* fix compilation error

* [CI] Auto commit changes from spotless

* fix failing test

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-04-08 20:47:15 +10:00
..
certgen.asciidoc [DOCS] Remove [testenv="gold+"] attributes (#79309) 2021-10-27 16:32:30 -04:00
certutil.asciidoc Set keyUsage for generated HTTP certificates and self-signed CA (#126376) (#126448) 2025-04-08 20:47:15 +10:00
cli-jvm-options.asciidoc fix typos (#113329) (#113400) 2024-09-24 02:05:57 +10:00
create-enrollment-token.asciidoc Adjust auto-configuration related docs (#84080) 2022-02-20 10:58:46 +02:00
croneval.asciidoc [DOCS] Remove redirect pages (#88738) 2023-05-24 12:32:46 +01:00
index.asciidoc Add docs for elasticsearch-reconfigure-node (#83605) 2022-02-10 22:35:29 +02:00
keystore.asciidoc Clarify keystore add-file command behavior (#97474) 2023-07-07 15:44:16 -07:00
node-tool.asciidoc [8.17] [DOCS] Concept cleanup 2 - ES settings (#119373) (#119643) 2025-01-10 10:31:05 -05:00
reconfigure-node.asciidoc Document jvm options for cli tools (#92510) 2022-12-22 15:32:07 -08:00
reset-password.asciidoc URL option for BaseRunAsSuperuserCommand (#81025) 2021-11-29 23:49:27 +02:00
saml-metadata.asciidoc [DOCS] Remove [testenv="gold+"] attributes (#79309) 2021-10-27 16:32:30 -04:00
service-tokens-command.asciidoc [DOCS] Recommend API service tokens (over file) (#96091) 2023-05-16 00:05:05 -04:00
setup-passwords.asciidoc [DOCS] Remove [testenv="gold+"] attributes (#79309) 2021-10-27 16:32:30 -04:00
shard-tool.asciidoc Document jvm options for cli tools (#92510) 2022-12-22 15:32:07 -08:00
syskeygen.asciidoc [DOCS] Remove [testenv="gold+"] attributes (#79309) 2021-10-27 16:32:30 -04:00
users-command.asciidoc Clarify es-users effects per node (#82099) 2022-01-24 14:33:55 -05:00