Skip to content

Commit

Permalink
fixes to remove redundant targetplatform from docker images; also sta…
Browse files Browse the repository at this point in the history
…rting to integrate hartip parsers idaholab#561
  • Loading branch information
mmguero committed Sep 16, 2024
1 parent 54e887c commit d619840
Show file tree
Hide file tree
Showing 25 changed files with 35 additions and 64 deletions.
6 changes: 2 additions & 4 deletions Dockerfiles/api.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} python:3-slim-bookworm as builder
FROM python:3-slim-bookworm as builder

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
Expand All @@ -20,7 +18,7 @@ WORKDIR /usr/src/app
RUN python3 -m pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels -r requirements.txt \
&& flake8 --ignore=E203,E501,F401,W503

FROM --platform=${TARGETPLATFORM} python:3-slim-bookworm
FROM python:3-slim-bookworm

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="malcolm@inl.gov"
Expand Down
4 changes: 1 addition & 3 deletions Dockerfiles/arkime.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
ARG TARGETPLATFORM=linux/amd64

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.

FROM --platform=${TARGETPLATFORM} debian:12-slim
FROM debian:12-slim

LABEL maintainer="malcolm@inl.gov"
LABEL org.opencontainers.image.authors='malcolm@inl.gov'
Expand Down
4 changes: 1 addition & 3 deletions Dockerfiles/dashboards-helper.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} debian:12-slim
FROM debian:12-slim

# Copyright (c) 2020 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="malcolm@inl.gov"
Expand Down
4 changes: 1 addition & 3 deletions Dockerfiles/dashboards.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} opensearchproject/opensearch-dashboards:2.16.0
FROM opensearchproject/opensearch-dashboards:2.16.0

LABEL maintainer="malcolm@inl.gov"
LABEL org.opencontainers.image.authors='malcolm@inl.gov'
Expand Down
4 changes: 1 addition & 3 deletions Dockerfiles/dirinit.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} alpine:3.20
FROM alpine:3.20

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="malcolm@inl.gov"
Expand Down
4 changes: 1 addition & 3 deletions Dockerfiles/file-monitor.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} debian:12-slim
FROM debian:12-slim

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="malcolm@inl.gov"
Expand Down
6 changes: 2 additions & 4 deletions Dockerfiles/file-upload.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} debian:12-slim AS npmget
FROM debian:12-slim AS npmget

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.

Expand All @@ -17,7 +15,7 @@ RUN apt-get -q update && \
filepond-plugin-file-rename \
@jcubic/tagger

FROM --platform=${TARGETPLATFORM} debian:12-slim AS runtime
FROM debian:12-slim AS runtime

LABEL maintainer="malcolm@inl.gov"
LABEL org.opencontainers.image.authors='malcolm@inl.gov'
Expand Down
4 changes: 1 addition & 3 deletions Dockerfiles/filebeat.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} docker.elastic.co/beats/filebeat-oss:8.15.1
FROM docker.elastic.co/beats/filebeat-oss:8.15.1

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="malcolm@inl.gov"
Expand Down
4 changes: 1 addition & 3 deletions Dockerfiles/freq.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} debian:12-slim
FROM debian:12-slim

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="malcolm@inl.gov"
Expand Down
4 changes: 1 addition & 3 deletions Dockerfiles/htadmin.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} debian:11-slim
FROM debian:11-slim

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="malcolm@inl.gov"
Expand Down
4 changes: 1 addition & 3 deletions Dockerfiles/logstash.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} docker.elastic.co/logstash/logstash-oss:8.15.1
FROM docker.elastic.co/logstash/logstash-oss:8.15.1

LABEL maintainer="malcolm@inl.gov"
LABEL org.opencontainers.image.authors='malcolm@inl.gov'
Expand Down
4 changes: 1 addition & 3 deletions Dockerfiles/netbox.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} netboxcommunity/netbox:v4.0.11
FROM netboxcommunity/netbox:v4.0.11

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="malcolm@inl.gov"
Expand Down
6 changes: 2 additions & 4 deletions Dockerfiles/nginx.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
# tiredofit/docker-nginx-ldap - https://github.com/tiredofit/docker-nginx-ldap/blob/master/Dockerfile

####################################################################################
ARG TARGETPLATFORM=linux/amd64

# first build documentation with jekyll
FROM --platform=${TARGETPLATFORM} ghcr.io/mmguero-dev/jekyll:latest as docbuild
FROM ghcr.io/mmguero-dev/jekyll:latest as docbuild

ARG GITHUB_TOKEN
ARG VCS_REVISION
Expand All @@ -34,7 +32,7 @@ RUN find /site -type f -name "*.md" -exec sed -i "s/{{[[:space:]]*site.github.bu
find /site/_site -type f -name "*.html" -exec sed -i 's@\(href=\)"/"@\1"/readme/"@g' "{}" \;

# build NGINX image
FROM --platform=${TARGETPLATFORM} alpine:3.20
FROM alpine:3.20

LABEL maintainer="malcolm@inl.gov"
LABEL org.opencontainers.image.authors='malcolm@inl.gov'
Expand Down
4 changes: 1 addition & 3 deletions Dockerfiles/opensearch.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} opensearchproject/opensearch:2.16.0
FROM opensearchproject/opensearch:2.16.0

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="malcolm@inl.gov"
Expand Down
4 changes: 1 addition & 3 deletions Dockerfiles/pcap-capture.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} debian:12-slim
FROM debian:12-slim

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="malcolm@inl.gov"
Expand Down
4 changes: 1 addition & 3 deletions Dockerfiles/pcap-monitor.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} debian:12-slim
FROM debian:12-slim

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="malcolm@inl.gov"
Expand Down
4 changes: 1 addition & 3 deletions Dockerfiles/postgresql.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} postgres:16-alpine
FROM postgres:16-alpine

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="malcolm@inl.gov"
Expand Down
4 changes: 1 addition & 3 deletions Dockerfiles/redis.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} redis:7-alpine
FROM redis:7-alpine

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="malcolm@inl.gov"
Expand Down
4 changes: 1 addition & 3 deletions Dockerfiles/suricata.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} debian:12-slim
FROM debian:12-slim

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="malcolm@inl.gov"
Expand Down
6 changes: 2 additions & 4 deletions Dockerfiles/zeek.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG TARGETPLATFORM=linux/amd64

FROM --platform=${TARGETPLATFORM} debian:12-slim
FROM debian:12-slim

# Copyright (c) 2024 Battelle Energy Alliance, LLC. All rights reserved.
LABEL maintainer="malcolm@inl.gov"
Expand Down Expand Up @@ -175,7 +173,7 @@ RUN groupadd --gid ${DEFAULT_GID} ${PUSER} && \

# sanity checks to make sure the plugins installed and copied over correctly
# these ENVs should match the third party scripts/plugins installed by zeek_install_plugins.sh
ENV ZEEK_THIRD_PARTY_PLUGINS_GREP "(Zeek::Spicy|ANALYZER_SPICY_OSPF|ANALYZER_SPICY_OPENVPN_UDP\b|ANALYZER_SPICY_IPSEC_UDP\b|ANALYZER_SPICY_TFTP|ANALYZER_SPICY_WIREGUARD|ANALYZER_SYNCHROPHASOR_TCP|ANALYZER_GENISYS_TCP|ANALYZER_SPICY_GE_SRTP|ANALYZER_SPICY_PROFINET_IO_CM|ANALYZER_S7COMM_TCP|Corelight::PE_XOR|ICSNPP::BACnet|ICSNPP::BSAP|ICSNPP::ENIP|ICSNPP::ETHERCAT|ICSNPP::OPCUA_Binary|Salesforce::GQUIC|Zeek::PROFINET|Zeek::TDS)"
ENV ZEEK_THIRD_PARTY_PLUGINS_GREP "(Zeek::Spicy|ANALYZER_SPICY_OSPF|ANALYZER_SPICY_OPENVPN_UDP\b|ANALYZER_SPICY_IPSEC_UDP\b|ANALYZER_SPICY_TFTP|ANALYZER_SPICY_WIREGUARD|ANALYZER_SPICY_HART_IP|ANALYZER_SYNCHROPHASOR_TCP|ANALYZER_GENISYS_TCP|ANALYZER_SPICY_GE_SRTP|ANALYZER_SPICY_PROFINET_IO_CM|ANALYZER_S7COMM_TCP|Corelight::PE_XOR|ICSNPP::BACnet|ICSNPP::BSAP|ICSNPP::ENIP|ICSNPP::ETHERCAT|ICSNPP::OPCUA_Binary|Salesforce::GQUIC|Zeek::PROFINET|Zeek::TDS)"
ENV ZEEK_THIRD_PARTY_SCRIPTS_GREP "(bro-is-darknet/main|bro-simple-scan/scan|bzar/main|callstranger-detector/callstranger|cve-2020-0601/cve-2020-0601|cve-2020-13777/cve-2020-13777|CVE-2020-16898/CVE-2020-16898|CVE-2021-38647/omigod|CVE-2021-31166/detect|CVE-2021-41773/CVE_2021_41773|CVE-2021-42292/main|cve-2021-44228/CVE_2021_44228|cve-2022-22954/main|cve-2022-26809/main|CVE-2022-3602/__load__|hassh/hassh|http-more-files-names/main|ja4/main|pingback/detect|ripple20/ripple20|SIGRed/CVE-2020-1350|zeek-EternalSafety/main|zeek-httpattacks/main|zeek-sniffpass/__load__|zerologon/main)\.(zeek|bro)"

RUN mkdir -p /tmp/logs && \
Expand Down
1 change: 1 addition & 0 deletions config/zeek.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ ZEEK_DISABLE_ICS_ENIP=
ZEEK_DISABLE_ICS_ETHERCAT=
ZEEK_DISABLE_ICS_GENISYS=true
ZEEK_DISABLE_ICS_GE_SRTP=true
ZEEK_DISABLE_ICS_HART_IP=
ZEEK_DISABLE_ICS_OPCUA_BINARY=
ZEEK_DISABLE_ICS_MODBUS=
ZEEK_DISABLE_ICS_PROFINET=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ global disable_ics_enip = (getenv("ZEEK_DISABLE_ICS_ENIP") == true_regex) ? T :
global disable_ics_ethercat = (getenv("ZEEK_DISABLE_ICS_ETHERCAT") == true_regex) ? T : F;
global disable_ics_genisys = (getenv("ZEEK_DISABLE_ICS_GENISYS") == true_regex) ? T : F;
global disable_ics_ge_srtp = (getenv("ZEEK_DISABLE_ICS_GE_SRTP") == true_regex) ? T : F;
global disable_ics_hart_ip = (getenv("ZEEK_DISABLE_ICS_HART_IP") == true_regex) ? T : F;
global disable_ics_opcua_binary = (getenv("ZEEK_DISABLE_ICS_OPCUA_BINARY") == true_regex) ? T : F;
global disable_ics_modbus = (getenv("ZEEK_DISABLE_ICS_MODBUS") == true_regex) ? T : F;
global disable_ics_profinet = (getenv("ZEEK_DISABLE_ICS_PROFINET") == true_regex) ? T : F;
Expand Down Expand Up @@ -148,6 +149,9 @@ event zeek_init() &priority=-5 {
if (disable_ics_all || disable_ics_ge_srtp) {
Spicy::disable_protocol_analyzer(Analyzer::ANALYZER_SPICY_GE_SRTP_TCP);
}
if (disable_ics_all || disable_ics_hart_ip) {
Spicy::disable_protocol_analyzer(Analyzer::ANALYZER_SPICY_HART_IP);
}
if (disable_ics_all || disable_ics_opcua_binary) {
Analyzer::disable_analyzer(Analyzer::ANALYZER_ICSNPP_OPCUA_BINARY);
}
Expand Down
1 change: 1 addition & 0 deletions hedgehog-iso/interface/sensor_ctl/control_vars.conf
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export ZEEK_DISABLE_ICS_ENIP=
export ZEEK_DISABLE_ICS_ETHERCAT=
export ZEEK_DISABLE_ICS_GENISYS=true
export ZEEK_DISABLE_ICS_GE_SRTP=true
export ZEEK_DISABLE_ICS_HART_IP=
export ZEEK_DISABLE_ICS_OPCUA_BINARY=
export ZEEK_DISABLE_ICS_MODBUS=
export ZEEK_DISABLE_ICS_PROFINET=
Expand Down
1 change: 1 addition & 0 deletions shared/bin/zeek_install_plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ ZKG_GITHUB_URLS=(
"https://github.com/cisagov/icsnpp-ethercat"
"https://github.com/cisagov/icsnpp-ge-srtp"
"https://github.com/cisagov/icsnpp-genisys"
"https://github.com/cisagov/icsnpp-hart-ip"
"https://github.com/cisagov/icsnpp-modbus"
"https://github.com/cisagov/icsnpp-opcua-binary"
"https://github.com/cisagov/icsnpp-profinet-io-cm"
Expand Down
4 changes: 4 additions & 0 deletions zeek/config/local.zeek
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ global disable_ics_enip = (getenv("ZEEK_DISABLE_ICS_ENIP") == true_regex) ? T :
global disable_ics_ethercat = (getenv("ZEEK_DISABLE_ICS_ETHERCAT") == true_regex) ? T : F;
global disable_ics_genisys = (getenv("ZEEK_DISABLE_ICS_GENISYS") == true_regex) ? T : F;
global disable_ics_ge_srtp = (getenv("ZEEK_DISABLE_ICS_GE_SRTP") == true_regex) ? T : F;
global disable_ics_hart_ip = (getenv("ZEEK_DISABLE_ICS_HART_IP") == true_regex) ? T : F;
global disable_ics_opcua_binary = (getenv("ZEEK_DISABLE_ICS_OPCUA_BINARY") == true_regex) ? T : F;
global disable_ics_modbus = (getenv("ZEEK_DISABLE_ICS_MODBUS") == true_regex) ? T : F;
global disable_ics_profinet = (getenv("ZEEK_DISABLE_ICS_PROFINET") == true_regex) ? T : F;
Expand Down Expand Up @@ -148,6 +149,9 @@ event zeek_init() &priority=-5 {
if (disable_ics_all || disable_ics_ge_srtp) {
Spicy::disable_protocol_analyzer(Analyzer::ANALYZER_SPICY_GE_SRTP_TCP);
}
if (disable_ics_all || disable_ics_hart_ip) {
Spicy::disable_protocol_analyzer(Analyzer::ANALYZER_SPICY_HART_IP);
}
if (disable_ics_all || disable_ics_opcua_binary) {
Analyzer::disable_analyzer(Analyzer::ANALYZER_ICSNPP_OPCUA_BINARY);
}
Expand Down

0 comments on commit d619840

Please sign in to comment.