forked from envoyproxy/gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from tetrateio/fips
Build and test fips images
- Loading branch information
Showing
3 changed files
with
240 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
name: "FIPS Release" | ||
|
||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- "v*.*.*" | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
PLATFORMS: "linux_amd64" | ||
IMAGE_PLATFORMS: "linux/amd64" | ||
|
||
jobs: | ||
lint: | ||
runs-on: [self-hosted, linux, x64] | ||
steps: | ||
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | ||
- uses: ./tools/github-actions/setup-deps | ||
- uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0 | ||
with: | ||
version: v3.5.0 | ||
# Generate the install manifests first so it can checked | ||
# for errors while running `make -k lint` | ||
- run: make generate-manifests | ||
- run: make lint-deps | ||
- run: make -k lint | ||
|
||
gen-check: | ||
runs-on: [self-hosted, linux, x64] | ||
steps: | ||
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | ||
- uses: ./tools/github-actions/setup-deps | ||
- uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0 | ||
with: | ||
version: v3.5.0 | ||
- run: make -k gen-check | ||
|
||
license-check: | ||
runs-on: [self-hosted, linux, x64] | ||
steps: | ||
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | ||
- uses: ./tools/github-actions/setup-deps | ||
- run: make -k licensecheck | ||
|
||
coverage-test: | ||
runs-on: [self-hosted, linux, x64] | ||
steps: | ||
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | ||
- uses: ./tools/github-actions/setup-deps | ||
|
||
# test | ||
- name: Run Coverage Tests | ||
run: make go.test.coverage | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # v3.1.5 | ||
with: | ||
fail_ci_if_error: false | ||
files: ./coverage.xml | ||
name: codecov-envoy-gateway | ||
verbose: true | ||
|
||
build: | ||
runs-on: [self-hosted, linux, x64] | ||
needs: [lint, gen-check, license-check, coverage-test] | ||
steps: | ||
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | ||
- uses: ./tools/github-actions/setup-deps | ||
|
||
- name: Build EG Multiarch Binaries | ||
run: make build-multiarch PLATFORMS=${{ env.PLATFORMS }} | ||
|
||
- name: Upload EG Binaries | ||
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 | ||
with: | ||
name: envoy-gateway | ||
path: bin/ | ||
|
||
# Enable once https://github.com/tetrateio/gateway/issues/15 is completed | ||
conformance-test: | ||
runs-on: [self-hosted, linux, x64] | ||
needs: [build] | ||
strategy: | ||
matrix: | ||
version: [ v1.26.14, v1.27.11, v1.28.7, v1.29.2 ] | ||
steps: | ||
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | ||
- uses: ./tools/github-actions/setup-deps | ||
- uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0 | ||
with: | ||
version: v3.5.0 | ||
- name: Download EG Binaries | ||
uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5 | ||
with: | ||
name: envoy-gateway | ||
path: bin/ | ||
- name: Give Privileges To EG Binaries | ||
run: chmod +x bin/linux/amd64/envoy-gateway | ||
|
||
# conformance | ||
# - name: Run Standard Conformance Tests | ||
# env: | ||
# KIND_NODE_TAG: ${{ matrix.version }} | ||
# IMAGE_PULL_POLICY: IfNotPresent | ||
# run: make conformance | ||
|
||
e2e-test: | ||
runs-on: [self-hosted, linux, x64] | ||
needs: [build] | ||
strategy: | ||
matrix: | ||
version: [ v1.26.14, v1.27.11, v1.28.7, v1.29.2 ] | ||
steps: | ||
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | ||
- uses: ./tools/github-actions/setup-deps | ||
- uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0 | ||
with: | ||
version: v3.5.0 | ||
- name: Download EG Binaries | ||
uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5 | ||
with: | ||
name: envoy-gateway | ||
path: bin/ | ||
- name: Give Privileges To EG Binaries | ||
run: chmod +x bin/linux/amd64/envoy-gateway | ||
|
||
# E2E | ||
# - name: Run E2E Tests | ||
# env: | ||
# KIND_NODE_TAG: ${{ matrix.version }} | ||
# IMAGE_PULL_POLICY: IfNotPresent | ||
# run: make e2e | ||
|
||
publish: | ||
runs-on: [self-hosted, linux, x64] | ||
needs: [conformance-test, e2e-test] | ||
steps: | ||
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | ||
- uses: ./tools/github-actions/setup-deps | ||
|
||
- name: Download EG Binaries | ||
uses: actions/download-artifact@8caf195ad4b1dee92908e23f56eeb0696f1dd42d # v4.1.5 | ||
with: | ||
name: envoy-gateway | ||
path: bin/ | ||
|
||
- name: Give Privileges To EG Binaries | ||
run: chmod +x bin/linux/amd64/envoy-gateway | ||
|
||
- name: Setup Multiarch Environment | ||
if: github.event_name == 'push' | ||
run: make image.multiarch.setup | ||
|
||
- name: Extract Release Tag | ||
id: vars | ||
shell: bash | ||
run: echo "release_tag=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV | ||
|
||
# build and push image | ||
- name: Login to Cloudsmith Registry | ||
if: github.event_name == 'push' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: docker.cloudsmith.io | ||
username: ${{ secrets.CLOUDSMITH_USERNAME }} | ||
password: ${{ secrets.CLOUDSMITH_SECRET }} | ||
|
||
- name: Build and Push TEG Commit Image to Cloudsmith Registry | ||
if: github.event_name == 'push' | ||
# tag is set to the short SHA of the commit | ||
run: make image.push.multiarch TAG=${{ env.release_tag }} PLATFORMS=${{ env.PLATFORMS }} IMAGE_PLATFORMS=${{ env.IMAGE_PLATFORMS }} IMAGE=fips-containers.teg.tetratelabs.com/gateway |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
binary=$1 | ||
|
||
echo "Checking whether compiled binaries have BoringSSL enabled ..." | ||
echo "* checking ${binary} ..." | ||
|
||
echo " * checking 'go version' ..." | ||
if ! go version "${binary}" | grep 'X:boringcrypto' ; then | ||
echo " ! 'go version <binary>' returned value without 'X:boringcrypto': $(go version "${binary}")" | ||
exit 2 | ||
fi | ||
|
||
echo " * checking 'strings' ..." | ||
if ! strings "${binary}" | grep --quiet '_Cfunc__goboringcrypto_' ; then | ||
echo " ! 'strings <binary>' did not return expected BoringSSL symbol names" | ||
exit 2 | ||
fi | ||
|
||
echo " + BoringSSL is enabled in ${binary}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters