From 30dcb3405867e3746a84535cfbd16f36585b87bd Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Thu, 25 Mar 2021 11:34:30 +0100 Subject: [PATCH] Update to Elastic Stack 7.12.0 --- Dockerfile | 4 ++-- README.md | 8 ++++---- hardening_manifest.yaml | 12 ++++++------ scripts/docker-entrypoint | 9 +++++++-- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 439b936..ecc8b97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ ARG BASE_TAG=8.3 FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} as prep_files -ARG ELASTIC_STACK=7.11.1 +ARG ELASTIC_STACK=7.12.0 ARG ELASTIC_PRODUCT=elastic-agent ARG OS_AND_ARCH=linux-x86_64 @@ -87,4 +87,4 @@ ENV ELASTIC_PRODUCT=${ELASTIC_PRODUCT} ENTRYPOINT ["/tinit", "--", "/usr/local/bin/docker-entrypoint"] CMD ["--environment", "container"] -HEALTHCHECK --interval=10s --timeout=5s --start-period=1m --retries=5 CMD test -w '/tmp/elastic-agent/default/metricbeat/metricbeat.sock' +HEALTHCHECK --interval=10s --timeout=5s --start-period=1m --retries=5 CMD test -w '/tmp/elastic-agent/elastic-agent.sock' diff --git a/README.md b/README.md index 049b144..7bf89ef 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ **elastic-agent** is a single, unified way to add monitoring for logs, metrics, and other types of data to each host. A single agent makes it easier and faster to deploy monitoring across your infrastructure. The agent’s single, unified configuration makes it easier to add integrations for new data sources. For more information about elastic-agent, please visit -https://www.elastic.co/guide/en/ingest-management/7.11/index.html. +https://www.elastic.co/guide/en/ingest-management/7.12/index.html. --- **NOTE** @@ -14,7 +14,7 @@ This functionality is in beta and is subject to change. The design and code is l ### Installation instructions -Please follow the documentation on [Quick start](https://www.elastic.co/guide/en/ingest-management/7.11/ingest-management-getting-started.html). +Please follow the documentation on [Quick start](https://www.elastic.co/guide/en/ingest-management/7.12/ingest-management-getting-started.html). ### Where to file issues and PRs @@ -37,9 +37,9 @@ visiting [Elastic Community](https://www.elastic.co/community). This software is governed by the [Elastic -License](https://github.com/elastic/elasticsearch/blob/7.11/licenses/ELASTIC-LICENSE.txt), +License](https://github.com/elastic/elasticsearch/blob/7.12/licenses/ELASTIC-LICENSE.txt), and includes the full set of [free features](https://www.elastic.co/subscriptions). View the detailed release notes -[here](https://www.elastic.co/guide/en/beats/libbeat/current/release-notes-7.11.1.html). +[here](https://www.elastic.co/guide/en/beats/libbeat/current/release-notes-7.12.1.html). diff --git a/hardening_manifest.yaml b/hardening_manifest.yaml index a8d6bb0..d91f0ee 100644 --- a/hardening_manifest.yaml +++ b/hardening_manifest.yaml @@ -8,7 +8,7 @@ name: "elastic/beats/elastic-agent" # The most specific version should be the first tag and will be shown # on ironbank.dsop.io tags: -- "7.11.1" +- "7.12.0" - "latest" # Build args passed to Dockerfile ARGs @@ -16,7 +16,7 @@ args: BASE_IMAGE: "redhat/ubi/ubi8" BASE_TAG: "8.3" BASE_REGISTRY: registry1.dsop.io - ELASTIC_STACK: "7.11.1" + ELASTIC_STACK: "7.12.0" ELASTIC_PRODUCT: "elastic-agent" # Docker image labels @@ -30,7 +30,7 @@ labels: org.opencontainers.image.url: "https://www.elastic.co/products/beats/elastic-agent" ## Name of the distributing entity, organization or individual org.opencontainers.image.vendor: "Elastic" - org.opencontainers.image.version: "7.11.1" + org.opencontainers.image.version: "7.12.0" ## Keywords to help with search (ex. "cicd,gitops,golang") mil.dso.ironbank.image.keywords: "log,metrics,monitoring,observabilty,o11y,oblt,beats,elastic,elasticsearch,golang" ## This value can be "opensource" or "commercial" @@ -40,11 +40,11 @@ labels: # List of resources to make available to the offline build context resources: -- filename: elastic-agent-7.11.1-linux-x86_64.tar.gz - url: https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-7.11.1-linux-x86_64.tar.gz +- filename: elastic-agent-7.12.0-linux-x86_64.tar.gz + url: https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-7.12.0-linux-x86_64.tar.gz validation: type: sha512 - value: ec30fb58d7e5ff5d16044a0810ebd3919b70fb04d908c971ee4a0d10a49d184e6c0e96aec800b9839d6ff6fe70aaf109f78970104c77c03cde84d78daedf6072 + value: 2b3b0d0b39ab7c26dbea6d3dfd3f29538d10312fa7fa5a314ea252fc549e438a91ac31ed373c5bf486e74a9e8e6be1e80b20c2e5c54cae23786270cbfe3cf35c - filename: tinit url: https://github.com/krallin/tini/releases/download/v0.19.0/tini-amd64 validation: diff --git a/scripts/docker-entrypoint b/scripts/docker-entrypoint index 83b8cb2..630a14e 100644 --- a/scripts/docker-entrypoint +++ b/scripts/docker-entrypoint @@ -50,7 +50,12 @@ function enroll(){ exit $exitCode fi log $enrollResp - local apikeyId=$(echo $enrollResp | jq -r '.list[0].id') + local apikeyId=$(echo $enrollResp | jq -r '.list[] | select((.name | startswith("Default ")) and (.active == true)) | .id') + + if [[ -z "${apikeyId}" ]]; then + echo "Default agent policy was not found. Please consider using own enrollment token (FLEET_ENROLLMENT_TOKEN)." + exit 1 + fi log $apikeyId echo "Enroll Agent" @@ -73,7 +78,7 @@ function enroll(){ insecure_flag="--insecure" fi - elastic-agent enroll ${insecure_flag} ${KIBANA_HOST:-http://localhost:5601} $apikey -f + elastic-agent enroll ${insecure_flag} -f --url=${KIBANA_HOST:-http://localhost:5601} --enrollment-token=$apikey } if [[ -n "${FLEET_SETUP}" ]] && [[ ${FLEET_SETUP} == 1 ]]; then setup; fi -- GitLab