Skip to content

Conversation

slobodanadamovic
Copy link
Contributor

Backports the following commits to 8.x:

…astic#126376) (elastic#126448)

* Set `keyUsage` for generated HTTP certificates and self-signed CA (elastic#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 elastic#117769

(cherry picked from commit 284121a)

# 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 <[email protected]>
@slobodanadamovic slobodanadamovic added :Security/TLS SSL/TLS, Certificates >bug auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport Team:Security Meta label for security team labels Apr 8, 2025
Copy link
Contributor

github-actions bot commented Apr 8, 2025

Documentation preview:

@elasticsearchmachine elasticsearchmachine merged commit 1f74c16 into elastic:8.x Apr 8, 2025
21 checks passed
@slobodanadamovic slobodanadamovic deleted the backport/8.x/pr-126448 branch April 8, 2025 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :Security/TLS SSL/TLS, Certificates Team:Security Meta label for security team v8.19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants