Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nr 341878 use reusable workflow for docker image security checks #101

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 21 additions & 29 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,26 @@ on:
push:
branches:
- master

env:
TEST_IMAGE: "newrelic/nri-statsd:nightly"
DOCKER_IMAGE_TAG: "nightly"
workflow_dispatch:
inputs:
reason:
description: 'Manual Trigger To Test The Workflow'
required: false
type: string

jobs:
trivy_scanner:
name: Security scanner for docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.OHAI_DOCKER_HUB_ID }}
password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }}

- name: Build image
run: |
make build/docker-amd64 DOCKER_IMAGE_TAG=${{ env.DOCKER_IMAGE_TAG }}

- name: Run Trivy to check Docker image for vulnerabilities
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ env.TEST_IMAGE }}
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: "CRITICAL,HIGH"
nightly:
uses: newrelic/coreint-automation/.github/workflows/reusable_nightly.yaml@v3
secrets:
docker_username: ${{ secrets.OHAI_DOCKER_HUB_ID }}
docker_password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }}
with:
docker_image: newrelic/nri-statsd
docker_tag: nightly
target_branches: "master"
build_command: |
make build/docker-amd64 DOCKER_IMAGE_TAG=nightly
setup_qemu: false
setup_buildx: false
setup_go: false
trivy_scan: true
2 changes: 1 addition & 1 deletion .github/workflows/push_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ jobs:

- name: Running integration tests
run: |
make integration-tests-${{ matrix.arch }}
make integration-tests-${{ matrix.arch }}
Loading