-
Notifications
You must be signed in to change notification settings - Fork 130
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
base: master
Are you sure you want to change the base?
Conversation
build/ci.mk
Outdated
-v $(CURDIR):/go/src/github.com/newrelic/infrastructure-agent \ | ||
-w /go/src/github.com/newrelic/infrastructure-agent \ |
There was a problem hiding this comment.
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
package main | ||
|
||
import ( | ||
"context" | ||
"flag" | ||
"fmt" | ||
"github.com/newrelic/infrastructure-agent/pkg/ipc" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :)
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. |
There was a problem hiding this 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 }}" |
There was a problem hiding this comment.
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 }}" |
There was a problem hiding this comment.
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 }}" |
There was a problem hiding this comment.
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 }}" |
There was a problem hiding this comment.
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 }}" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same...
https://new-relic.atlassian.net/browse/NR-268769