Skip to content

feat(infrastructure): write fedramp: true to infra config when region is GOV or FEDRAMP - #1401

Merged
pranav-new-relic merged 1 commit into
mainfrom
feat/gov-fedramp-infra-recipe
Jul 17, 2026
Merged

feat(infrastructure): write fedramp: true to infra config when region is GOV or FEDRAMP#1401
pranav-new-relic merged 1 commit into
mainfrom
feat/gov-fedramp-infra-recipe

Conversation

@pranav-new-relic

Copy link
Copy Markdown
Member

Summary

When NEW_RELIC_REGION is GOV or FEDRAMP, the infrastructure agent requires fedramp: true in newrelic-infra.yml to route all ingest to the FedRAMP-compliant gov-* endpoints. Without this flag the agent silently 401s against the US ingest cell — confirmed by end-to-end testing on Ubuntu 22.04.

Why fedramp: true is the correct and only attribute needed

Verified directly from pkg/config/config.go and pkg/config/defaults.go in newrelic/infrastructure-agent:

Fedramp bool `yaml:"fedramp" envconfig:"fedramp" public:"true"`

When fedramp: true, the agent routes to:

Endpoint URL
Collector (ingest) gov-infra-api.newrelic.com
Identity gov-identity-api.newrelic.com
Command channel gov-infrastructure-command-api.newrelic.com
Metrics gov-metric-api.newrelic.com

No other config attributes are required. fedramp is checked before staging in the agent's URL calculation, so the two flags don't conflict (though they'd never be set together in practice).

FIPS mode (NEW_RELIC_FIPS_ENABLED) is a separate concern — it installs the FIPS-crypto binary variant. This PR does not touch FIPS handling.

Changes

All 7 platform recipes are updated with the same two-part change:

Linux / macOS (ubuntu.yml, debian.yml, centos_rhel.yml, awslinux.yml, suse.yml, darwin.yml):

  1. Add sed -i "/^fedramp/d" to the cleanup block so reinstalling with a non-GOV region removes any leftover fedramp: true
  2. Write fedramp: true when NEW_RELIC_REGION matches ^(gov|fedramp)$ (case-insensitive, exact match — not a substring)

Windows (windows.yml):

  1. Add fedramp: true branch in Write-FreshConfig (which always writes a fresh file, so no cleanup step needed)

Non-regression guarantee

  • The grep -iqE '^(gov|fedramp)$' pattern is an exact case-insensitive match — it will not match staging, us, eu, jp, or any other value
  • US/EU/JP/Staging installs are completely unaffected
  • The sed -i "/^fedramp/d" cleanup is a no-op when the key is not present

Test evidence

End-to-end test on Ubuntu 22.04 EC2, kernel 6.8 (us-west-2):

  • Without fedramp: true: infra agent 401s on every push to infra-api.newrelic.com
  • With fedramp: true manually added: infra agent routes to gov-infra-api.newrelic.com, 19 SystemSample events confirmed in GOV account (account 4012030) via NRQL within 60 seconds

Related

  • newrelic/newrelic-client-go PR #1434 (merged, released as v2.91.0) — defines the GOV region with FedRAMP-compliant endpoints
  • newrelic/newrelic-cli PR #1866 — accepts GOV and FEDRAMP as valid NEW_RELIC_REGION values

🤖 Generated with Claude Code

… is GOV or FEDRAMP

When NEW_RELIC_REGION is GOV or FEDRAMP, the infrastructure agent requires
fedramp: true in newrelic-infra.yml to route all ingest to the FedRAMP-
compliant gov-* endpoints (gov-infra-api, gov-identity-api,
gov-infrastructure-command-api, gov-metric-api). Without this flag the
agent silently 401s against the US ingest cell.

Changes across all 7 platform recipes:
- ubuntu.yml, debian.yml, centos_rhel.yml, awslinux.yml, suse.yml,
  darwin.yml: add sed cleanup of ^fedramp key on reinstall, and write
  fedramp: true when region matches ^(gov|fedramp)$ (case-insensitive)
- windows.yml: add fedramp: true branch in Write-FreshConfig for gov/fedramp

Verified from newrelic/infrastructure-agent pkg/config/config.go:
  Fedramp bool `yaml:"fedramp" envconfig:"fedramp"`
  When true routes to defaultSecureFederalURL (gov-infra-api.newrelic.com),
  defaultSecureFedralIdentityURL, defaultSecureFedralCmdChannelURL, and
  defaultSecureFederalMetricURL.

No behaviour change for US, EU, JP, or Staging installs.
@pranav-new-relic

Copy link
Copy Markdown
Member Author

Confirmed that the failures are not a result of the changes in these recipes - they seem to be occuring because of race conditions (overload) with AWS. Merging this PR.

@pranav-new-relic
pranav-new-relic merged commit 3a112fe into main Jul 17, 2026
758 of 793 checks passed
@pranav-new-relic
pranav-new-relic deleted the feat/gov-fedramp-infra-recipe branch July 17, 2026 02:45
burhan-nr pushed a commit to kkhandelwal-nr/temp-open-install-library that referenced this pull request Jul 21, 2026
Changes since v0.86.4:

- feat(infrastructure): write fedramp: true to infra config when region is GOV or FEDRAMP (newrelic#1401) (3a112fe)
- test: exercise all nrdot recipes to surface CI test issues (newrelic#1393) (af8392d)
- support k8s 1.35, remove support for 1.30 (3e403f4)

Release: https://github.com/newrelic/open-install-library/releases/tag/v0.87.0

[skip ci]
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.

2 participants