Commit graph

1466 commits

Author SHA1 Message Date
Jan Kuipers
7f12f8009b
fix MachineDependentHeapTests (#129699) 2025-06-19 14:07:39 +02:00
Rene Groeschke
5836dd3b39
[Fips] Explicitly set trustStoreType to BCFKS in FIPS docker image (#129385)
We see an certificate issue when using fips docker image creating searchable snapshots in aws
and gcs. This is likely related to a configuration issue not explicitly setting the trust store
type for our bcfks cacerts
2025-06-13 17:01:11 +02:00
Richard Dennehy
63da93d4c3
Delegated authorization using Microsoft Graph (SDK) (#128396)
* Delegated authorization using Microsoft Graph (SDK)
---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
Co-authored-by: Johannes Freden Jansson <johannes.freden@elastic.co>
Co-authored-by: Johannes Fredén <109296772+jfreden@users.noreply.github.com>
2025-06-12 11:03:32 +02:00
Rene Groeschke
1e13409049
Fix DRA dependenciesInfo task dependency resolution (#129209) 2025-06-10 20:06:24 +02:00
Jan Kuipers
087747b363
Include direct memory and non-heap memory in ML memory calculations (take #2) (#128742)
* Include direct memory and non-heap memory in ML memory calculations.

* Reduce ML_ONLY heap size, so that direct memory is accounted for.

* [CI] Auto commit changes from spotless

* changelog

* improve docs

* Reuse direct memory to heap factor

* feature flag

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
2025-06-10 13:36:42 +02:00
Rene Groeschke
649b505731
[Build] Address further dockerhub feedback on default Dockerfile (#128686)
* [Build] Address further dockerhub feedback on default Dockerfile
* Bring back license folder
* Minor cleanup
* polishing
2025-06-05 08:02:37 +02:00
elastic-renovate-prod[bot]
488bd6a846
Update wolfi (versioned) (#128516)
This PR contains the following updates:

| Package | Type | Update | Change | |---|---|---|---| |
docker.elastic.co/wolfi/chainguard-base |  | digest | `55ee1dc` ->
`3d19648` | | docker.elastic.co/wolfi/chainguard-base | final | digest |
`55ee1dc` -> `3d19648` | | docker.elastic.co/wolfi/chainguard-base |
stage | digest | `55ee1dc` -> `3d19648` | |
docker.elastic.co/wolfi/chainguard-base-fips |  | digest | `a9e07d9` ->
`68e0781` | | docker.elastic.co/wolfi/chainguard-base-fips | final |
digest | `a9e07d9` -> `68e0781` | |
docker.elastic.co/wolfi/chainguard-base-fips | stage | digest |
`a9e07d9` -> `68e0781` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 1pm on tuesday" (UTC),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once
you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyI6RGVsaXZlcnkvUGFja2FnaW5nIiwiPm5vbi1pc3N1ZSIsIlRlYW06RGVsaXZlcnkiLCJhdXRvLW1lcmdlLXdpdGhvdXQtYXBwcm92YWwiXX0=-->
2025-05-28 01:50:20 +10:00
elastic-renovate-prod[bot]
f6e4a26480
chore(deps): update wolfi (versioned) (#126468)
This PR contains the following updates:

| Package | Type | Update | Change | |---|---|---|---| |
docker.elastic.co/wolfi/chainguard-base |  | digest | `29150cd` ->
`55ee1dc` | | docker.elastic.co/wolfi/chainguard-base | final | digest |
`29150cd` -> `55ee1dc` | | docker.elastic.co/wolfi/chainguard-base |
stage | digest | `29150cd` -> `55ee1dc` | |
docker.elastic.co/wolfi/chainguard-base-fips |  | digest | `ebfc3f1` ->
`a9e07d9` | | docker.elastic.co/wolfi/chainguard-base-fips | final |
digest | `ebfc3f1` -> `a9e07d9` | |
docker.elastic.co/wolfi/chainguard-base-fips | stage | digest |
`ebfc3f1` -> `a9e07d9` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 1pm on tuesday" (UTC),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once
you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

 - [x] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyI6RGVsaXZlcnkvUGFja2FnaW5nIiwiPm5vbi1pc3N1ZSIsIlRlYW06RGVsaXZlcnkiLCJhdXRvLW1lcmdlLXdpdGhvdXQtYXBwcm92YWwiXX0=-->
2025-05-23 05:19:35 +10:00
github-actions[bot]
2d09714260
chore: deps(ironbank): Bump ubi version to 9.6 (#128171)
Made with ❤️️ by updatecli

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-20 11:15:55 +02:00
Rene Groeschke
38c90ca8d4
Restructure docker files for docker distributions (#127960)
Restructures docker files for docker distributions

- Put Dockerfiles in specific distro specific folders keeping "Dockerfile" naming convention
- Allows better ide support
- Allows easier renovate integration
- Explicitly set base image in dockerfile
- simplify renovate configuration
- Cleanup DockerBase file to not contain ess fips base image information

This lives now in the Dockerfile content directly

* Workaround docker test issue

* Fix labels for fips image
2025-05-19 19:47:34 +02:00
Cas Donoghue
197d9b32cc
Provide default entrypoint for the cloud-ess-fips image (#127788)
In order to match the pattern for the other Cloud ESS image, provide a default
entrypoint to the container that points to the configured docker entrypoint.
This is described in
1a1763c591/distribution/docker/README.md (L16-L19)
and implemented in 1a1763c591/distribution/docker/src/docker/Dockerfile.ess (L37-L40)
2025-05-07 00:38:05 +02:00
Ryan Ernst
22a52a9c64
Remove security manager policy files (#127727)
Now that security manager is gone, the policy files are no longer
needed. This commit removes the server, test and plugin specific policy
files
2025-05-06 19:37:46 +02:00
Rene Groeschke
aee4465768
Ensure BCFKS based cacert truststore is used for cloud ess fips (#127716)
* Ensure we use BCFKS based cacert truststore for cloud ess fips
* Make truststore default password 14 characters
2025-05-06 08:26:43 +02:00
Rene Groeschke
d546fc8217
Adjust docker fips entrypoint and cmd (#127630)
Also extract docker fips configuration in explicit docker file
2025-05-02 14:43:55 +02:00
Rene Groeschke
aa309515f8
Rename docker fips image to cloud-ess-fips (#127561) 2025-04-30 15:56:24 +02:00
Mariusz Józala
db04c200f0
Keep publishing Docker labels in specific Docker Hub context (#126989)
These labels are incompatible with the Docker Hub, but for now we need
to keep them to override the labels coming from the base image.
2025-04-24 09:04:58 +02:00
Chris Hegarty
19550a838f
Add dense vector off-heap stats to Node stats and Index stats APIs (#126704)
This change enhances the dense_vector section of the Nodes stats and Index stats APIs so that they report the desired size of off-heap memory for all indexed vectors. The dense_vector section of the Custer stats API remains unchanged.

The retrieval mechanism and structure of the new stats is the same across the various three stats APIs, but more fine-grained information is disclosed as when moving from Cluster -> Node -> Index API.

For Node stats, we aggregate the total byte sizes for all vectors, categorised by the data type. For example:

"dense_vector" : {
  "value_count" : 5,
  "off_heap" : {
    "total_size_in_bytes" : 27,
    "total_veb_size_in_bytes" : 3,
    "total_vec_size_in_bytes" : 23,
    "total_veq_size_in_bytes" : 0,
    "total_vex_size_in_bytes" : 1
  }
}
Index stats: same as Node stats with included field break down . For example:

"dense_vector" : {
  "value_count" : 5,
  "off_heap" : {
    "total_size_in_bytes" : 27,
    "total_veb_size_in_bytes" : 3,
    "total_vec_size_in_bytes" : 23,
    "total_veq_size_in_bytes" : 0,
    "total_vex_size_in_bytes" : 1,
    "fielddata" : {
      "bar" : {
        "veb_size_in_bytes" : 3,
        "vec_size_in_bytes" : 14,
        "vex_size_in_bytes" : 1
      },
      "foo" : {
        "vec_size_in_bytes" : 9
      }
    }
  }
The implementation accesses the actual statistics through reflection. This will be completely removed when Lucene exposes this, which is expected in Lucene 10.3
2025-04-23 15:04:44 +01:00
Ryan Ernst
b5e92db171
Remove security manager from tests (#127087)
Now that entitlements are always used, there is no need to run tests
with security manager (a future enhancement will run tests with
entitlements). This commit removes setting up security manager from
tests.
2025-04-22 18:08:09 +02:00
Ryan Ernst
3495b4e4fe
Use explicit newline with keystore stdin test (#127094)
The add string keystore command accepts input on stdin. In this case,
the terminal is responsible for separating input by newlines that are
system dependent. The mock terminal normally adds the system dependent
newline. However, we also have tests that ensure both unix and windows
style newlines are tested explicitly. This commit fixes the windows
style carriage returns to explicitly contain a newline.

closes #127089
2025-04-21 13:19:32 -07:00
Ryan Ernst
584b2379f0
Use Terminal.readSecret in add string keystore command (#126966)
As a followon to #126729, the add string keystore command doesn't need
to use a reader at all (and it was incorrect for it to close the reader
from the terminal). Instead, the Terminal abstraction already handles
how to get at line by line secrets. This commit removes that usage of
reader and uses readSecret calls instead.

closes #126882
2025-04-18 19:50:15 +02:00
Ryan Ernst
42dc870ece
Ensure logs dir exists before using as working dir (#126566)
With the change to using the logs dir as the working dir of the
Elasticsearch process we need to ensure the logs dir exists within the
CLI instead of later during startup.

relates #124966
2025-04-17 12:59:47 -07:00
Brian Seeders
3d78c9428c
[bwc] Add bugfix3 project (#126880) 2025-04-16 16:27:03 -04:00
Ryan Ernst
b47bd3adc7
Use terminal reader in keystore add command (#126729)
When reading a string value from stdin the keystore add command
currently looks directly at stdin. However, stdin may also be consumed
while reading the keystore password. This commit changes the add command
to use the reader from the termainl instead of looking at stdin
directly.

closes #98115
2025-04-14 12:55:56 -07:00
Rene Groeschke
31995ace2d
Add docker hub specific docker context (#126625)
The labels we require for openshift are incompatible with docker hub policies. therefore we need to use different docker contexts for those.
2025-04-11 13:30:00 +02:00
Rene Groeschke
ca195736ca
Address review feedback on es default docker image (#126330)
This addresses feedback we got for our default image at https://github.com/docker-library/official-images/pull/18692
This also introduces separate docker source files to make maintaining those easier.

We cannot take over all suggested changes as we require certain settings to have our packaging tests pass as expected.
2025-04-10 17:14:22 +02:00
Ryan Ernst
3bac50e818
Use logs dir as working directory (#124966)
In the unexpected case that Elasticsearch dies due to a segfault or
other similar native issue, a core dump is useful in diagnosing the
problem. Yet core dumps are written to the working directory, which is
read-only for most installations of Elasticsearch. This commit changes
the working directory to the logs dir which should always be writeable.
2025-04-09 07:07:11 -07:00
Mariusz Józala
afe503f02f
[CI] Use official UBI9 image for testing (#126455)
Internal UBI images from `docker.elastic.co` are planned to be removed.
2025-04-09 09:05:26 +02:00
Rene Groeschke
6cfb2e9d4a
Resolve fips specific metricbeat and filebeat libs for ES fips image (#126312)
Also updated DRA handling to reflect resolving fips specific artifacts
2025-04-05 06:47:30 +11:00
Lorenzo Dematté
40dd91b800
[Entitlements] Replace Permissions with Entitlements in InstallPluginAction (#125207)
This PR replaces the parsing and formatting of SecurityManager policies with the parsing and formatting of Entitlements policy during plugin installation.

Relates to ES-10923
2025-04-02 11:03:27 +01:00
Rene Groeschke
611f5cba4f
[BUILD] Support AARCH64 for docker fips images (#125927)
This updates the docker fips base image which support arm and x84
architectures
2025-03-31 22:41:04 +11:00
Rene Groeschke
9dd0228990
Fix fips tests (#125754)
reported as broken due to issue in gradle setup
2025-03-27 21:31:50 +11:00
Rene Groeschke
653c179b08
[Build] Add FIPS docker image for GovCloud (#117152)
- Adds docker image based on chainguard base fips image
- x86 only for now as the base image is x86 only
- the image does not provide any elasticsearch.yml configuration. for testing purposes you can follow the elasticsearch fips guide available at https://github.com/elastic/FIPSGuide/tree/main/elasticsearch

The image is shipped with:
- org.bouncycastle:bc-fips:1.0.2.5 and org.bouncycastle:bctls-fips:1.0.19 in Elasticsearch libs folder
- config/jvm.options.d/fips.options for fips specific JVM options
- fips_java.security file
- fips_java.policy

Out of scope:
- Add packaging test coverage (part of later PR as we want to provide that image for testing early and packaging tests require more general restructuring for support fips scenarios)
2025-03-26 16:15:15 +01:00
Lorenzo Dematté
e0b7c8bdfc
[Entitlements] Print a warning during plugin installation if a legacy policy file is found (#125294)
This PR adds a check and a warning message if the user is trying to install a plugin containing the legacy plugin-security.policy used by SecurityManager.

Relates to ES-10846
2025-03-24 08:29:52 +01:00
Armin Braun
50437e79d3
Cleanup missing use of StandardCharsets (#125424)
Random annoyance that I figured, I'd just fix globally:
We can do a bit of a cleaner job when doing byte <-> string conversion here and there.
2025-03-21 20:10:15 +01:00
Lorenzo Dematté
a4d7297944
Permanently switch from SecurityManager to Entitlements (#124865) (#125117)
The JDK team has completely disabled the Java SecurityManager from Java 24. Elasticsearch has always used the Java SecurityManager as an additional protection mechanism; in order to retain this second line of defense, the Elasticsearch Core/Infra team has been working on the Entitlements project.

Similar to SecurityManager, Entitlements only allow calling specific methods in the JDK when the caller has a matching policy attached. In other words, if some code (in the main Elasticsearch codebase, in a plugin/module, or in a script) attempts to perform a "privileged" operation and it is not entitled to do so, a NotEntitledException will be thrown.

This PR includes the minimal set of changes to always use Entitlements, regardless of system properties or Java version.

Relates to ES-10921
2025-03-18 18:38:45 +02:00
Ryan Ernst
11961730da
Cleanup command line setting errors (#124963)
This commit improves the error cases when command line settings are
found that are duplicates or conflict with special system properties.
2025-03-18 09:38:14 -07:00
Luigi Dell'Aquila
f3ed9b3a2d
ES|QL query log (#124094) 2025-03-18 16:31:55 +01:00
Ryan Ernst
789eb2fadb
Log system information early during startup (#124926)
Information about the system, and in particular the running JVM, is
logged relatively late in startup. When problems occur in low level
initialization, it is often useful to have this information. This commit
moves logging of system information to right after logging has been
initialized. Note that it no longer utilizes the JvmInfo class as most
was already easily available and the static init of JvmInfo does a lot.
2025-03-15 14:55:02 +00:00
Ryan Ernst
aeee44f2a5
Ignore _JAVA_OPTIONS (#124843)
The JVM has a couple ways that Java options can be passed. In
Elasticsearch we ignore these common patterns, instead using our own
bespoke mechanisms for setting options (ES_JAVA_OPTS, etc). The primary
reason for this is some systems like Ubuntu setting these options
globally and then affecting Elasticsearch, often in ways that cause
Elasticsearch to fail to start.

This commit ignores _JAVA_OPTIONS, which is a little known environment
variable that the JVM may pick up options from.
2025-03-15 14:53:37 +00:00
Ryan Ernst
47454df24e
Ensure we always use vectorization in Lucene (#124914)
By default Lucene only uses vectorization up to the JDK version
available at the time of its release. When testing against EA versions,
we want to still use vectorization. This commit adds a sysprop to force
lucene to use the current version for vectorization.
2025-03-14 20:08:15 +00:00
Mark Vieira
74ccd4dba2
Filter module-info.class from entitlements-bridge jar in distribution (#124580) 2025-03-11 13:37:03 -07:00
Julien Mailleret
e5cf597782
Fix IronBank hardening_manifest CI test (#124579)
This commit fix the IronBank hardening_manifest CI test that expect the
hardening_manifest.yaml values to match `'^(?!\\s*$)[ -~|]*$'` regex:

```
| hardening_manifest           | ERROR    | Hardening Manifest failed jsonschema validation
| hardening_manifest           | ERROR    | Verify Hardening Manifest content
| hardening_manifest           | ERROR    | 'Rene Gröschke' does not match '^(?!\\s*$)[ -~|]*$'
```

43219286

cc @breskeby 

<!-- Thank you for your interest in and contributing to Elasticsearch!
There are a few simple things to check before submitting your pull
request that can help with the review process. You should delete these
items from your submission, but they are here to help bring them to your
attention. -->

- Have you signed the [contributor license agreement](https://www.elastic.co/contributor-agreement)?
- Have you followed the [contributor guidelines](https://github.com/elastic/elasticsearch/blob/main/CONTRIBUTING.md)?
- If submitting code, have you built your formula locally prior to submission with `gradle check`?
- If submitting code, is your pull request against main? Unless there is a good reason otherwise, we prefer pull requests against main and will backport as needed.
- If submitting code, have you checked that your submission is for an [OS and architecture that we support](https://www.elastic.co/support/matrix#show_os)?
- If you are submitting this code for a class then read our [policy](https://github.com/elastic/elasticsearch/blob/main/CONTRIBUTING.md#contributing-as-part-of-a-class) for that.
2025-03-12 06:22:10 +11:00
Joe Gallo
f8ef78446a
Upgrade httpclient to 5.3.3 for build-tools-internal (#124018) 2025-03-07 11:43:15 -05:00
Rene Groeschke
496c38e5a5
Reapply "Update Gradle wrapper to 8.13 (#122421)" (#123889) (#123896)
This reverts commit 36660f2e5f.
2025-03-05 08:02:13 +01:00
Mark Vieira
d61b86477d
Add jdk.management.agent module to server boot layer on start (#123938) 2025-03-04 11:32:42 -08:00
Rene Groeschke
36660f2e5f
Revert "Update Gradle wrapper to 8.13 (#122421)" (#123889)
This reverts commit e19b2264af.
2025-03-03 15:51:07 +01:00
Rene Groeschke
e19b2264af
Update Gradle wrapper to 8.13 (#122421)
* Fix Gradle Deprecation warning as declaring an is- property with a Boolean type has been deprecated.
* Make use of new layout.settingsFolder api to address some cross project references
* Fix buildParams snapshot check for multiprojet projects
2025-03-03 14:10:00 +01:00
Arpad Kiraly
196e083502
Remove @UpdateForV9 usages that are related to security manager removal (#123690)
* Remove @UpdateForV9 annotation in RuntimeVersionFeature

Re ES-10338 the Core/Infra team agreed that this is not blocked on security manager removal. We should go ahead and remove these 2 instances of the @UpdateForV9 annotation, the code will be cleaned up soon with the removal of Security Manager.

* Remove @UpdateForV9 annotation from SystemJvmOptions

re ES-10338 the Core/Infra team agreed this is not blocked on security manager removal. We should go ahead and remove this instance of the @UpdateForV9 annotation.
2025-03-03 11:34:46 +01:00
Rene Groeschke
cd8fbab5b5
Fix some early tasks creations (#123637)
We want to use the task avoidance api whereever possible and delay task
creation
2025-02-28 07:54:01 +11:00
Ryan Ernst
b5e482bc91
Enable entitlements by default (#122907)
Entitlements are almost complete. This commit enables them by default,
in preparation for 8.18/9.0.
2025-02-25 09:58:39 -08:00