Skip to content

Commit

Permalink
Enable Platform-Security GitHub Workflow (#75)
Browse files Browse the repository at this point in the history
* Enable Platform-Security GitHub Workflow

* Remove high vulns in base image

* Update Dockerfile

update dockerfile to the use the latest image for builder as well

* Update Dockerfile

---------

Co-authored-by: Keith Walsh <[email protected]>
Co-authored-by: Rajagopalan Ranganathan <[email protected]>
  • Loading branch information
3 people authored May 29, 2024
1 parent 44e953a commit 5185003
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 3 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/security-scanning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# The default values used in the docker build commands are the root
# directory '.' and the dockerfile name of 'Dockerfile'. If there is
# a need to change these do so in your local workflow template (this file) and
# change them there. HINT: Look at the bottom of this file.

# This workflow checks out code, builds an image, performs a container image
# vulnerability scan with Anchore's Grype tool, and generates an
# SBOM via Anchore's Syft tool

# For more information on Anchore's container image scanning tool Grype, see
# https://github.com/anchore/grype

# For more information about the Anchore SBOM tool, Syft, see
# https://github.com/anchore/syft

name: ConsoleDot Platform Security Scan

on:
push:
branches: [ "main", "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main", "master" ]

jobs:
PlatSec-Security-Workflow:
uses: RedHatInsights/platform-security-gh-workflow/.github/workflows/platsec-security-scan-reusable-workflow.yml@master
## The optional parameters below are used if you are using something other than the
## the defaults of root '.' for the path and 'Dockerfile' for the Dockerfile name.
## Additionally, if you have a Dockerfile you use as your BASE_IMG or you need to
## use '--build-arg', those can be define below as well.

# with:
# dockerbuild_path: './buildtest'
# dockerfile_path: './test'
# dockerfile_name: 'Dockerfile.main'
# base_image_build: true
# base_dockerbuild_path: './testbuild.base'
# base_dockerfile_path: './test'
# base_dockerfile_name: 'Dockerfile.base'
# build_arg: '--build-arg BASE_IMAGE="localbuild/baseimage:latest"'
# only_fixed: true
# fail_on_vulns: true
# severity_fail_cutoff: high
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10-896.1716497715 AS builder
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10 AS builder

ARG TARGETARCH
USER root
RUN microdnf install -y tar gzip make which
Expand All @@ -12,10 +13,11 @@ WORKDIR /workspace

COPY . ./

RUN go mod vendor
RUN go mod vendor
RUN make build

FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10-896.1716497715
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10


COPY --from=builder /workspace/bin/ciam-rebac /usr/local/bin/
COPY --from=builder /workspace/configs/config.yaml /usr/local/bin/
Expand Down

0 comments on commit 5185003

Please sign in to comment.