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

allow_all_headers config parameter #2155

Merged
merged 18 commits into from
Aug 14, 2023
Merged

allow_all_headers config parameter #2155

merged 18 commits into from
Aug 14, 2023

Conversation

fallwith
Copy link
Contributor

@fallwith fallwith commented Aug 9, 2023

A new 'allow_all_headers' configuration parameter has been added to bring parity with the Node.js agent and others. This configuration parameter defaults to a value of false. When set to true and as long as the agent is not operating in high security mode, all HTTP headers gleaned from a request will be captured and relayed to New Relic instead of the default core set of headers. All existing behavior for .*attributes.include and .*attributes.exclude configuration parameters will be respected for any desired filtration of the headers when allow_all_headers is enabled. This work was done in response to a feature request submitted by community member
@jamesarosen. Thank you very much, @jamesarosen!

resolves #1029

A new 'allow_all_headers' configuration parameter has been added to
bring parity with the Node.js agent and others. This configuration
parameter defaults to a value of `false`. When set to `true` and as
long as the agent is not operating in high security mode, all HTTP
headers gleaned from a request will be captured and relayed to New
Relic instead of the default core set of headers. All existing behavior
for `.*attributes.include` and `.*attributes.exclude` configuration
parameters will be respected for any desired filtration of the headers
when `allow_all_headers` is enabled. This work was done in response to
a feature request submitted by community member
[@jamesarosen](https://github.com/jamesarosen). Thank you very much,
@jamesarosen!

resolves #1029
remove 'binding.irb' debug breakpoint
focus on transaction tracer for the maximum number of permitted headers
lib/new_relic/language_support.rb Show resolved Hide resolved
newrelic_rpm.gemspec Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
fallwith and others added 2 commits August 9, 2023 17:16
update entry for allow_all_headers

Co-authored-by: Hannah Ramadan <76922290+hannahramadan@users.noreply.github.com>
require no Rails or Rails v5.2+ for certain RequestAttribute tests
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
test/helpers/misc.rb Outdated Show resolved Hide resolved
newrelic_rpm.gemspec Show resolved Hide resolved
fallwith and others added 8 commits August 10, 2023 10:44
Grammar rework for allow_all_headers entry

Co-authored-by: Kayla Reopelle (she/her) <87386821+kaylareopelle@users.noreply.github.com>
previously allow_all_headers was only focused on headers that don't
already have accessors on the RequestAttributes model, but after some
dev discussion we decided that the _all_ bit should indeed refer to ALL
headers and that means removing existing conditional checks for the base
headers when allow_all_headers is set.
label the tin better
Technically allow_all_headers doesn't require Rails v5.2+ but rather
Rack v2+
- Note about Rack version requirements
- Note about attribute names
Insist on `Rack.release` and non 1.x
CI allow_all_headers requires Rack v2+
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated
Comment on lines 13 to 17
A new `allow_all_headers` configuration parameter brings parity with the Node.js agent (see the [v2.7.0 changelog](https://docs.newrelic.com/docs/release-notes/agent-release-notes/nodejs-release-notes/node-agent-270/)). This configuration parameter defaults to a value of `false`. When set to `true`, and as long as the agent is not operating in high-security mode, all HTTP headers gleaned from a request will be captured and relayed to New Relic instead of the default core set of headers. All existing behavior for `.*attributes.include` and `.*attributes.exclude` configuration parameters will be respected for any desired filtration of the headers when `allow_all_headers` is enabled. This work was done in response to a feature request submitted by community member [@jamesarosen](https://github.com/jamesarosen). Thank you very much, @jamesarosen! [Issue#1029](https://github.com/newrelic/newrelic-ruby-agent/issues/1029)

NOTE: The extra headers collected by having `allow_all_headers` enabled requires Rack version 2 or higher.
NOTE: The extra headers will appear as attributes prefixed with `request.headers.`

Copy link
Contributor

Choose a reason for hiding this comment

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

The long block of text makes this changelog entry a bit difficult for me to follow. Would you be open to breaking things into bullets instead?

Suggested change
A new `allow_all_headers` configuration parameter brings parity with the Node.js agent (see the [v2.7.0 changelog](https://docs.newrelic.com/docs/release-notes/agent-release-notes/nodejs-release-notes/node-agent-270/)). This configuration parameter defaults to a value of `false`. When set to `true`, and as long as the agent is not operating in high-security mode, all HTTP headers gleaned from a request will be captured and relayed to New Relic instead of the default core set of headers. All existing behavior for `.*attributes.include` and `.*attributes.exclude` configuration parameters will be respected for any desired filtration of the headers when `allow_all_headers` is enabled. This work was done in response to a feature request submitted by community member [@jamesarosen](https://github.com/jamesarosen). Thank you very much, @jamesarosen! [Issue#1029](https://github.com/newrelic/newrelic-ruby-agent/issues/1029)
NOTE: The extra headers collected by having `allow_all_headers` enabled requires Rack version 2 or higher.
NOTE: The extra headers will appear as attributes prefixed with `request.headers.`
A new `allow_all_headers` configuration option brings parity with the Node.js agent (see the [v2.7.0 changelog](https://docs.newrelic.com/docs/release-notes/agent-release-notes/nodejs-release-notes/node-agent-270/)).
This configuration option:
* Defaults to `false`.
* Is not compatible with high-security mode
* When set to `true` all HTTP headers gleaned from a request will be captured and relayed to New Relic. By default, only a small group of HTTP headers are sent to New Relic.
* Respects all existing behavior for `attributes.include` and `attributes.exclude` configuration options for any desired filtration of the headers when `allow_all_headers` is enabled.
* Requires Rack version 2 or higher.
* Displays the additional headers as transaction attributes prefixed with `request.headers.`
This work was done in response to a feature request submitted by community member [@jamesarosen](https://github.com/jamesarosen). Thank you very much, @jamesarosen! [Issue#1029](https://github.com/newrelic/newrelic-ruby-agent/issues/1029)

CHANGELOG.md Outdated Show resolved Hide resolved
fallwith and others added 4 commits August 11, 2023 10:56
allow_all_headers entry updates

Co-authored-by: Kayla Reopelle (she/her) <87386821+kaylareopelle@users.noreply.github.com>
allow_all_headers entry parameter -> option

Co-authored-by: Kayla Reopelle (she/her) <87386821+kaylareopelle@users.noreply.github.com>
instane -> instance typo fix

Co-authored-by: Kayla Reopelle (she/her) <87386821+kaylareopelle@users.noreply.github.com>
(as paired on with @kaylareopelle)

update the CHANGELOG entry for `allow_all_headers`
@github-actions
Copy link
Contributor

SimpleCov Report

Coverage Threshold
Line 94.29% 94%
Branch 85.75% 85%

kaylareopelle
kaylareopelle previously approved these changes Aug 14, 2023
CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Kayla Reopelle (she/her) <87386821+kaylareopelle@users.noreply.github.com>
@fallwith fallwith merged commit 956f652 into dev Aug 14, 2023
@fallwith fallwith deleted the allow_all_headers branch August 14, 2023 16:47
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.

Include HTTP headers with all Transactions
3 participants