Skip to content

Conversation

donoghuc
Copy link
Member

Release notes

[rn:skip]

What does this PR do?

In addition to setting LS_JAVA_OPTS we now include the fips config java options in the /usr/share/logstash/config/jvm.options file. This ensures that if consumers of the image overwrite LS_JAVA_OPTS the fips config is still respected from jvm.options.

Related Issues

@github-actions
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify
Copy link
Contributor

mergify bot commented Aug 11, 2025

This pull request does not have a backport label. Could you fix it @donoghuc? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • If no backport is necessary, please add the backport-skip label

@donoghuc donoghuc added the backport-8.19 Automated backport to the 8.19 branch label Aug 11, 2025
In addition to setting `LS_JAVA_OPTS` we now include the fips config java
options in the `/usr/share/logstash/config/jvm.options` file. This ensures that
if consumers of the image overwrite `LS_JAVA_OPTS` the fips config is still
respected from `jvm.options`.
@donoghuc donoghuc force-pushed the fips-config-jvm-config branch from 7e41bfa to 51bdea0 Compare August 11, 2025 22:39
@donoghuc
Copy link
Member Author

Exhaustive test run https://buildkite.com/elastic/logstash-exhaustive-tests-pipeline/builds/2286 (note this will actually pull the already published observabilitySRE container).

# echos are for ensuring that the file ends with a newline
RUN echo "" >> /usr/share/logstash/config/jvm.options && \
echo "" >> /usr/share/logstash/config/jvm.options && \
cat /tmp/fips-jvm.options >> /usr/share/logstash/config/jvm.options && \
Copy link
Member

Choose a reason for hiding this comment

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

🤔 is there a reason we still set LS_JAVA_OPTS, if we are injecting the same settings into the config file? This means that by default the LS jvm will be invoked with doubled-up settings that are currently identical but from two different sources.

We already have the safety of LS plugin that prevents instantiation if these settings are not properly applied.

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, yeah i did not think that through. I think file only is probably best. I'll update. Good catch.

Comment on lines 122 to 124
RUN echo "" >> /usr/share/logstash/config/jvm.options && \
echo "" >> /usr/share/logstash/config/jvm.options && \
cat /tmp/fips-jvm.options >> /usr/share/logstash/config/jvm.options && \
Copy link
Member

Choose a reason for hiding this comment

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

nit: dry it up with a subshell?

Suggested change
RUN echo "" >> /usr/share/logstash/config/jvm.options && \
echo "" >> /usr/share/logstash/config/jvm.options && \
cat /tmp/fips-jvm.options >> /usr/share/logstash/config/jvm.options && \
RUN ( \
echo ""; echo ""; \
cat /tmp/fips-jvm.options \
) >> /usr/share/logstash/config/jvm.options && \

Stop setting LS_JAVA_OPTS in favor of jvm.options.
@elastic-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@donoghuc donoghuc requested a review from yaauie August 12, 2025 15:15
Copy link
Member

@yaauie yaauie left a comment

Choose a reason for hiding this comment

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

👍

@donoghuc donoghuc merged commit 64e6462 into elastic:main Aug 12, 2025
12 checks passed
mergify bot pushed a commit that referenced this pull request Aug 12, 2025
* Add fips config to jvm.options for observabilitySRE

In addition to setting `LS_JAVA_OPTS` we now include the fips config java
options in the `/usr/share/logstash/config/jvm.options` file. This ensures that
if consumers of the image overwrite `LS_JAVA_OPTS` the fips config is still
respected from `jvm.options`.

* *only* set jvm opts via jvm.options

Stop setting LS_JAVA_OPTS in favor of jvm.options.

* Use subshell to clean up file concat

Codereview suggestion

(cherry picked from commit 64e6462)
donoghuc added a commit that referenced this pull request Aug 12, 2025
* Add fips config to jvm.options for observabilitySRE

In addition to setting `LS_JAVA_OPTS` we now include the fips config java
options in the `/usr/share/logstash/config/jvm.options` file. This ensures that
if consumers of the image overwrite `LS_JAVA_OPTS` the fips config is still
respected from `jvm.options`.

* *only* set jvm opts via jvm.options

Stop setting LS_JAVA_OPTS in favor of jvm.options.

* Use subshell to clean up file concat

Codereview suggestion

(cherry picked from commit 64e6462)

Co-authored-by: Cas Donoghue <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-8.19 Automated backport to the 8.19 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants