forked from cisagov/Malcolm
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work in progress in converting to opensearch (see #54)
- Loading branch information
Showing
54 changed files
with
348 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM alpine:3.14 | ||
FROM alpine:3.14 | ||
|
||
# Copyright (c) 2020 Battelle Energy Alliance, LLC. All rights reserved. | ||
LABEL maintainer="[email protected]" | ||
|
@@ -23,8 +23,8 @@ ENV TERM xterm | |
ARG ARKIME_INDEX_PATTERN="sessions2-*" | ||
ARG ARKIME_INDEX_PATTERN_ID="sessions2-*" | ||
ARG ARKIME_INDEX_TIME_FIELD="firstPacket" | ||
ARG CREATE_ES_ARKIME_SESSION_INDEX="true" | ||
ARG ELASTICSEARCH_URL="http://elasticsearch:9200" | ||
ARG CREATE_OS_ARKIME_SESSION_INDEX="true" | ||
ARG OPENSEARCH_URL="http://opensearch:9200" | ||
ARG ISM_SNAPSHOT_COMPRESSED=false | ||
ARG ISM_SNAPSHOT_REPO=logs | ||
ARG KIBANA_OFFLINE_REGION_MAPS_PORT="28991" | ||
|
@@ -33,8 +33,8 @@ ARG KIBANA_URL="http://kibana:5601/kibana" | |
ENV ARKIME_INDEX_PATTERN $ARKIME_INDEX_PATTERN | ||
ENV ARKIME_INDEX_PATTERN_ID $ARKIME_INDEX_PATTERN_ID | ||
ENV ARKIME_INDEX_TIME_FIELD $ARKIME_INDEX_TIME_FIELD | ||
ENV CREATE_ES_ARKIME_SESSION_INDEX $CREATE_ES_ARKIME_SESSION_INDEX | ||
ENV ELASTICSEARCH_URL $ELASTICSEARCH_URL | ||
ENV CREATE_OS_ARKIME_SESSION_INDEX $CREATE_OS_ARKIME_SESSION_INDEX | ||
ENV OPENSEARCH_URL $OPENSEARCH_URL | ||
ENV ISM_SNAPSHOT_COMPRESSED $ISM_SNAPSHOT_COMPRESSED | ||
ENV ISM_SNAPSHOT_REPO $ISM_SNAPSHOT_REPO | ||
ENV KIBANA_OFFLINE_REGION_MAPS_PORT $KIBANA_OFFLINE_REGION_MAPS_PORT | ||
|
@@ -53,8 +53,8 @@ ADD kibana/scripts /data/ | |
ADD kibana/supervisord.conf /etc/supervisord.conf | ||
ADD kibana/zeek_template.json /data/zeek_template.json | ||
ADD shared/bin/docker-uid-gid-setup.sh /usr/local/bin/ | ||
ADD shared/bin/elastic_search_status.sh /data/ | ||
ADD shared/bin/elastic_index_size_prune.py /data/ | ||
ADD shared/bin/opensearch_status.sh /data/ | ||
ADD shared/bin/opensearch_index_size_prune.py /data/ | ||
|
||
RUN apk --no-cache add bash python3 py3-pip curl procps psmisc npm shadow jq && \ | ||
npm install -g http-server && \ | ||
|
@@ -72,7 +72,7 @@ RUN apk --no-cache add bash python3 py3-pip curl procps psmisc npm shadow jq && | |
chown -R ${PUSER}:${PGROUP} /opt/kibana/dashboards /opt/maps /data/init && \ | ||
chmod 755 /data/*.sh /data/*.py /data/init && \ | ||
chmod 400 /opt/maps/* && \ | ||
(echo -e "*/2 * * * * /data/kibana-create-moloch-sessions-index.sh\n0 10 * * * /data/kibana_index_refresh.py --template zeek_template\n*/20 * * * * /data/elastic_index_size_prune.py" > ${SUPERCRONIC_CRONTAB}) | ||
(echo -e "*/2 * * * * /data/kibana-create-moloch-sessions-index.sh\n0 10 * * * /data/kibana_index_refresh.py --template zeek_template\n*/20 * * * * /data/opensearch_index_size_prune.py" > ${SUPERCRONIC_CRONTAB}) | ||
|
||
EXPOSE $KIBANA_OFFLINE_REGION_MAPS_PORT | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM amazon/opendistro-for-elasticsearch:1.13.2 | ||
FROM opensearchproject/opensearch:1.0.0 | ||
|
||
# Copyright (c) 2021 Battelle Energy Alliance, LLC. All rights reserved. | ||
LABEL maintainer="[email protected]" | ||
|
@@ -7,45 +7,44 @@ LABEL org.opencontainers.image.url='https://github.com/idaholab/Malcolm' | |
LABEL org.opencontainers.image.documentation='https://github.com/idaholab/Malcolm/blob/master/README.md' | ||
LABEL org.opencontainers.image.source='https://github.com/idaholab/Malcolm' | ||
LABEL org.opencontainers.image.vendor='Idaho National Laboratory' | ||
LABEL org.opencontainers.image.title='malcolmnetsec/elasticsearch-od' | ||
LABEL org.opencontainers.image.description='Malcolm container providing Elasticsearch (the Apache-licensed Open Distro variant)' | ||
LABEL org.opencontainers.image.title='malcolmnetsec/opensearch' | ||
LABEL org.opencontainers.image.description='Malcolm container providing OpenSearch' | ||
|
||
ARG DEFAULT_UID=1000 | ||
ARG DEFAULT_GID=1000 | ||
ENV DEFAULT_UID $DEFAULT_UID | ||
ENV DEFAULT_GID $DEFAULT_GID | ||
ENV PUID $DEFAULT_UID | ||
ENV PUSER "elasticsearch" | ||
ENV PGROUP "elasticsearch" | ||
ENV PUSER "opensearch" | ||
ENV PGROUP "opensearch" | ||
ENV PUSER_PRIV_DROP true | ||
|
||
ENV TERM xterm | ||
|
||
ARG GITHUB_OAUTH_TOKEN="" | ||
ARG DISABLE_INSTALL_DEMO_CONFIG=true | ||
ENV DISABLE_INSTALL_DEMO_CONFIG $DISABLE_INSTALL_DEMO_CONFIG | ||
ENV JAVA_HOME=/usr/share/elasticsearch/jdk | ||
ENV JAVA_HOME=/usr/share/opensearch/jdk | ||
|
||
USER root | ||
|
||
# Malcolm manages authentication and encryption via NGINX reverse proxy | ||
# https://opendistro.github.io/for-elasticsearch-docs/docs/security/configuration/disable/ | ||
# https://opendistro.github.io/for-elasticsearch-docs/docs/install/docker/#customize-the-docker-image | ||
# https://github.com/opendistro-for-elasticsearch/opendistro-build/issues/613 | ||
RUN yum install -y openssl && \ | ||
/usr/share/elasticsearch/bin/elasticsearch-plugin remove opendistro_security && \ | ||
echo -e 'cluster.name: "docker-cluster"\nnetwork.host: 0.0.0.0' > /usr/share/elasticsearch/config/elasticsearch.yml && \ | ||
chown -R $PUSER:$PGROUP /usr/share/elasticsearch/config/elasticsearch.yml && \ | ||
sed -i "s/user=1000\b/user=%(ENV_PUID)s/g" /usr/share/elasticsearch/plugins/opendistro-performance-analyzer/pa_config/supervisord.conf && \ | ||
sed -i "s/user=1000\b/user=%(ENV_PUID)s/g" /usr/share/elasticsearch/performance-analyzer-rca/pa_config/supervisord.conf && \ | ||
sed -i '/[^#].*\/usr\/share\/elasticsearch\/bin\/elasticsearch.*/i /usr/local/bin/jdk-cacerts-auto-import.sh || true' /usr/local/bin/docker-entrypoint.sh | ||
/usr/share/opensearch/bin/opensearch-plugin remove opensearch-security && \ | ||
echo -e 'cluster.name: "docker-cluster"\nnetwork.host: 0.0.0.0' > /usr/share/opensearch/config/opensearch.yml && \ | ||
chown -R $PUSER:$PGROUP /usr/share/opensearch/config/opensearch.yml && \ | ||
sed -i "s/user=1000\b/user=%(ENV_PUID)s/g" /usr/share/opensearch/plugins/opensearch-performance-analyzer/pa_config/supervisord.conf && \ | ||
sed -i "s/user=1000\b/user=%(ENV_PUID)s/g" /usr/share/opensearch/performance-analyzer-rca/pa_config/supervisord.conf && \ | ||
sed -i '/[^#].*\$OPENSEARCH_HOME\/bin\/opensearch.*/i /usr/local/bin/jdk-cacerts-auto-import.sh || true' /usr/share/opensearch/opensearch-docker-entrypoint.sh | ||
|
||
|
||
# just used for initial keystore creation | ||
ADD shared/bin/docker-uid-gid-setup.sh /usr/local/bin/ | ||
ADD shared/bin/jdk-cacerts-auto-import.sh /usr/local/bin/ | ||
|
||
USER root | ||
|
||
ENTRYPOINT ["/usr/local/bin/docker-uid-gid-setup.sh"] | ||
|
||
CMD ["/usr/local/bin/docker-entrypoint.sh"] | ||
CMD ["/usr/share/opensearch/opensearch-docker-entrypoint.sh"] | ||
|
||
# to be populated at build-time: | ||
ARG BUILD_DATE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.