Skip to content

Commit ae982a4

Browse files
CSPL-3434: Update dockerfile to work with al2023 base image (#1441)
* update dockerfile to work with al2023 base image * clean up
1 parent 5cd2ddb commit ae982a4

File tree

5 files changed

+24
-108
lines changed

5 files changed

+24
-108
lines changed

.github/workflows/arm-AL2023-build-test-push-workflow-AL2023.yml

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -104,60 +104,8 @@ jobs:
104104
env:
105105
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
106106
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
107-
vulnerability-scan:
108-
permissions:
109-
actions: read
110-
contents: read
111-
security-events: write
112-
runs-on: ubuntu-latest
113-
needs: build-operator-image-arm-al2023
114-
env:
115-
SPLUNK_ENTERPRISE_IMAGE: ${{ secrets.SPLUNK_ENTERPRISE_IMAGE }}
116-
SPLUNK_OPERATOR_IMAGE_NAME: splunk/splunk-operator
117-
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
118-
S3_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
119-
IMAGE_NAME: ${{ secrets.ECR_REPOSITORY }}/splunk/splunk-operator:${{ github.sha }}
120-
steps:
121-
- name: Set up cosign
122-
uses: sigstore/cosign-installer@main
123-
- uses: actions/checkout@v2
124-
- name: Dotenv Action
125-
id: dotenv
126-
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
127-
- name: Set up Docker Buildx
128-
uses: docker/setup-buildx-action@v2.5.0
129-
- name: Configure AWS credentials
130-
uses: aws-actions/configure-aws-credentials@v1
131-
with:
132-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
133-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
134-
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
135-
136-
- name: Login to Amazon ECR
137-
uses: aws-actions/amazon-ecr-login@v1
138-
- name: Pull Splunk Operator Image Locally
139-
run: |
140-
docker pull ${{ env.IMAGE_NAME }}
141-
- name: Verify Signed Splunk Operator image
142-
run: |
143-
cosign verify --key env://COSIGN_PUBLIC_KEY ${{ env.IMAGE_NAME }}
144-
env:
145-
COSIGN_PUBLIC_KEY: ${{ secrets.COSIGN_PUBLIC_KEY }}
146-
- name: Run Trivy vulnerability scanner
147-
uses: aquasecurity/trivy-action@master
148-
with:
149-
image-ref: '${{ env.IMAGE_NAME }}'
150-
format: sarif
151-
#exit-code: 1
152-
severity: 'CRITICAL'
153-
ignore-unfixed: true
154-
output: 'trivy-results.sarif'
155-
- name: Upload Trivy scan results to GitHub Security tab
156-
uses: github/codeql-action/upload-sarif@v3
157-
with:
158-
sarif_file: 'trivy-results.sarif'
159107
smoke-tests-arm-al2023:
160-
needs: vulnerability-scan
108+
needs: build-operator-image-arm-al2023
161109
strategy:
162110
fail-fast: false
163111
matrix:

.github/workflows/arm-Ubuntu-build-test-push-workflow.yml

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -104,60 +104,8 @@ jobs:
104104
env:
105105
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
106106
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
107-
vulnerability-scan:
108-
permissions:
109-
actions: read
110-
contents: read
111-
security-events: write
112-
runs-on: ubuntu-latest
113-
needs: build-operator-image-arm-ubuntu
114-
env:
115-
SPLUNK_ENTERPRISE_IMAGE: ${{ secrets.SPLUNK_ENTERPRISE_IMAGE }}
116-
SPLUNK_OPERATOR_IMAGE_NAME: splunk/splunk-operator
117-
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
118-
S3_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
119-
IMAGE_NAME: ${{ secrets.ECR_REPOSITORY }}/splunk/splunk-operator:${{ github.sha }}
120-
steps:
121-
- name: Set up cosign
122-
uses: sigstore/cosign-installer@main
123-
- uses: actions/checkout@v2
124-
- name: Dotenv Action
125-
id: dotenv
126-
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
127-
- name: Set up Docker Buildx
128-
uses: docker/setup-buildx-action@v2.5.0
129-
- name: Configure AWS credentials
130-
uses: aws-actions/configure-aws-credentials@v1
131-
with:
132-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
133-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
134-
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
135-
136-
- name: Login to Amazon ECR
137-
uses: aws-actions/amazon-ecr-login@v1
138-
- name: Pull Splunk Operator Image Locally
139-
run: |
140-
docker pull ${{ env.IMAGE_NAME }}
141-
- name: Verify Signed Splunk Operator image
142-
run: |
143-
cosign verify --key env://COSIGN_PUBLIC_KEY ${{ env.IMAGE_NAME }}
144-
env:
145-
COSIGN_PUBLIC_KEY: ${{ secrets.COSIGN_PUBLIC_KEY }}
146-
- name: Run Trivy vulnerability scanner
147-
uses: aquasecurity/trivy-action@master
148-
with:
149-
image-ref: '${{ env.IMAGE_NAME }}'
150-
format: sarif
151-
#exit-code: 1
152-
severity: 'CRITICAL'
153-
ignore-unfixed: true
154-
output: 'trivy-results.sarif'
155-
- name: Upload Trivy scan results to GitHub Security tab
156-
uses: github/codeql-action/upload-sarif@v3
157-
with:
158-
sarif_file: 'trivy-results.sarif'
159107
smoke-tests-arm-ubuntu:
160-
needs: vulnerability-scan
108+
needs: build-operator-image-arm-ubuntu
161109
strategy:
162110
fail-fast: false
163111
matrix:

.github/workflows/build-test-push-workflow.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: Build and Test
2-
on: push
2+
on:
3+
pull_request: {}
4+
push:
5+
branches:
6+
- main
7+
- develop
38
jobs:
49
check-formating:
510
runs-on: ubuntu-latest

.github/workflows/distroless-build-test-push-workflow.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: Build and Test Distroless
2-
on: push
2+
on:
3+
pull_request: {}
4+
push:
5+
branches:
6+
- main
7+
- develop
38
jobs:
49
check-formating:
510
runs-on: ubuntu-latest
@@ -149,6 +154,7 @@ jobs:
149154
# with:
150155
# sarif_file: 'trivy-results.sarif'
151156
smoke-tests:
157+
needs: build-operator-image
152158
strategy:
153159
fail-fast: false
154160
matrix:

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ RUN if grep -q 'Ubuntu' /etc/os-release; then \
4848
update-ca-certificates && \
4949
unattended-upgrades -v && \
5050
apt-get clean && rm -rf /var/lib/apt/lists/*; \
51+
elif grep -q 'Amazon Linux' /etc/os-release; then \
52+
yum -y install shadow-utils && \
53+
useradd -ms /bin/bash nonroot -u 1001 && \
54+
yum install -y ca-certificates && \
55+
update-ca-trust && \
56+
yum update -y krb5-libs && yum clean all && \
57+
yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical && \
58+
yum -y update-minimal --security --sec-severity=Moderate && \
59+
yum -y update-minimal --security --sec-severity=Low; \
5160
else \
5261
microdnf -y install shadow-utils && \
5362
useradd -ms /bin/bash nonroot -u 1001 && \

0 commit comments

Comments
 (0)