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

Fips v1.5.1 #1

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ae9fdb4
docs: copy argo cd docs drop down fix (#2731)
zachaller Apr 28, 2023
1c225f9
docs: fix link to plugins for traffic routers (#2719)
zachaller Apr 14, 2023
b81d682
chore: bump k8s deps to v0.25.8 (#2712)
zachaller Apr 28, 2023
73e7ffb
fix(controller): Add klog logrus bridge. Fixes #2707. (#2701)
Sineaggi Apr 11, 2023
a402042
fix: change logic of analysis run to better handle errors (#2695)
zachaller Apr 28, 2023
ea685ce
fix(controller): Fix for rollouts getting stuck in loop (#2689)
zachaller May 1, 2023
5b61b73
fix: istio dropping fields during removing of managed routes (#2692)
zachaller May 5, 2023
bb30c9e
ci: use keyless signing for main and release branches (#2783)
34fathombelow May 17, 2023
0322914
fix: properly wrap Datadog API v2 request body (#2771) (#2775)
alexef May 14, 2023
839f05d
fix: make new alb fullName field optional for backward compatability…
zachaller May 24, 2023
3e2880f
KCS-46 | Add Dockerfile for FIPS
mugdha-adhav Feb 14, 2024
ec9b8ca
Add pipeline.yaml
mugdha-adhav Feb 21, 2024
785bf1e
Add Dockerfile.ci
mugdha-adhav Feb 21, 2024
9c4add4
Update Makefile and Dockerfile
mugdha-adhav Feb 22, 2024
6dcf218
Update Dockerfile.ci
mugdha-adhav Feb 26, 2024
6b764a2
Add safe directory in Dockerfile.ci
mugdha-adhav Feb 26, 2024
a9a0689
Skip code analysis
mugdha-adhav Feb 26, 2024
caeba3d
Ignore failures in security scan
mugdha-adhav Feb 26, 2024
95a5f4d
Provide reason for skipping security scan
mugdha-adhav Feb 26, 2024
8c71d60
Fix typo
mugdha-adhav Feb 26, 2024
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
43 changes: 43 additions & 0 deletions .acquia/Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM jfrog.ais.acquia.io/devops-pipeline/acq-aws:2 as fips-golang-builder

# Update packages
USER root
RUN yum makecache \
&& yum update -y \
&& yum install -y tar gcc git curl \
&& yum clean all \
&& rm -rf /var/cache/yum

ARG TARGETOS=linux
ARG TARGETARCH=amd64

# Install Go
ARG GOLANG_VERSION=1.20
RUN curl -LO "https://go.dev/dl/go${GOLANG_VERSION}.${TARGETOS}-${TARGETARCH}.tar.gz" && \
tar -C /usr/local -xzf "go${GOLANG_VERSION}.${TARGETOS}-${TARGETARCH}.tar.gz" && \
rm -f "go${GOLANG_VERSION}.${TARGETOS}-${TARGETARCH}.tar.gz" && \
ls -la /usr/local/go/bin && \
chmod +x /usr/local/go/bin/go

# Set Golang environment variables
ENV GOPATH="/go"
ENV GOROOT="/usr/local/go"
ENV GOBIN="${GOPATH}/bin"
ENV GO111MODULE="on"
ENV GOOS=${TARGETOS}
ENV GOARCH=${TARGETARCH}
ENV GOPRIVATE=github.com/acquia

# FIPS
ENV GOEXPERIMENT=boringcrypto
ENV CGO_ENABLED=1

# Add path to go binaries
ENV PATH="${PATH}:${GOROOT}/bin:${GOBIN}"

WORKDIR /argo-rollouts

RUN git config --global --add safe.directory '*'

# Perform the build
COPY . .
42 changes: 42 additions & 0 deletions .acquia/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
type: default
team: KCS
group: platform
service: argo-rollouts

# Validate the formatting of the pipeline.yaml file.
validate_config: true

environment_image:
file: ".acquia/Dockerfile.ci"
context: "."
build_args:
- secrets:
- type: vault
key: SSH_KEY
value: GIT_SSH_KEY
path: secret/pipeline-default/GIT_SSH_KEY

pre_build:
code_analysis:
required: false
check_fips:
- steps:
- cd /argo-rollouts
- make check-fips

build:
service_image:
- name: argo-rollouts/rollouts-controller
file: "Dockerfile-FIPS"
context: "."
build_args:
- secrets:
- type: vault
key: SSH_KEY
value: GIT_SSH_KEY
path: secret/pipeline-default/GIT_SSH_KEY

security_scan:
scanner: orca
ignore_failures: true
reason: This service is only used for building base FIPS complaint image
162 changes: 52 additions & 110 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,66 +9,42 @@ on:
# Run tests for any PRs.
pull_request:

permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions: {}

jobs:
docker:
set-vars:
permissions:
contents: read
runs-on: ubuntu-latest
outputs:
controller-meta-tags: ${{ steps.controller-meta.outputs.tags }}
plugin-meta-tags: ${{ steps.plugin-meta.outputs.tags }}
platforms: ${{ steps.platform-matrix.outputs.platform-matrix }}

steps:
- name: Checkout
uses: actions/[email protected]

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
config-inline: |
[worker.oci]
gc = false

- name: Docker meta (controller)
id: controller-meta
uses: docker/metadata-action@v4
with:
images: |
quay.io/argoproj/argo-rollouts
# ghcr.io/argoproj/argo-rollouts
tags: |
type=ref,event=branch
flavor: |
latest=${{ github.ref == 'refs/heads/master' }}
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/master'}}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}

- name: Docker meta (plugin)
id: plugin-meta
uses: docker/metadata-action@v4
with:
images: |
quay.io/argoproj/kubectl-argo-rollouts
# ghcr.io/argoproj/kubectl-argo-rollouts
tags: |
type=ref,event=branch
flavor: |
latest=${{ github.ref == 'refs/heads/master' }}

# - name: Login to GitHub Container Registry
# if: github.event_name != 'pull_request'
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Quay.io
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/master'}}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}

# avoid building linux/arm64 for PRs since it takes so long
- name: Set Platform Matrix
Expand All @@ -79,73 +55,39 @@ jobs:
then
PLATFORM_MATRIX=$PLATFORM_MATRIX,linux/arm64
fi
echo "::set-output name=platform-matrix::$PLATFORM_MATRIX"

- name: Build and push (controller-image)
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
with:
platforms: ${{ steps.platform-matrix.outputs.platform-matrix }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.controller-meta.outputs.tags }}
provenance: false
sbom: false

- name: Build and push (plugin-image)
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
with:
target: kubectl-argo-rollouts
platforms: ${{ steps.platform-matrix.outputs.platform-matrix }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.plugin-meta.outputs.tags }}
provenance: false
sbom: false

- name: Install cosign
uses: sigstore/cosign-installer@main
with:
cosign-release: 'v1.13.1'

- name: Install crane to get digest of image
uses: imjasonh/[email protected]

- name: Get digest of controller-image
run: |
if [[ "${{ github.ref == 'refs/heads/master' }}" ]]
then
echo "CONTROLLER_DIGEST=$(crane digest quay.io/argoproj/argo-rollouts:latest)" >> $GITHUB_ENV
fi
if [[ "${{ github.ref != 'refs/heads/master' }}" ]]
then
echo "CONTROLLER_DIGEST=$(crane digest ${{ steps.controller-meta.outputs.tags }})" >> $GITHUB_ENV
fi
if: github.event_name != 'pull_request'

- name: Get digest of plugin-image
run: |
if [[ "${{ github.ref == 'refs/heads/master' }}" ]]
then
echo "PLUGIN_DIGEST=$(crane digest quay.io/argoproj/kubectl-argo-rollouts:latest)" >> $GITHUB_ENV
fi
if [[ "${{ github.ref != 'refs/heads/master' }}" ]]
then
echo "PLUGIN_DIGEST=$(crane digest ${{ steps.plugin-meta.outputs.tags }})" >> $GITHUB_ENV
fi
if: github.event_name != 'pull_request'

- name: Sign Argo Rollouts Images
run: |
cosign sign --key env://COSIGN_PRIVATE_KEY quay.io/argoproj/argo-rollouts@${{ env.CONTROLLER_DIGEST }}
cosign sign --key env://COSIGN_PRIVATE_KEY quay.io/argoproj/kubectl-argo-rollouts@${{ env.PLUGIN_DIGEST }}
env:
COSIGN_PRIVATE_KEY: ${{secrets.COSIGN_PRIVATE_KEY}}
COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}}
if: ${{ github.event_name == 'push' }}

- name: Display the public key to share.
run: |
# Displays the public key to share
cosign public-key --key env://COSIGN_PRIVATE_KEY
env:
COSIGN_PRIVATE_KEY: ${{secrets.COSIGN_PRIVATE_KEY}}
COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}}
if: ${{ github.event_name == 'push' }}
echo "platform-matrix=$PLATFORM_MATRIX" >> $GITHUB_OUTPUT

build-and-push-controller-image:
needs: [set-vars]
permissions:
contents: read
packages: write # for pushing packages to GHCR, which is used by cd.apps.argoproj.io to avoid polluting Quay with tags
id-token: write # for creating OIDC tokens for signing.
uses: ./.github/workflows/image-reuse.yaml
with:
quay_image_name: ${{ needs.set-vars.outputs.controller-meta-tags }}
# Note: cannot use env variables to set go-version (https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations)
go-version: 1.19
platforms: ${{ needs.set-vars.outputs.platforms }}
push: ${{ github.event_name != 'pull_request' }}
secrets:
quay_username: ${{ secrets.QUAY_USERNAME }}
quay_password: ${{ secrets.QUAY_ROBOT_TOKEN }}

build-and-push-plugin-image:
needs: [set-vars]
permissions:
contents: read
packages: write # for pushing packages to GHCR, which is used by cd.apps.argoproj.io to avoid polluting Quay with tags
id-token: write # for creating OIDC tokens for signing.
uses: ./.github/workflows/image-reuse.yaml
with:
quay_image_name: ${{ needs.set-vars.outputs.plugin-meta-tags }}
# Note: cannot use env variables to set go-version (https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations)
go-version: 1.19
platforms: ${{ needs.set-vars.outputs.platforms }}
push: ${{ github.event_name != 'pull_request' }}
target: kubectl-argo-rollouts
secrets:
quay_username: ${{ secrets.QUAY_USERNAME }}
quay_password: ${{ secrets.QUAY_ROBOT_TOKEN }}
Loading