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

Adding fips compliant agents to Prerelease on demand workflow #1942

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

nr-dadams
Copy link

@nr-dadams nr-dadams commented Oct 25, 2024

  • Adds build mode field for FIPS/Non FIPS
  • New dockerfile for fips compliant building
  • publishes fips compliant agents with '_fips' naming convention

https://new-relic.atlassian.net/browse/NR-268769

@nr-dadams nr-dadams requested a review from a team October 25, 2024 17:42
.github/workflows/prerelease_linux_on_demand.yml Outdated Show resolved Hide resolved
build/ci.mk Outdated
Comment on lines 133 to 134
-v $(CURDIR):/go/src/github.com/newrelic/infrastructure-agent \
-w /go/src/github.com/newrelic/infrastructure-agent \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it needed to place the code here? sounds like the old gopath dance

build/upload-schema-linux-deb-fips.yml Outdated Show resolved Hide resolved
package main

import (
"context"
"flag"
"fmt"
"github.com/newrelic/infrastructure-agent/pkg/ipc"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change looks like a wrong ide config


import (
"context"
_ "crypto/tls/fipsonly"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the only diff between the two files? did you consider to extract as much as possible from this file into a separate file inside the same package ? or couldn't this dep be added in another file with just the dependency ? The objective would be to avoid code duplication.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment would apply for the three binaries, i think the most important is the newrelic-infa.go

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean having an extra file fips_deps.go with

//go:build fips

package main

import (
	_ "crypto/tls/fipsonly"
)

Would that work?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment! I've updated the code and files to reflect this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, I'm happy it worked, ~1k lines less to maintain :)

@nr-dadams nr-dadams requested a review from a team as a code owner November 14, 2024 00:00
@nr-dadams
Copy link
Author

Had to make a few optimization changes after talking with @alvarocabanas , but this should be a bit cleaner and building/deploying successfully now. It is ready for another review as needed.

Copy link
Contributor

@alvarocabanas alvarocabanas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left comments for the places we need to change the suffix.

@@ -6,7 +6,7 @@
- linux-ctl-amd64
- linux-service-amd64
package_name: newrelic-infra
file_name_template: "newrelic-infra-{{ .Env.TAG }}-1.el7.{{ .Arch }}"
file_name_template: "newrelic-infra-{{ .Env.TAG }}-1.el7.{{ .Arch }}{{ .Env.FIPS }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the recommendation by a team member, we want to move the FIPS suffix and place it after the app name newrelic-infra-fips..., this is to follow the pattern packages normally follow, so this would be:

"newrelic-infra{{ .Env.FIPS }}-{{ .Env.TAG }}-1.el7.{{ .Arch }}"

@@ -6,7 +6,7 @@
- linux-ctl-arm
- linux-service-arm
package_name: newrelic-infra
file_name_template: "newrelic-infra-{{ .Env.TAG }}-1.el7.{{ .Arch }}"
file_name_template: "newrelic-infra-{{ .Env.TAG }}-1.el7.{{ .Arch }}{{ .Env.FIPS }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, this should be :

"newrelic-infra{{ .Env.FIPS }}-{{ .Env.TAG }}-1.el7.{{ .Arch }}"

@@ -6,7 +6,7 @@
- linux-ctl-arm64
- linux-service-arm64
package_name: newrelic-infra
file_name_template: "newrelic-infra-{{ .Env.TAG }}-1.el7.{{ .Arch }}"
file_name_template: "newrelic-infra-{{ .Env.TAG }}-1.el7.{{ .Arch }}{{ .Env.FIPS }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, this should be :

"newrelic-infra{{ .Env.FIPS }}-{{ .Env.TAG }}-1.el7.{{ .Arch }}"

@@ -6,7 +6,7 @@
- linux-ctl-amd64
- linux-service-amd64
package_name: newrelic-infra
file_name_template: "newrelic-infra-{{ .Env.TAG }}-1.el8.{{ .Arch }}"
file_name_template: "newrelic-infra-{{ .Env.TAG }}-1.el8.{{ .Arch }}{{ .Env.FIPS }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, this should be :

"newrelic-infra{{ .Env.FIPS }}-{{ .Env.TAG }}-1.el8.{{ .Arch }}"

@@ -6,7 +6,7 @@
- linux-ctl-arm64
- linux-service-arm64
package_name: newrelic-infra
file_name_template: "newrelic-infra-{{ .Env.TAG }}-1.el8.{{ .Arch }}"
file_name_template: "newrelic-infra-{{ .Env.TAG }}-1.el8.{{ .Arch }}{{ .Env.FIPS }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, this should be :

"newrelic-infra{{ .Env.FIPS }}-{{ .Env.TAG }}-1.el8.{{ .Arch }}"

- 15.4
- 15.5

- src: "newrelic-infra-{version}-1.amazonlinux-{os_version}.{arch}_fips.rpm.sum"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same...

- 2
- 2023

- src: "newrelic-infra-{version}-1.amazonlinux-{os_version}.{arch}_fips.rpm.sum"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same...

@@ -0,0 +1,33 @@
---
- src: "newrelic-infra_linux_{version}_{arch}_fips.tar.gz"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same...

# UPLOAD CHECKSUMS #
#########################

- src: "newrelic-infra_linux_{version}_{arch}_fips.tar.gz.sum"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same..

# UPLOAD SIGNATURE #
#########################

- src: "newrelic-infra_linux_{version}_{arch}_fips.tar.gz.asc"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants