From c3da86c56347855b5fa16fa5905515bf54b97e96 Mon Sep 17 00:00:00 2001 From: Mike Schiessl <77062930+MikeSchiessl@users.noreply.github.com> Date: Tue, 16 Jul 2024 12:00:54 +0200 Subject: [PATCH] v1.7.5 (#64) ## v1.7.5 ||| |---|---| |Date|2024-07-16 |Kind| MINOR release |Author|mschiess@akamai.com - **Minor improvements** - Updated Command Line usage docs (ACC logs installation) - [docker] bumped GC-LOGS to version "0.0.5" - [docker] bumped CLI-EAA to version "0.6.10" - fixed the bug that crashed the EAA logs in ULS-Docker Container v1.7.4 - [docker] changed the privilege within the docker (installation as root - then dropping to unprivileged user) - fix for Openshift + adding higher security - changed the path for the .edgerc mock to uls/var (instead of uls/ext) --- Dockerfile | 25 +++++++++++++++---- bin/uls_config/global_config.py | 4 +-- docs/CHANGELOG.md | 16 ++++++++++++ docs/COMMAND_LINE_USAGE.md | 19 +++++++++++--- .../kubernetes/helm/akamai-uls/Chart.yaml | 2 +- scripts/get-uls.sh | 4 +-- 6 files changed, 57 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index ad2213d..2e5d055 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,9 @@ ARG ULS_DIR="$HOMEDIR/uls" ARG EXT_DIR="$ULS_DIR/ext" ARG ETP_CLI_VERSION="0.4.7" -ARG EAA_CLI_VERSION="0.6.9" +ARG EAA_CLI_VERSION="0.6.10" ARG MFA_CLI_VERSION="0.1.1" -ARG GC_CLI_VERSION="v0.0.4(beta)" +ARG GC_CLI_VERSION="v0.0.5" ARG LINODE_CLI_VERSION="dev" ARG ACC_CLI_VERSION="v0.0.1-alpha" @@ -33,17 +33,25 @@ RUN apt-get update && \ telnet \ gcc \ libssl-dev \ - libffi-dev && \ + libffi-dev \ + acl && \ rm -rf /var/lib/apt/lists/ + + # USER & GROUP RUN groupadd akamai && \ useradd -g akamai -s /bin/bash -m -d ${HOMEDIR} akamai -USER akamai +# Applying the root group to the akamai-uls directory to match openshift security requirements +#RUN setfacl -m g:root:rx ${HOMEDIR} && \ +# setfacl -dm g:root:rx ${HOMEDIR} + +# Installing now as root and switching later to the akamai user + WORKDIR ${HOMEDIR} RUN mkdir -p ${ULS_DIR} && \ - mkdir -p ${ULS_DIR}/var + mkdir -p ${ULS_DIR}/var && chmod 777 ${ULS_DIR}/var # Install ULS @@ -51,6 +59,7 @@ COPY bin/ ${ULS_DIR}/bin WORKDIR ${ULS_DIR} RUN pip3 install --no-cache-dir -r ${ULS_DIR}/bin/requirements.txt + # Install external CLI'S ## ETP CLI ENV ETP_CLI_VERSION=$ETP_CLI_VERSION @@ -83,6 +92,12 @@ ENV ACC_CLI_VERSION=$ACC_CLI_VERSION RUN git clone --depth 1 -b "${ACC_CLI_VERSION}" --single-branch https://github.com/MikeSchiessl/acc-logs.git ${EXT_DIR}/acc-logs && \ pip3 install --no-cache-dir -r ${EXT_DIR}/acc-logs/bin/requirements.txt + +# Preparing user - switch +#RUN chown -R akamai:root ${HOMEDIR} +USER akamai + + # ENTRYPOINTS / CMD VOLUME ["${ULS_DIR}/var"] ENTRYPOINT ["/usr/local/bin/python3","-u","bin/uls.py"] diff --git a/bin/uls_config/global_config.py b/bin/uls_config/global_config.py index 8557531..d0ba71e 100644 --- a/bin/uls_config/global_config.py +++ b/bin/uls_config/global_config.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # Common global variables / constants -__version__ = "1.7.4" +__version__ = "1.7.5" __tool_name_long__ = "Akamai Unified Log Streamer" __tool_name_short__ = "ULS" @@ -103,7 +103,7 @@ edgerc_gc = ["gc_username", "gc_password", "gc_hostname"] # Required for Guardicore edgerc_linode = ["linode_hostname", "linode_token"] # Required for Linode edgerc_documentation_url = "https://github.com/akamai/uls/blob/main/docs/AKAMAI_API_CREDENTIALS.md" -edgerc_mock_file = "ext/edgerc" # Required for display the version if no edgercfile was given +edgerc_mock_file = "var/edgerc" # Required for display the version if no edgercfile was given # Autoresume Configuration autoresume_checkpoint_path = "var/" # (Default) Path, where the checkpointfiles should be stored to diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index c6a4c3a..0ca0db2 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,4 +1,19 @@ # Version History +## v1.7.5 +||| +|---|---| +|Date|2024-07-16 +|Kind| MINOR release +|Author|mschiess@akamai.com + +- **Minor improvements** + - Updated Command Line usage docs (ACC logs installation) + - [docker] bumped GC-LOGS to version "0.0.5" + - [docker] bumped CLI-EAA to version "0.6.10" - fixed the bug that crashed the EAA logs in ULS-Docker Container v1.7.4 + - [docker] changed the privilege within the docker (installation as root - then dropping to unprivileged user) - fix for Openshift + adding higher security + - changed the path for the .edgerc mock to uls/var (instead of uls/ext) + +--- ## v1.7.4 ||| |---|---| @@ -16,6 +31,7 @@ - **BUGFIX** - Fixed a bug in the autoresume function where SIA does not equal it's alias ETP properly +--- ## v1.7.3 ||| diff --git a/docs/COMMAND_LINE_USAGE.md b/docs/COMMAND_LINE_USAGE.md index 3919e9c..89ee11a 100644 --- a/docs/COMMAND_LINE_USAGE.md +++ b/docs/COMMAND_LINE_USAGE.md @@ -72,13 +72,17 @@ pip3 install -r ext/cli-etp/requirements.txt git clone --depth 1 --single-branch https://github.com/akamai/cli-mfa.git ext/cli-mfa && \ pip3 install -r ext/cli-mfa/requirements.txt -# Guardicore Log-fetcher (experimental) +# Guardicore Log-fetcher (beta) git clone -q --depth 1 -b dev --single-branch https://github.com/MikeSchiessl/gc-logs.git ext/cli-gc && \ pip3 install -q -r ext/cli-gc/bin/requirements.txt -# Linode Log fetcher (experimental) +# Linode Log fetcher (alpha) git clone -q --depth 1 -b dev --single-branch https://github.com/MikeSchiessl/ln-logs.git ext/cli-linode && \ pip3 install -q -r ext/cli-linode/bin/requirements.txt + +# Akamai Control Center Events (experimental) +git clone -q --depth 1 -b dev --single-branch https://github.com/MikeSchiessl/acc-logs.git ext/acc-logs && \ +pip3 install -q -r ext/acc-logs/bin/requirements.txt ``` ### Setup the .EDGERC File @@ -124,8 +128,13 @@ All log output will be directed to STDOUT by default. ```bash python3 bin/uls.py --input sia --feed threat --output udp --host 10.10.10.200 --port 9090 &> /path/to/my/logfile & ``` - Rather consider [docker usage](./DOCKER_USAGE.md) instead of this + Rather consider [docker usage](./DOCKER_USAGE.md) instead of this + +- ACC EventViewer LOG ==> RAW with starting time + ```bash + python3 bin/uls.py --input ACC -f events --section default --starttime 1719852040 --output raw + ``` ## ULS as a service: systemd If you are planning to use multiple Akamai feed with ULS, bear in mind you will need to repeat the instruction below multiple times. We built this guide with CentOS 7. @@ -226,4 +235,8 @@ pip3 install -q -r ext/cli-etp/requirements.txt # MFA CLI (only if installed) git -C ext/cli-mfa pull -q pip3 install -q -r ext/cli-mfa/requirements.txt + +# ACC EventViewer (only if installed) +git -C ext/acc-logs pull -q +pip3 install -q -r ext/acc-logs/requirements.txt ``` diff --git a/docs/examples/kubernetes/helm/akamai-uls/Chart.yaml b/docs/examples/kubernetes/helm/akamai-uls/Chart.yaml index 23a775f..2811960 100644 --- a/docs/examples/kubernetes/helm/akamai-uls/Chart.yaml +++ b/docs/examples/kubernetes/helm/akamai-uls/Chart.yaml @@ -4,4 +4,4 @@ description: Akamai Universal Log Streamer Helm installation type: application version: 2.0.0 -appVersion: "1.7.4" +appVersion: "1.7.5" diff --git a/scripts/get-uls.sh b/scripts/get-uls.sh index 6f6c6c5..69f6242 100755 --- a/scripts/get-uls.sh +++ b/scripts/get-uls.sh @@ -209,10 +209,10 @@ echo "Installing ACC-CLI" pip3 install -q -r ${install_dir}/ext/cli-linode/bin/requirements.txt fi -## GRAB GC-CLI +## GRAB ACC-CLI if [[ "$install_modules" == *"gc"* ]] ; then echo "Installing ACC-CLI" - git clone -q --depth 1 -b dev --single-branch https://github.com/MikeSchiessl/gc-logs.git ${install_dir}/ext/acc-logs + git clone -q --depth 1 -b dev --single-branch https://github.com/MikeSchiessl/acc-logs.git ${install_dir}/ext/acc-logs py_reqs ${install_dir}/ext/acc-logs/bin/requirements.txt pip3 install -q -r ${install_dir}/ext/acc-logs/bin/requirements.txt fi