Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docker/templates/Dockerfile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ RUN mkdir -p /usr/share/logstash/config/security
RUN cp /usr/share/logstash/x-pack/distributions/internal/observabilitySRE/config/security/java.security /usr/share/logstash/config/security/ && \
chown --recursive logstash:root /usr/share/logstash/config/security/

# Copy additional JVM options and append to existing jvm.options
RUN cp /usr/share/logstash/x-pack/distributions/internal/observabilitySRE/config/fips-jvm.options /tmp/fips-jvm.options && \
chown logstash:root /tmp/fips-jvm.options
# 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.

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 && \

rm /tmp/fips-jvm.options

# list the classes provided by the fips BC
RUN find /usr/share/logstash -name *.jar | grep lib

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# FIPS config to be appended to /usr/share/logstash/config/jvm.options
-Djava.security.properties=/usr/share/logstash/config/security/java.security
-Djavax.net.ssl.trustStore=/usr/share/logstash/config/security/cacerts.bcfks
-Djavax.net.ssl.trustStoreType=BCFKS
-Djavax.net.ssl.trustStoreProvider=BCFIPS
-Djavax.net.ssl.trustStorePassword=changeit
-Dssl.KeyManagerFactory.algorithm=PKIX
-Dssl.TrustManagerFactory.algorithm=PKIX
-Dorg.bouncycastle.fips.approved_only=true