Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/go_modules/golang.org/x/mod-0.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
giautm authored Dec 21, 2023
2 parents 95bb79b + cb7dcdc commit 2e07db3
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/push-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,15 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@7b7aa264d83dc58691451798b4d117d53d21edfe
with:
image-ref: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH,MEDIUM'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'
47 changes: 47 additions & 0 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2023 The Atlas Operator Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Trivy
on:
schedule:
- cron: '44 21 * * 4'
workflow_dispatch:
permissions:
contents: read
jobs:
build:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Build
runs-on: "ubuntu-20.04"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build an image from Dockerfile
run: |
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/atlas-operator:${{ github.sha }} .
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@7b7aa264d83dc58691451798b4d117d53d21edfe
with:
image-ref: '${{ secrets.DOCKERHUB_USERNAME }}/atlas-operator:${{ github.sha }}'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH,MEDIUM'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

# Build the manager binary
FROM golang:1.21-alpine as builder
FROM golang:1.21.5-alpine as builder
ARG TARGETOS
ARG TARGETARCH
ARG OPERATOR_VERSION
Expand Down Expand Up @@ -43,7 +43,7 @@ RUN --mount=type=cache,target=/go/pkg/mod \

FROM arigaio/atlas:latest-alpine as atlas

FROM alpine:3.17.3
FROM alpine:3.19.0
WORKDIR /
COPY --from=builder /workspace/manager .
COPY --from=atlas /atlas .
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/ariga/atlas-operator

go 1.21

toolchain go1.21.2
toolchain go1.21.5

require (
ariga.io/atlas v0.15.1-0.20231119120023-a36a5859611e
Expand Down

0 comments on commit 2e07db3

Please sign in to comment.