Skip to content

Commit

Permalink
[SECCOMP-31580] - FIPS support
Browse files Browse the repository at this point in the history
[SECCOMP-31580] - FIPS support
  • Loading branch information
alxbxbx authored Dec 19, 2024
2 parents c29e860 + 9a2529a commit 673cf4b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
docker: ['scratch','ubi']
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
CGO_ENABLED: 1
GOEXPERIMENT: boringcrypto
name: ${{ matrix.docker }}
steps:
- name: Login to Quay.io
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
golangci:
name: lint
runs-on: ubuntu-latest
env:
CGO_ENABLED: 1
GOEXPERIMENT: boringcrypto
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions .promu.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
go:
# This must match .circle/config.yml.
version: 1.18
cgo: true
repository:
path: github.com/prometheus-community/elasticsearch_exporter
build:
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM quay.io/prometheus/golang-builder AS builder

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / Scan results for localbuild/elasticsearch-exporter:latest

warn dockerfile

warn dockerfile:instruction Dockerfile directive 'HEALTHCHECK' not found, matching condition 'not_exists' check

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / Scan results for localbuild/elasticsearch-exporter:latest

warn dockerfile

warn dockerfile:instruction Dockerfile directive 'USER' not found, matching condition 'not_exists' check

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / Scan results for localbuild/elasticsearch-exporter:latest

warn files

warn files:suid_or_guid_set SUID or SGID found set on file /usr/bin/chage. Mode: 0o104755

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / Scan results for localbuild/elasticsearch-exporter:latest

warn files

warn files:suid_or_guid_set SUID or SGID found set on file /usr/bin/gpasswd. Mode: 0o104755

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / Scan results for localbuild/elasticsearch-exporter:latest

warn files

warn files:suid_or_guid_set SUID or SGID found set on file /usr/bin/newgrp. Mode: 0o104755

ENV CGO_ENABLED=1
ENV GOEXPERIMENT=boringcrypto

ARG PROMU_VERSION=0.13.0
ADD https://github.com/prometheus/promu/releases/download/v${PROMU_VERSION}/promu-${PROMU_VERSION}.linux-amd64.tar.gz ./
RUN tar -xvzf promu-${PROMU_VERSION}.linux-amd64.tar.gz && mv promu-${PROMU_VERSION}.linux-amd64/promu /go/bin
Expand All @@ -8,7 +11,7 @@ ADD . /go/src/github.com/prometheus-community/elasticsearch_exporter
WORKDIR /go/src/github.com/prometheus-community/elasticsearch_exporter

RUN go mod download
RUN make
RUN make

FROM scratch AS scratch

Expand Down
3 changes: 3 additions & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ GO_VERSION ?= $(shell $(GO) version)
GO_VERSION_NUMBER ?= $(word 3, $(GO_VERSION))
PRE_GO_111 ?= $(shell echo $(GO_VERSION_NUMBER) | grep -E 'go1\.(10|[0-9])\.')

export CGO_ENABLED := 1
export GOEXPERIMENT := boringcrypto

PROMU := $(FIRST_GOPATH)/bin/promu
pkgs = ./...

Expand Down
6 changes: 4 additions & 2 deletions build/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ pipeline {
ARTIFACTORY_URL = 'docker.internal.sysdig.com'
EXPORTER = 'elasticsearch-exporter'
VERSION = '1.2.1'
CGO_ENABLED = '1'
GOEXPERIMENT = 'boringcrypto'
}

stages {
stage('Pull image from artifactory') {
steps {
script {
docker.withRegistry("https://${env.ARTIFACTORY_URL}", registryCredential) {
docker.withRegistry("https://${env.ARTIFACTORY_URL}", registryCredential) {
sh """docker pull ${env.ARTIFACTORY_URL}/${env.EXPORTER}:${env.VERSION}"""
sh """docker pull ${env.ARTIFACTORY_URL}/${env.EXPORTER}:${env.VERSION}-ubi"""
}
Expand All @@ -40,4 +42,4 @@ pipeline {
}
}
}
}
}
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (

"context"

_ "crypto/tls/fipsonly"

"github.com/go-kit/log/level"
"github.com/prometheus-community/elasticsearch_exporter/collector"
"github.com/prometheus-community/elasticsearch_exporter/pkg/clusterinfo"
Expand Down

0 comments on commit 673cf4b

Please sign in to comment.