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

Integration of Newrelic Ruby Security agent #2752

Merged
merged 64 commits into from
Jul 22, 2024
Merged

Integration of Newrelic Ruby Security agent #2752

merged 64 commits into from
Jul 22, 2024

Conversation

prateeksen
Copy link
Contributor

Integration of Newrelic Ruby Security agent (csec-ruby-agent) for public preview.

  • This integration launches Newrelic IAST functionality for Ruby.

fallwith and others added 30 commits April 27, 2023 22:02
k2
name updates
a manual port value can be passed to the security agent when needed
update description for security.applicationinfo.port
- introduce NewRelic::Control::SecurityInterface singleton class
- leverage the singleton class to ensure the security agent is only ever
  initialized once
- leverage the singleton class to defer security agent initialization in
  lockstep with dependency detection deference
- have each singleton class perform its own `require` of the singleton
  library so that it's not necessary to understand that the library is
  coming in from the `Control` class that might seem to have nothing to
  do with the singleton class
- update NewRelic::Control::Security source file with license header and
  frozen string literal magic comment
- remove commented out dev dependency from gemspec, as Gemfile will be
  used
NewRelic::Control::SecurityInterface
remove blank line left over from testing to cut down on diff noise
initialize the instance vars
SecurityInterface: Ruby <= 2.4 compatibility
make sure the SecurityInterface singleton behaves as expected
when relying on the 3 argument version of `stub`, make sure it's
available
security interface tests: skip MiniTest 4
add a security agent note, update descriptions further
reconcile .rb and .yml changes from the PR
typo fix
updated security config: application_info
make it abundantly clear which combinations of the 3 options will
disable the security agent
@github-actions github-actions bot added the community To tag external issues and PRs submitted by the community label Jul 17, 2024
lib/new_relic/agent/configuration/default_source.rb Outdated Show resolved Hide resolved
@@ -853,6 +853,55 @@ common: &default_settings
# Foundry environment.
# utilization.detect_pcf: true

#
Copy link
Contributor

Choose a reason for hiding this comment

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

@hannahramadan we'll likely need some help here getting these comments moved into default_source.rb and/or the newrelic.yml auto-generator so that these changes aren't lost the next time the file is auto-generated.

Copy link
Contributor

Choose a reason for hiding this comment

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

@fallwith roger that! I'll make a ticket for this

Copy link
Contributor

Choose a reason for hiding this comment

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

Great suggestion, @fallwith. Thank you for making the ticket, @hannahramadan! I think we may also want to consider adding this content to the auto-generated configuration docs that get published on the New Relic Docs website.

Agent.config[:'security.agent.enabled'] ? security_agent_metric(ENABLED) : security_agent_metric(DISABLED)
end

def security_metric(setting)
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the only caller of this method has been removed. I think this method can be removed now.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe there's a should-level declaration in the Security-Agent-Integration spec to generate this metric. Perhaps we should add a call?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fallwith @kaylareopelle Changes in place under this commit

lib/new_relic/control/security_interface.rb Outdated Show resolved Hide resolved
lib/new_relic/agent/configuration/default_source.rb Outdated Show resolved Hide resolved
@@ -853,6 +853,55 @@ common: &default_settings
# Foundry environment.
# utilization.detect_pcf: true

#
Copy link
Contributor

Choose a reason for hiding this comment

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

Great suggestion, @fallwith. Thank you for making the ticket, @hannahramadan! I think we may also want to consider adding this content to the auto-generated configuration docs that get published on the New Relic Docs website.

lib/new_relic/agent/configuration/default_source.rb Outdated Show resolved Hide resolved
lib/new_relic/agent/configuration/default_source.rb Outdated Show resolved Hide resolved
lib/new_relic/control/security_interface.rb Outdated Show resolved Hide resolved
Copy link
Contributor

SimpleCov Report

Coverage Threshold
Line 93.86% 93%
Branch 70.54% 50%

@fallwith fallwith removed the community To tag external issues and PRs submitted by the community label Jul 22, 2024
@kaylareopelle kaylareopelle merged commit 06653ce into dev Jul 22, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants