diff --git a/pkg/commands/process/settings/policies/risk_policy.rego b/pkg/commands/process/settings/policies/risk_policy.rego index 9f066e22c..039900b09 100644 --- a/pkg/commands/process/settings/policies/risk_policy.rego +++ b/pkg/commands/process/settings/policies/risk_policy.rego @@ -51,22 +51,33 @@ presence_failures contains detector if { # # Build policy failures policy_failure contains item if { input.rule.trigger.match_on == "absence" + + count(input.rule.trigger.required_detections) == count({ required_detection | + required_detection := input.rule.trigger.required_detections[_] + some y in input.dataflow.risks + y.detector_id == required_detection + }) + some detector in input.dataflow.risks + detector.detector_id == input.rule.trigger.required_detections[0] - detector.detector_id == input.rule.trigger.required_detection some init_location in detector.locations x := {other | other := input.dataflow.risks[_]; other.detector_id == input.rule.id} count(x) == 0 - item := data.bearer.common.build_item(init_location) } policy_failure contains item if { input.rule.trigger.match_on == "absence" - some detector in input.dataflow.risks + count(input.rule.trigger.required_detections) == count({ required_detection | + required_detection := input.rule.trigger.required_detections[_] + some x in input.dataflow.risks + x.detector_id == required_detection + }) - detector.detector_id == input.rule.trigger.required_detection + some detector in input.dataflow.risks + detector.detector_id == input.rule.trigger.required_detections[0] some init_location in detector.locations some other_detector in input.dataflow.risks diff --git a/pkg/commands/process/settings/rules/rules.go b/pkg/commands/process/settings/rules/rules.go index b42a60432..7cdf49ec8 100644 --- a/pkg/commands/process/settings/rules/rules.go +++ b/pkg/commands/process/settings/rules/rules.go @@ -245,8 +245,11 @@ func BuildRules( if definition.Trigger.DataTypesRequired != nil { ruleTrigger.DataTypesRequired = *definition.Trigger.DataTypesRequired } + + // concat any required detections + ruleTrigger.RequiredDetections = definition.Trigger.RequiredDetections if definition.Trigger.RequiredDetection != nil { - ruleTrigger.RequiredDetection = definition.Trigger.RequiredDetection + ruleTrigger.RequiredDetections = append(ruleTrigger.RequiredDetections, *definition.Trigger.RequiredDetection) } } diff --git a/pkg/commands/process/settings/settings.go b/pkg/commands/process/settings/settings.go index a1c94ed96..bab5237cd 100644 --- a/pkg/commands/process/settings/settings.go +++ b/pkg/commands/process/settings/settings.go @@ -111,15 +111,16 @@ const ( ) type RuleTrigger struct { - MatchOn MatchOn `mapstructure:"match_on" json:"match_on" yaml:"match_on"` - DataTypesRequired bool `mapstructure:"data_types_required" json:"data_types_required" yaml:"data_types_required"` - RequiredDetection *string `mapstructure:"required_detection" json:"required_detection" yaml:"required_detection"` + MatchOn MatchOn `mapstructure:"match_on" json:"match_on" yaml:"match_on"` + DataTypesRequired bool `mapstructure:"data_types_required" json:"data_types_required" yaml:"data_types_required"` + RequiredDetections []string `mapstructure:"required_detections" json:"required_detections" yaml:"required_detections"` } type RuleDefinitionTrigger struct { - MatchOn *MatchOn `mapstructure:"match_on" json:"match_on" yaml:"match_on"` - RequiredDetection *string `mapstructure:"required_detection" json:"required_detection" yaml:"required_detection"` - DataTypesRequired *bool `mapstructure:"data_types_required" json:"data_types_required" yaml:"data_types_required"` + MatchOn *MatchOn `mapstructure:"match_on" json:"match_on" yaml:"match_on"` + RequiredDetection *string `mapstructure:"required_detection" json:"required_detection" yaml:"required_detection"` + RequiredDetections []string `mapstructure:"required_detections" json:"required_detections" yaml:"required_detections"` + DataTypesRequired *bool `mapstructure:"data_types_required" json:"data_types_required" yaml:"data_types_required"` } type RuleMetadata struct { diff --git a/pkg/report/output/testhelper/testhelper.go b/pkg/report/output/testhelper/testhelper.go index 115d273ee..52c99bce8 100644 --- a/pkg/report/output/testhelper/testhelper.go +++ b/pkg/report/output/testhelper/testhelper.go @@ -19,13 +19,13 @@ func CustomRule() *settings.Rule { } func RubyLangSSLVerificationRule() *settings.Rule { - return &settings.Rule{Id: "ruby_lang_ssl_verification", AssociatedRecipe: "", Type: "risk", Trigger: settings.RuleTrigger{MatchOn: "presence", DataTypesRequired: false, RequiredDetection: (*string)(nil)}, IsLocal: false, Detectors: []string(nil), Processors: []string(nil), Stored: false, AutoEncrytPrefix: "", HasDetailedContext: false, SkipDataTypes: []string(nil), OnlyDataTypes: []string(nil), Severity: "medium", Description: "Missing SSL certificate verification detected.", RemediationMessage: "## Description\n\nApplications processing sensitive data should use valid SSL certificates. This rule checks if SSL verification is enabled.\n\n## Remediations\n\n❌ By default Ruby check for SSL certificate verification but this can be bypassed when setting Open SSL verification mode to `VERIFY_NONE`:\n\n```clojure\nrequire \"net/https\"\nrequire \"uri\"\n\nuri = URI.parse(\"https://ssl-site.com/\")\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n```\n\n✅ To ensure that SSL verification always happens, make sure to use the following mode:\n\n```bash\nhttp.verify_mode = OpenSSL::SSL::VERIFY_PEER\n```\n\n## Resources\n- [Ruby OpenSSL module](https://ruby.github.io/openssl/OpenSSL.html)\n", CWEIDs: []string{"295"}, Languages: []string{"ruby"}, Patterns: []settings.RulePattern{settings.RulePattern{Pattern: "Net::HTTP.start(verify_mode: OpenSSL::SSL::VERIFY_NONE)$<...>\n", Focus: "", Filters: []settings.PatternFilter(nil)}, settings.RulePattern{Pattern: "Net::HTTP.start($<...>{ verify_mode: OpenSSL::SSL::VERIFY_NONE })$<...>\n", Focus: "", Filters: []settings.PatternFilter(nil)}, settings.RulePattern{Pattern: "$<_>.verify_mode = OpenSSL::SSL::VERIFY_NONE\n", Focus: "", Filters: []settings.PatternFilter(nil)}}, SanitizerRuleID: "", DocumentationUrl: "https://docs.bearer.com/reference/rules/ruby_lang_ssl_verification", IsAuxilary: false, DependencyCheck: false, Dependency: (*settings.Dependency)(nil), Metavars: map[string]settings.MetaVar(nil), ParamParenting: false, DetectPresence: false, OmitParent: false} + return &settings.Rule{Id: "ruby_lang_ssl_verification", AssociatedRecipe: "", Type: "risk", Trigger: settings.RuleTrigger{MatchOn: "presence", DataTypesRequired: false}, IsLocal: false, Detectors: []string(nil), Processors: []string(nil), Stored: false, AutoEncrytPrefix: "", HasDetailedContext: false, SkipDataTypes: []string(nil), OnlyDataTypes: []string(nil), Severity: "medium", Description: "Missing SSL certificate verification detected.", RemediationMessage: "## Description\n\nApplications processing sensitive data should use valid SSL certificates. This rule checks if SSL verification is enabled.\n\n## Remediations\n\n❌ By default Ruby check for SSL certificate verification but this can be bypassed when setting Open SSL verification mode to `VERIFY_NONE`:\n\n```clojure\nrequire \"net/https\"\nrequire \"uri\"\n\nuri = URI.parse(\"https://ssl-site.com/\")\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n```\n\n✅ To ensure that SSL verification always happens, make sure to use the following mode:\n\n```bash\nhttp.verify_mode = OpenSSL::SSL::VERIFY_PEER\n```\n\n## Resources\n- [Ruby OpenSSL module](https://ruby.github.io/openssl/OpenSSL.html)\n", CWEIDs: []string{"295"}, Languages: []string{"ruby"}, Patterns: []settings.RulePattern{settings.RulePattern{Pattern: "Net::HTTP.start(verify_mode: OpenSSL::SSL::VERIFY_NONE)$<...>\n", Focus: "", Filters: []settings.PatternFilter(nil)}, settings.RulePattern{Pattern: "Net::HTTP.start($<...>{ verify_mode: OpenSSL::SSL::VERIFY_NONE })$<...>\n", Focus: "", Filters: []settings.PatternFilter(nil)}, settings.RulePattern{Pattern: "$<_>.verify_mode = OpenSSL::SSL::VERIFY_NONE\n", Focus: "", Filters: []settings.PatternFilter(nil)}}, SanitizerRuleID: "", DocumentationUrl: "https://docs.bearer.com/reference/rules/ruby_lang_ssl_verification", IsAuxilary: false, DependencyCheck: false, Dependency: (*settings.Dependency)(nil), Metavars: map[string]settings.MetaVar(nil), ParamParenting: false, DetectPresence: false, OmitParent: false} } func RubyRailsLoggerRule() *settings.Rule { - return &settings.Rule{Id: "ruby_rails_logger", AssociatedRecipe: "", Type: "risk", Trigger: settings.RuleTrigger{MatchOn: "presence", DataTypesRequired: false, RequiredDetection: (*string)(nil)}, IsLocal: true, Detectors: []string(nil), Processors: []string(nil), Stored: false, AutoEncrytPrefix: "", HasDetailedContext: false, SkipDataTypes: []string{"Unique Identifier"}, OnlyDataTypes: []string(nil), Severity: "critical", Description: "Sensitive data sent to Rails loggers detected.", RemediationMessage: "## Description\nLeaking sensitive data to loggers is a common cause of data leaks and can lead to data breaches. This rule looks for instances of sensitive data sent to rails loggers.\n\n## Remediations\n❌ Avoid using sensitive data in logger messages:\n\n```ruby\nRails.logger.info('User is: #{user.email}')\n```\n\n✅ If you need to identify a user, ensure to use their unique identifier instead of their personal identifiable information:\n\n```ruby\nRails.logger.info('User is: #{user.uuid}')\n```\n\n## Resources\n- [OWASP logging cheat sheet](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html)\n", CWEIDs: []string{"209", "532"}, Languages: []string{"ruby"}, Patterns: []settings.RulePattern{settings.RulePattern{Pattern: "Rails.logger.$($)\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}, settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "METHOD", Detection: "", Scope: "", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string{"info", "warn", "error", "fatal", "unknown"}, LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}}, SanitizerRuleID: "", DocumentationUrl: "https://docs.bearer.com/reference/rules/ruby_rails_logger", IsAuxilary: false, DependencyCheck: false, Dependency: (*settings.Dependency)(nil), Metavars: map[string]settings.MetaVar(nil), ParamParenting: false, DetectPresence: false, OmitParent: false} + return &settings.Rule{Id: "ruby_rails_logger", AssociatedRecipe: "", Type: "risk", Trigger: settings.RuleTrigger{MatchOn: "presence", DataTypesRequired: false}, IsLocal: true, Detectors: []string(nil), Processors: []string(nil), Stored: false, AutoEncrytPrefix: "", HasDetailedContext: false, SkipDataTypes: []string{"Unique Identifier"}, OnlyDataTypes: []string(nil), Severity: "critical", Description: "Sensitive data sent to Rails loggers detected.", RemediationMessage: "## Description\nLeaking sensitive data to loggers is a common cause of data leaks and can lead to data breaches. This rule looks for instances of sensitive data sent to rails loggers.\n\n## Remediations\n❌ Avoid using sensitive data in logger messages:\n\n```ruby\nRails.logger.info('User is: #{user.email}')\n```\n\n✅ If you need to identify a user, ensure to use their unique identifier instead of their personal identifiable information:\n\n```ruby\nRails.logger.info('User is: #{user.uuid}')\n```\n\n## Resources\n- [OWASP logging cheat sheet](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html)\n", CWEIDs: []string{"209", "532"}, Languages: []string{"ruby"}, Patterns: []settings.RulePattern{settings.RulePattern{Pattern: "Rails.logger.$($)\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}, settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "METHOD", Detection: "", Scope: "", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string{"info", "warn", "error", "fatal", "unknown"}, LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}}, SanitizerRuleID: "", DocumentationUrl: "https://docs.bearer.com/reference/rules/ruby_rails_logger", IsAuxilary: false, DependencyCheck: false, Dependency: (*settings.Dependency)(nil), Metavars: map[string]settings.MetaVar(nil), ParamParenting: false, DetectPresence: false, OmitParent: false} } func RubyThirdPartiesSentryRule() *settings.Rule { - return &settings.Rule{Id: "ruby_third_parties_sentry", AssociatedRecipe: "Sentry", Type: "risk", Trigger: settings.RuleTrigger{MatchOn: "presence", DataTypesRequired: false, RequiredDetection: (*string)(nil)}, IsLocal: true, Detectors: []string(nil), Processors: []string(nil), Stored: false, AutoEncrytPrefix: "", HasDetailedContext: false, SkipDataTypes: []string{"Unique Identifier"}, OnlyDataTypes: []string(nil), Severity: "Critical", Description: "Sensitive data sent to Sentry detected.", RemediationMessage: "## Description\nLeaking sensitive data to third-party loggers is a common cause of data leaks and can lead to data breaches. This rule looks for instances of sensitive data sent to Sentry.\n\n## Remediations\n\nWhen logging errors or events, ensure all sensitive data is removed.\n\n## Resources\n- [Sentry Docs](https://docs.sentry.io/)\n", CWEIDs: []string{"201"}, Languages: []string{"ruby"}, Patterns: []settings.RulePattern{settings.RulePattern{Pattern: "Sentry::Breadcrumb.new($<...>$$<...>)\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.capture_message($<...>$$<...>)\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.init do |$|\n $.before_breadcrumb = lambda do |$, $<_:identifier>|\n $$.message = $\n end\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.set_context($<_>, $<...>$$<...>)\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.configure_scope do |$|\n $$.set_context($<_>, $<...>$$<...>)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.with_scope do |$|\n $$.set_context($<_>, $<...>$$<...>)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.configure_scope do |$|\n $$.set_extra($<_>, $)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.with_scope do |$|\n $$.set_extra($<_>, $)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.set_extras($<...>$$<...>)\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.configure_scope do |$|\n $$.set_extras($<...>$$<...>)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.with_scope do |$|\n $$.set_extras($<...>$$<...>)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.configure_scope do |$|\n $$.set_tag($<_>, $)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.with_scope do |$|\n $$.set_tag($<_>, $)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.set_tags($<...>$$<...>)\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.configure_scope do |$|\n $$.set_tags($<...>$$<...>)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.with_scope do |$|\n $$.set_tags($<...>$$<...>)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.set_user($<...>$$<...>)\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.configure_scope do |$|\n $$.set_user($<...>$$<...>)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.with_scope do |$|\n $$.set_user($<...>$$<...>)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}}, SanitizerRuleID: "", DocumentationUrl: "https://docs.bearer.com/reference/rules/ruby_third_parties_sentry", IsAuxilary: false, DependencyCheck: false, Dependency: (*settings.Dependency)(nil), Metavars: map[string]settings.MetaVar(nil), ParamParenting: false, DetectPresence: false, OmitParent: false} + return &settings.Rule{Id: "ruby_third_parties_sentry", AssociatedRecipe: "Sentry", Type: "risk", Trigger: settings.RuleTrigger{MatchOn: "presence", DataTypesRequired: false}, IsLocal: true, Detectors: []string(nil), Processors: []string(nil), Stored: false, AutoEncrytPrefix: "", HasDetailedContext: false, SkipDataTypes: []string{"Unique Identifier"}, OnlyDataTypes: []string(nil), Severity: "Critical", Description: "Sensitive data sent to Sentry detected.", RemediationMessage: "## Description\nLeaking sensitive data to third-party loggers is a common cause of data leaks and can lead to data breaches. This rule looks for instances of sensitive data sent to Sentry.\n\n## Remediations\n\nWhen logging errors or events, ensure all sensitive data is removed.\n\n## Resources\n- [Sentry Docs](https://docs.sentry.io/)\n", CWEIDs: []string{"201"}, Languages: []string{"ruby"}, Patterns: []settings.RulePattern{settings.RulePattern{Pattern: "Sentry::Breadcrumb.new($<...>$$<...>)\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.capture_message($<...>$$<...>)\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.init do |$|\n $.before_breadcrumb = lambda do |$, $<_:identifier>|\n $$.message = $\n end\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.set_context($<_>, $<...>$$<...>)\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.configure_scope do |$|\n $$.set_context($<_>, $<...>$$<...>)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.with_scope do |$|\n $$.set_context($<_>, $<...>$$<...>)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.configure_scope do |$|\n $$.set_extra($<_>, $)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.with_scope do |$|\n $$.set_extra($<_>, $)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.set_extras($<...>$$<...>)\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.configure_scope do |$|\n $$.set_extras($<...>$$<...>)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.with_scope do |$|\n $$.set_extras($<...>$$<...>)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.configure_scope do |$|\n $$.set_tag($<_>, $)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.with_scope do |$|\n $$.set_tag($<_>, $)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.set_tags($<...>$$<...>)\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.configure_scope do |$|\n $$.set_tags($<...>$$<...>)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.with_scope do |$|\n $$.set_tags($<...>$$<...>)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.set_user($<...>$$<...>)\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.configure_scope do |$|\n $$.set_user($<...>$$<...>)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}, settings.RulePattern{Pattern: "Sentry.with_scope do |$|\n $$.set_user($<...>$$<...>)\nend\n", Focus: "", Filters: []settings.PatternFilter{settings.PatternFilter{Not: (*settings.PatternFilter)(nil), Either: []settings.PatternFilter(nil), Variable: "DATA_TYPE", Detection: "datatype", Scope: "result", Filters: []settings.PatternFilter(nil), Contains: (*bool)(nil), Regex: (*regex.SerializableRegexp)(nil), Values: []string(nil), LengthLessThan: (*int)(nil), LessThan: (*int)(nil), LessThanOrEqual: (*int)(nil), GreaterThan: (*int)(nil), GreaterThanOrEqual: (*int)(nil), StringRegex: (*regex.SerializableRegexp)(nil), FilenameRegex: (*regex.SerializableRegexp)(nil)}}}}, SanitizerRuleID: "", DocumentationUrl: "https://docs.bearer.com/reference/rules/ruby_third_parties_sentry", IsAuxilary: false, DependencyCheck: false, Dependency: (*settings.Dependency)(nil), Metavars: map[string]settings.MetaVar(nil), ParamParenting: false, DetectPresence: false, OmitParent: false} } diff --git a/pkg/scanner/ruleset/ruleset.go b/pkg/scanner/ruleset/ruleset.go index ce8abdff5..1131eddfd 100644 --- a/pkg/scanner/ruleset/ruleset.go +++ b/pkg/scanner/ruleset/ruleset.go @@ -109,9 +109,7 @@ func getTriggerRuleIDs(languageRules []*settings.Rule) set.Set[string] { triggerRuleIDs := set.New[string]() for _, settingsRule := range languageRules { - if settingsRule.Trigger.RequiredDetection != nil { - triggerRuleIDs.Add(*settingsRule.Trigger.RequiredDetection) - } + triggerRuleIDs.AddAll(settingsRule.Trigger.RequiredDetections) } return triggerRuleIDs