Skip to content

Commit 9645d2b

Browse files
committed
Added fips packages, dest prefix
1 parent 2c8d5eb commit 9645d2b

10 files changed

Lines changed: 117 additions & 79 deletions

File tree

.github/workflows/on_prerelease.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ jobs:
1414
tag: ${{ github.event.release.tag_name }}
1515
integration: "f5"
1616
run_integration_nix: false
17+
upload_fips_packages: true
18+
dest_prefix: fips-test-nri-f5-rahul/
19+
test_package: false
1720
secrets: inherit

.github/workflows/on_release.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ jobs:
1313
with:
1414
integration: f5
1515
tag: ${{ github.event.release.tag_name }}
16+
upload_fips_packages: true
1617
secrets: inherit

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Unreleased section should follow [Release Toolkit](https://github.com/newrelic/r
99

1010
## Unreleased
1111

12+
### enhancements
13+
- Add FIPS compliant packages
14+
1215
## v2.8.7 - 2025-08-07
1316

1417
### ⛓️ Dependencies

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ GOFLAGS = -mod=readonly
66
GOLANGCI_LINT = github.com/golangci/golangci-lint/cmd/golangci-lint
77
GOCOV = github.com/axw/gocov/gocov
88
GOCOV_XML = github.com/AlekSi/gocov-xml
9+
GO_VERSION ?= $(shell grep '^go ' go.mod | awk '{print $$2}')
10+
BUILDER_IMAGE ?= "ghcr.io/newrelic/coreint-automation:latest-go$(GO_VERSION)-ubuntu16.04"
911

1012
all: build
1113

build/.goreleaser.yml

Lines changed: 85 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
version: 2
3+
project_name: nri-f5
14
builds:
25
- id: nri-nix
36
main: ./src
@@ -18,6 +21,26 @@ builds:
1821
- goos: darwin
1922
goarch: 386
2023

24+
- id: nri-f5-nix-fips
25+
main: ./src
26+
binary: nri-f5
27+
ldflags:
28+
- -s -w -X main.integrationVersion={{.Version}} -X main.gitCommit={{.Commit}} -X main.buildDate={{.Date}}
29+
env:
30+
- CGO_ENABLED=1
31+
- GOEXPERIMENT=boringcrypto
32+
- >-
33+
{{- if eq .Arch "arm64" -}}
34+
CC=aarch64-linux-gnu-gcc
35+
{{- end }}
36+
goos:
37+
- linux
38+
goarch:
39+
- amd64
40+
- arm64
41+
tags:
42+
- fips
43+
2144
- id: nri-win
2245
main: ./src
2346
binary: nri-f5
@@ -35,6 +58,7 @@ builds:
3558

3659
nfpms:
3760
- id: linux
61+
package_name: nri-f5
3862
file_name_template: "{{ .ProjectName }}_{{ .Version }}-1_{{ .Arch }}"
3963
vendor: "New Relic, Inc."
4064
homepage: "https://www.newrelic.com/infrastructure"
@@ -64,15 +88,62 @@ nfpms:
6488

6589
overrides:
6690
rpm:
67-
file_name_template: "{{ .ProjectName }}-{{ .Version }}-1.{{ .Arch }}"
68-
replacements:
69-
amd64: x86_64
91+
file_name_template: >-
92+
{{- .ProjectName }}-
93+
{{- .Version }}-1.
94+
{{- if eq .Arch "amd64" -}}x86_64
95+
{{- else -}}
96+
{{ .Arch }}
97+
{{- end }}
7098
7199
# Formats to be generated.
72100
formats:
73101
- deb
74102
- rpm
75103

104+
- id: linux-fips
105+
package_name: nri-f5-fips
106+
file_name_template: "{{ .PackageName }}_{{ .Version }}-1_{{ .Arch }}"
107+
vendor: "New Relic, Inc."
108+
homepage: "https://www.newrelic.com/infrastructure"
109+
maintainer: "New Relic Infrastructure Team <infrastructure-eng@newrelic.com>"
110+
description: "New Relic Infrastructure f5 Integration extend the core New Relic\nInfrastructure agent's capabilities to allow you to collect metric and\nlive state data from f5 components."
111+
license: "https://newrelic.com/terms (also see LICENSE installed with this package)"
112+
113+
builds:
114+
- nri-f5-nix-fips
115+
116+
dependencies:
117+
- newrelic-infra-fips (>= 1.60.0)
118+
119+
bindir: "/var/db/newrelic-infra/newrelic-integrations/bin"
120+
121+
contents:
122+
- src: "f5-config.yml.sample"
123+
dst: "/etc/newrelic-infra/integrations.d/f5-config.yml.sample"
124+
- src: "CHANGELOG.md"
125+
dst: "/usr/share/doc/nri-f5/CHANGELOG.md"
126+
- src: "README.md"
127+
dst: "/usr/share/doc/nri-f5/README.md"
128+
- src: "LICENSE"
129+
dst: "/usr/share/doc/nri-f5/LICENSE"
130+
- src: "legacy/f5-definition.yml"
131+
dst: "/var/db/newrelic-infra/newrelic-integrations/f5-definition.yml"
132+
type: config
133+
134+
overrides:
135+
rpm:
136+
file_name_template: >-
137+
{{- .ProjectName }}-fips-
138+
{{- .Version }}-1.
139+
{{- if eq .Arch "amd64" -}}x86_64
140+
{{- else -}}
141+
{{ .Arch }}
142+
{{- end }}
143+
formats:
144+
- deb
145+
- rpm
146+
76147
archives:
77148
- id: nri-nix
78149
builds:
@@ -85,6 +156,17 @@ archives:
85156
strip_parent: true
86157
format: tar.gz
87158

159+
- id: nri-f5-nix-fips
160+
builds:
161+
- nri-f5-nix-fips
162+
name_template: "{{ .ProjectName }}-fips_{{ .Os }}_{{ .Version }}_{{ .Arch }}_dirty"
163+
files:
164+
- f5-config.yml.sample
165+
- src: 'legacy/f5-definition.yml'
166+
dst: .
167+
strip_parent: true
168+
format: tar.gz
169+
88170
- id: nri-win
89171
builds:
90172
- nri-win

build/Dockerfile

Lines changed: 0 additions & 18 deletions
This file was deleted.

build/ci.mk

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
BUILDER_TAG ?= nri-$(INTEGRATION)-builder
1+
.PHONY : ci/pull-builder-image
2+
ci/pull-builder-image:
3+
@docker pull $(BUILDER_IMAGE)
24

35
.PHONY : ci/deps
4-
ci/deps:
5-
@docker build -t $(BUILDER_TAG) -f $(CURDIR)/build/Dockerfile $(CURDIR)
6+
ci/deps: ci/pull-builder-image
67

78
.PHONY : ci/debug-container
89
ci/debug-container: ci/deps
@@ -17,15 +18,15 @@ ci/debug-container: ci/deps
1718
-e GPG_MAIL \
1819
-e GPG_PASSPHRASE \
1920
-e GPG_PRIVATE_KEY_BASE64 \
20-
$(BUILDER_TAG) bash
21+
$(BUILDER_IMAGE) bash
2122

2223
.PHONY : ci/test
2324
ci/test: ci/deps
2425
@docker run --rm -t \
2526
--name "nri-$(INTEGRATION)-test" \
2627
-v $(CURDIR):/go/src/github.com/newrelic/nri-$(INTEGRATION) \
2728
-w /go/src/github.com/newrelic/nri-$(INTEGRATION) \
28-
$(BUILDER_TAG) make test
29+
$(BUILDER_IMAGE) make test
2930

3031
.PHONY : ci/snyk-test
3132
ci/snyk-test:
@@ -46,7 +47,7 @@ ifdef TAG
4647
-w /go/src/github.com/newrelic/nri-$(INTEGRATION) \
4748
-e INTEGRATION \
4849
-e TAG \
49-
$(BUILDER_TAG) make release/build
50+
$(BUILDER_IMAGE) make release/build
5051
else
5152
@echo "===> $(INTEGRATION) === [ci/build] TAG env variable expected to be set"
5253
exit 1
@@ -67,7 +68,7 @@ ifdef TAG
6768
-e GPG_MAIL \
6869
-e GPG_PASSPHRASE \
6970
-e GPG_PRIVATE_KEY_BASE64 \
70-
$(BUILDER_TAG) make release
71+
$(BUILDER_IMAGE) make release
7172
else
7273
@echo "===> $(INTEGRATION) === [ci/prerelease] TAG env variable expected to be set"
7374
exit 1

build/nix/sign.sh

Lines changed: 0 additions & 47 deletions
This file was deleted.

build/release.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
BUILD_DIR := ./bin/
2-
GORELEASER_VERSION := v0.174.1
2+
GORELEASER_VERSION := v2.4.4
33
GORELEASER_BIN ?= bin/goreleaser
44

55
bin:
@@ -27,10 +27,10 @@ release/deps: $(GORELEASER_BIN)
2727
release/build: release/deps release/clean
2828
ifeq ($(PRERELEASE), true)
2929
@echo "===> $(INTEGRATION) === [release/build] PRE-RELEASE compiling all binaries, creating packages, archives"
30-
@$(GORELEASER_BIN) release --config $(CURDIR)/build/.goreleaser.yml --rm-dist
30+
@$(GORELEASER_BIN) release --config $(CURDIR)/build/.goreleaser.yml --clean
3131
else
3232
@echo "===> $(INTEGRATION) === [release/build] build compiling all binaries"
33-
@$(GORELEASER_BIN) build --config $(CURDIR)/build/.goreleaser.yml --snapshot --rm-dist
33+
@$(GORELEASER_BIN) build --config $(CURDIR)/build/.goreleaser.yml --snapshot --clean
3434
endif
3535

3636
.PHONY : release/fix-archive
@@ -43,7 +43,7 @@ release/fix-archive:
4343
.PHONY : release/sign/nix
4444
release/sign/nix:
4545
@echo "===> $(INTEGRATION) === [release/sign] signing packages"
46-
@bash $(CURDIR)/build/nix/sign.sh
46+
@bash sign.sh
4747

4848

4949
.PHONY : release/publish

src/fips.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright 2025 New Relic Corporation. All rights reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
//go:build fips
5+
// +build fips
6+
7+
package main
8+
9+
import (
10+
_ "crypto/tls/fipsonly"
11+
)

0 commit comments

Comments
 (0)