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

chore(ruby-agent): Update CSP Nonce feature content #17506

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ If the content security policy is set to 'unsafe-inline', you can automatically

### Rails CSP Nonce [#rails-csp-nonce]

[Rails versions 5.2+](https://guides.rubyonrails.org/security.html#adding-a-nonce) include a feature to set a CSP nonce using an API. On Ruby agent versions 9.10.0+, the Rails CSP nonce will be automatically detected and applied to the browser agent injection script.
[Rails versions 5.2+](https://guides.rubyonrails.org/security.html#adding-a-nonce) include a feature to set a CSP nonce using an API. On Ruby agent versions 9.10.0+, the Rails CSP nonce can be automatically detected and applied to the browser agent injection script.

You can disable this feature by updating your `newrelic.yml` to the following:
You can enable this feature by updating your `newrelic.yml` to the following:

```yaml
browser_monitoring:
content_security_policy_nonce: false
content_security_policy_nonce: true
```

Or set the environment variable, `NEW_RELIC_BROWSER_MONITORING_CONTENT_SECURITY_POLICY=false`.
Or set the environment variable, `NEW_RELIC_BROWSER_MONITORING_CONTENT_SECURITY_POLICY=true`.

### API call [#api-call]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Version 9.10.0 introduces instrumentation for DynamoDB, adds a new feature to au

- **Feature: Automatically apply nonces from the Rails content security policy**

To auto-inject browser monitoring with the New Relic Ruby agent, you either need to set your content security policy to 'unsafe-inline' or provide a nonce. Previously, the only way to provide a nonce was by using the [`NewRelic::Agent.browser_timing_header`](https://rubydoc.info/gems/newrelic_rpm/NewRelic/Agent#browser_timing_header-instance_method) API. Now, when a Rails application uses [the content security policy configuration to add a nonce](https://guides.rubyonrails.org/security.html#adding-a-nonce), the nonce will be automatically applied to the browser agent. A new configuration option, [`browser_monitoring.content_security_policy_nonce`](https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration/#browser_monitoring-content_security_policy_nonce), toggles this feature. It is on by default. Thank you [@baldarn](https://github.com/baldarn) for submitting this feature! [PR#2544](https://github.com/newrelic/newrelic-ruby-agent/pull/2544)
To auto-inject browser monitoring with the New Relic Ruby agent, you either need to set your content security policy to 'unsafe-inline' or provide a nonce. Previously, the only way to provide a nonce was by using the [`NewRelic::Agent.browser_timing_header`](https://rubydoc.info/gems/newrelic_rpm/NewRelic/Agent#browser_timing_header-instance_method) API. Now, when a Rails application uses [the content security policy configuration to add a nonce](https://guides.rubyonrails.org/security.html#adding-a-nonce), the nonce can be automatically applied to the browser agent. A new configuration option, [`browser_monitoring.content_security_policy_nonce`](https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration/#browser_monitoring-content_security_policy_nonce), toggles this feature. It is off by default. Thank you [@baldarn](https://github.com/baldarn) for submitting this feature! [PR#2544](https://github.com/newrelic/newrelic-ruby-agent/pull/2544)

- **Bugfix: Expected errors related to HTTP status code, class, and message won't impact Apdex**

Expand Down
Loading