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

Add prerelease for FIPS with testing and image creation #1992

Merged
merged 6 commits into from
Jan 13, 2025
Merged
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
12 changes: 6 additions & 6 deletions .github/workflows/component_canaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
runs-on: ubuntu-20.04
if: ${{ inputs.PLATFORM == 'macos' }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-east-2
Expand Down Expand Up @@ -68,10 +68,10 @@ jobs:
runs-on: ubuntu-20.04
if: ${{ inputs.PLATFORM == 'linux' }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-east-2
Expand Down Expand Up @@ -130,10 +130,10 @@ jobs:
runs-on: ubuntu-20.04
if: ${{ inputs.PLATFORM == 'windows' }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-east-2
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/component_docker_packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ on:
TAG:
required: true
type: string
FIPS:
required: false
type: boolean
default: false

env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Expand All @@ -29,6 +33,7 @@ env:
DOCKER_HUB_ID: ${{ secrets.DOCKER_HUB_ID }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
DOCKER_PUBLISH: true
FIPS: ${{ inputs.FIPS == true && '-fips' || '' }}

jobs:
packaging:
Expand All @@ -47,7 +52,7 @@ jobs:
password: ${{ env.DOCKER_HUB_PASSWORD }}

- name: Compiling binaries for linux amd64, arm, arm64
run: make ci/prerelease/linux-for-docker
run: make ci/prerelease/linux-for-docker${{env.FIPS}}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand All @@ -58,10 +63,10 @@ jobs:
version: v0.9.1

- name: Build and publish Release Candidate (RC) of base Docker image
run: AGENT_VERSION=${{env.TAG}} make -C build/container/ clean publish/multi-arch-base-rc
run: AGENT_VERSION=${{env.TAG}} FIPS=${{env.FIPS}} make -C build/container/ clean publish/multi-arch-base-rc

- name: Build and publish Release Candidate (RC) of forwarder Docker image
run: AGENT_VERSION=${{env.TAG}} make -C build/container/ clean publish/multi-arch-forwarder-rc
run: AGENT_VERSION=${{env.TAG}} FIPS=${{env.FIPS}} make -C build/container/ clean publish/multi-arch-forwarder-rc

- name: Build and publish Release Candidate (RC) of k8s-events-forwarders Docker image
run: AGENT_VERSION=${{env.TAG}} make -C build/container/ clean publish/multi-arch-k8s-events-forwarder-rc
run: AGENT_VERSION=${{env.TAG}} FIPS=${{env.FIPS}} make -C build/container/ clean publish/multi-arch-k8s-events-forwarder-rc
20 changes: 19 additions & 1 deletion .github/workflows/component_docker_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,22 @@ jobs:
run: make -C build/container/ clean publish/multi-arch-k8s-events-forwarder-tag AGENT_VERSION=${{env.TAG}}

- name: Publish latest of k8s-events-forwarders Docker image
run: make -C build/container/ clean publish/multi-arch-k8s-events-forwarder-latest AGENT_VERSION=${{env.TAG}}
run: make -C build/container/ clean publish/multi-arch-k8s-events-forwarder-latest AGENT_VERSION=${{env.TAG}}

- name: Publish tag of base Docker image FIPS
run: make -C build/container/ clean publish/multi-arch-base-tag AGENT_VERSION=${{env.TAG}} FIPS=${{env.FIPS}}

- name: Publish latest of base Docker image FIPS
run: make -C build/container/ clean publish/multi-arch-base-latest AGENT_VERSION=${{env.TAG}} FIPS=${{env.FIPS}}

- name: Publish tag of forwarder Docker image FIPS
run: make -C build/container/ clean publish/multi-arch-forwarder-tag AGENT_VERSION=${{env.TAG}} FIPS=${{env.FIPS}}

- name: Publish latest of forwarder Docker image FIPS
run: make -C build/container/ clean publish/multi-arch-forwarder-latest AGENT_VERSION=${{env.TAG}} FIPS=${{env.FIPS}}

- name: Publish tag of k8s-events-forwarders Docker image FIPS
run: make -C build/container/ clean publish/multi-arch-k8s-events-forwarder-tag AGENT_VERSION=${{env.TAG}} FIPS=${{env.FIPS}}

- name: Publish latest of k8s-events-forwarders Docker image FIPS
run: make -C build/container/ clean publish/multi-arch-k8s-events-forwarder-latest AGENT_VERSION=${{env.TAG}} FIPS=${{env.FIPS}}
7 changes: 7 additions & 0 deletions .github/workflows/component_linux_packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ on:
ARCH:
required: true
type: string
FIPS:
required: false
type: boolean
default: false

env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Expand All @@ -32,6 +36,7 @@ env:
DOCKER_HUB_ID: ${{ secrets.DOCKER_HUB_ID }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
ARCH: ${{ inputs.ARCH }}
FIPS: ${{ inputs.FIPS == true && '-fips' || '' }}

jobs:
packaging:
Expand All @@ -49,6 +54,8 @@ jobs:

- name: Preparing linux packages
run: make ci/prerelease/linux-${{ env.ARCH }}
env:
FIPS: ${{ env.FIPS }}

- name: Generate checksum files
uses: ./.github/actions/generate-checksums
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/component_linux_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ jobs:
- "targz"
- "deb"
- "rpm"
suffix:
- ""
- "-fips"

steps:
- name: Login to DockerHub
Expand All @@ -89,10 +92,10 @@ jobs:
uses: newrelic/[email protected]
with:
tag: ${{env.TAG}}
app_name: "newrelic-infra"
app_name: "newrelic-infra${{ matrix.suffix }}"
repo_name: "newrelic/infrastructure-agent"
schema: "custom"
schema_url: "https://raw.githubusercontent.com/newrelic/infrastructure-agent/${{ env.SCHEMA_BRANCH }}/build/upload-schema-linux-${{ matrix.assetsType }}.yml"
schema_url: "https://raw.githubusercontent.com/newrelic/infrastructure-agent/${{ env.SCHEMA_BRANCH }}/build/upload-schema-linux-${{ matrix.assetsType }}${{ matrix.suffix }}.yml"
aws_access_key_id: ${{ env.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws_s3_bucket_name: ${{ env.AWS_S3_BUCKET_NAME }}
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/component_molecule_packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,20 @@ jobs:
name: Test package installation
runs-on: ubuntu-latest
steps:
- uses: newrelic/pkg-installation-testing-action@v1
- name: Test NON-FIPS package installation
uses: newrelic/pkg-installation-testing-action@v1
with:
gpg_key: 'https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg'
repo_base_url: ${{ inputs.REPO_ENDPOINT }}
package_name: 'newrelic-infra'
package_version: ${{ inputs.TAG }}
platforms: "al2,al2023,debian-bullseye,debian-bookworm,redhat8,redhat9,suse15.3,suse15.4,suse15.5,suse15.6,ubuntu1604,ubuntu1804,ubuntu2004,ubuntu2204,ubuntu2404"
- name: Test FIPS package installation
uses: newrelic/pkg-installation-testing-action@v1
with:
gpg_key: 'https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg'
repo_base_url: ${{ inputs.REPO_ENDPOINT }}
package_name: 'newrelic-infra-fips'
exec_name: 'newrelic-infra'
package_version: ${{ inputs.TAG }}
platforms: "al2,al2023,debian-bullseye,debian-bookworm,redhat8,redhat9,suse15.3,suse15.4,suse15.5,suse15.6,ubuntu1604,ubuntu1804,ubuntu2004,ubuntu2204,ubuntu2404"
25 changes: 13 additions & 12 deletions .github/workflows/component_prerelease_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ jobs:
provision:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-east-2
Expand Down Expand Up @@ -79,10 +79,10 @@ jobs:
needs: [ provision ]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-east-2
Expand Down Expand Up @@ -120,13 +120,14 @@ jobs:
needs: [ harvest-tests ]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-east-2
role-duration-seconds: 7200

- name: Set branch name
run: |
Expand Down Expand Up @@ -154,10 +155,10 @@ jobs:
needs: [ harvest-tests ]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-east-2
Expand Down Expand Up @@ -188,10 +189,10 @@ jobs:
needs: [ packaging-tests-linux ]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-east-2
Expand Down Expand Up @@ -229,10 +230,10 @@ jobs:
needs: [ packaging-tests-windows ]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ASSUME_ROLE }}
aws-region: us-east-2
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/component_trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ on:
severity:
required: true
type: string
FIPS:
required: false
type: boolean
default: false

env:
FIPS: ${{ inputs.FIPS == true && '-fips' || '' }}

jobs:
trivy_scanner:
Expand All @@ -22,7 +29,7 @@ jobs:
- name: newrelic/infrastructure
uses: aquasecurity/trivy-action@master
with:
image-ref: "docker.io/newrelic/infrastructure:${{ inputs.tag }}"
image-ref: "docker.io/newrelic/infrastructure${{ env.FIPS }}:${{ inputs.tag }}"
format: 'table'
exit-code: '1'
ignore-unfixed: true
Expand All @@ -35,7 +42,7 @@ jobs:
- name: newrelic/k8s-events-forwarder
uses: aquasecurity/trivy-action@master
with:
image-ref: "docker.io/newrelic/k8s-events-forwarder:${{ inputs.tag }}"
image-ref: "docker.io/newrelic/k8s-events-forwarder${{ env.FIPS }}:${{ inputs.tag }}"
format: 'table'
exit-code: '1'
ignore-unfixed: true
Expand All @@ -48,7 +55,7 @@ jobs:
- name: newrelic/nri-forwarder
uses: aquasecurity/trivy-action@master
with:
image-ref: "docker.io/newrelic/nri-forwarder:${{ inputs.tag }}"
image-ref: "docker.io/newrelic/nri-forwarder${{ env.FIPS }}:${{ inputs.tag }}"
format: 'table'
exit-code: '1'
ignore-unfixed: true
Expand All @@ -69,7 +76,7 @@ jobs:
- name: Sarif newrelic/infrastructure
uses: aquasecurity/trivy-action@master
with:
image-ref: "docker.io/newrelic/infrastructure:${{ inputs.tag }}"
image-ref: "docker.io/newrelic/infrastructure${{ env.FIPS }}:${{ inputs.tag }}"
format: 'sarif'
output: 'trivy-results.sarif'
vuln-type: 'os,library'
Expand Down
54 changes: 53 additions & 1 deletion .github/workflows/prerelease_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ jobs:
with:
TAG: ${{ github.event.release.tag_name }}
ARCH: 'amd64'

packaging-amd64-fips:
needs: [unit-test, proxy-tests]
uses: ./.github/workflows/component_linux_packaging.yml
secrets:
DOCKER_HUB_ID: ${{secrets.OHAI_DOCKER_HUB_ID}}
DOCKER_HUB_PASSWORD: ${{secrets.OHAI_DOCKER_HUB_PASSWORD}}
GPG_MAIL: '[email protected]'
GPG_PASSPHRASE: ${{ secrets.OHAI_GPG_PASSPHRASE }}
GPG_PRIVATE_KEY_BASE64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
TAG: ${{ github.event.release.tag_name }}
ARCH: 'amd64'
FIPS: true

packaging-arm:
needs: [unit-test, proxy-tests]
Expand Down Expand Up @@ -60,6 +75,21 @@ jobs:
TAG: ${{ github.event.release.tag_name }}
ARCH: 'arm64'

packaging-arm64-fips:
needs: [unit-test, proxy-tests]
uses: ./.github/workflows/component_linux_packaging.yml
secrets:
DOCKER_HUB_ID: ${{secrets.OHAI_DOCKER_HUB_ID}}
DOCKER_HUB_PASSWORD: ${{secrets.OHAI_DOCKER_HUB_PASSWORD}}
GPG_MAIL: '[email protected]'
GPG_PASSPHRASE: ${{ secrets.OHAI_GPG_PASSPHRASE }}
GPG_PRIVATE_KEY_BASE64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
TAG: ${{ github.event.release.tag_name }}
ARCH: 'arm64'
FIPS: true

packaging-legacy:
needs: [unit-test, proxy-tests]
uses: ./.github/workflows/component_linux_packaging.yml
Expand Down Expand Up @@ -94,11 +124,33 @@ jobs:
tag: "${{ github.event.release.tag_name }}-rc"
severity: "CRITICAL"

packaging-docker-fips:
needs: [unit-test, proxy-tests]
uses: ./.github/workflows/component_docker_packaging.yml
secrets:
DOCKER_HUB_ID: ${{secrets.OHAI_DOCKER_HUB_ID}}
DOCKER_HUB_PASSWORD: ${{secrets.OHAI_DOCKER_HUB_PASSWORD}}
GPG_MAIL: '[email protected]'
GPG_PASSPHRASE: ${{ secrets.OHAI_GPG_PASSPHRASE }}
GPG_PRIVATE_KEY_BASE64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
TAG: ${{ github.event.release.tag_name }}
FIPS: true

docker-fips-trivy-critical:
needs: [packaging-docker-fips]
uses: ./.github/workflows/component_trivy.yml
with:
tag: "${{ github.event.release.tag_name }}-rc"
severity: "CRITICAL"
FIPS: true

publishing-to-s3:
# point to staging after tests
name: Publish linux artifacts into s3 staging bucket
uses: ./.github/workflows/component_linux_publish.yml
needs: [packaging-amd64, packaging-arm, packaging-arm64, packaging-legacy]
needs: [packaging-amd64, packaging-amd64-fips, packaging-arm, packaging-arm64, packaging-arm64-fips, packaging-legacy]
secrets:
DOCKER_HUB_ID: ${{secrets.OHAI_DOCKER_HUB_ID}}
DOCKER_HUB_PASSWORD: ${{secrets.OHAI_DOCKER_HUB_PASSWORD}}
Expand Down
Loading
Loading