contrast-agent 6.10.0 → 6.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.simplecov +1 -1
- data/Gemfile +1 -1
- data/Rakefile +1 -1
- data/ext/build_funchook.rb +2 -2
- data/ext/cs__assess_array/cs__assess_array.c +24 -18
- data/ext/cs__assess_array/extconf.rb +1 -1
- data/ext/cs__assess_basic_object/cs__assess_basic_object.c +1 -1
- data/ext/cs__assess_basic_object/extconf.rb +1 -1
- data/ext/cs__assess_fiber_track/cs__assess_fiber_track.c +1 -1
- data/ext/cs__assess_fiber_track/extconf.rb +1 -1
- data/ext/cs__assess_hash/cs__assess_hash.c +1 -1
- data/ext/cs__assess_hash/extconf.rb +1 -1
- data/ext/cs__assess_kernel/cs__assess_kernel.c +1 -1
- data/ext/cs__assess_kernel/extconf.rb +1 -1
- data/ext/cs__assess_marshal_module/cs__assess_marshal_module.c +7 -5
- data/ext/cs__assess_marshal_module/extconf.rb +1 -1
- data/ext/cs__assess_module/cs__assess_module.c +1 -1
- data/ext/cs__assess_module/extconf.rb +1 -1
- data/ext/cs__assess_regexp/cs__assess_regexp.c +1 -1
- data/ext/cs__assess_regexp/extconf.rb +1 -1
- data/ext/cs__assess_string/cs__assess_string.c +1 -1
- data/ext/cs__assess_string/extconf.rb +1 -1
- data/ext/cs__assess_string_interpolation/cs__assess_string_interpolation.c +1 -1
- data/ext/cs__assess_string_interpolation/extconf.rb +1 -1
- data/ext/cs__assess_test/extconf.rb +1 -1
- data/ext/cs__assess_yield_track/cs__assess_yield_track.c +1 -1
- data/ext/cs__assess_yield_track/extconf.rb +1 -1
- data/ext/cs__common/cs__common.c +1 -1
- data/ext/cs__common/extconf.rb +1 -1
- data/ext/cs__contrast_patch/cs__contrast_patch.c +12 -10
- data/ext/cs__contrast_patch/extconf.rb +1 -1
- data/ext/cs__os_information/cs__os_information.c +1 -1
- data/ext/cs__os_information/extconf.rb +1 -1
- data/ext/cs__scope/cs__scope.c +390 -207
- data/ext/cs__scope/cs__scope.h +3 -1
- data/ext/cs__scope/extconf.rb +1 -1
- data/ext/cs__tests/cs__tests.c +1 -1
- data/ext/cs__tests/extconf.rb +1 -1
- data/ext/extconf_common.rb +1 -1
- data/lib/contrast/agent/assess/contrast_object.rb +1 -1
- data/lib/contrast/agent/assess/events/event_data.rb +1 -1
- data/lib/contrast/agent/assess/finalizers/freeze.rb +1 -1
- data/lib/contrast/agent/assess/finalizers/hash.rb +1 -1
- data/lib/contrast/agent/assess/policy/dynamic_source_factory.rb +1 -1
- data/lib/contrast/agent/assess/policy/patcher.rb +1 -1
- data/lib/contrast/agent/assess/policy/policy.rb +1 -1
- data/lib/contrast/agent/assess/policy/policy_node.rb +1 -1
- data/lib/contrast/agent/assess/policy/policy_node_utils.rb +1 -1
- data/lib/contrast/agent/assess/policy/policy_scanner.rb +1 -1
- data/lib/contrast/agent/assess/policy/preshift.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagation_method.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagation_node.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/append.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/base.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/buffer.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/center.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/custom.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/database_write.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/insert.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/keep.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/match_data.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/next.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/prepend.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/rack_protection.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/remove.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/replace.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/reverse.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/select.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/splat.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/split.rb +2 -5
- data/lib/contrast/agent/assess/policy/propagator/substitution.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/substitution_utils.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/trim.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator.rb +1 -1
- data/lib/contrast/agent/assess/policy/source_method.rb +1 -3
- data/lib/contrast/agent/assess/policy/source_node.rb +1 -1
- data/lib/contrast/agent/assess/policy/source_validation/cross_site_validator.rb +1 -1
- data/lib/contrast/agent/assess/policy/source_validation/source_validation.rb +1 -1
- data/lib/contrast/agent/assess/policy/trigger/reflected_xss.rb +2 -1
- data/lib/contrast/agent/assess/policy/trigger/xpath.rb +1 -1
- data/lib/contrast/agent/assess/policy/trigger_method.rb +1 -1
- data/lib/contrast/agent/assess/policy/trigger_node.rb +1 -1
- data/lib/contrast/agent/assess/policy/trigger_validation/redos_validator.rb +1 -1
- data/lib/contrast/agent/assess/policy/trigger_validation/ssrf_validator.rb +1 -1
- data/lib/contrast/agent/assess/policy/trigger_validation/trigger_validation.rb +1 -1
- data/lib/contrast/agent/assess/policy/trigger_validation/xss_validator.rb +1 -1
- data/lib/contrast/agent/assess/properties.rb +1 -1
- data/lib/contrast/agent/assess/property/evented.rb +1 -1
- data/lib/contrast/agent/assess/property/tagged.rb +1 -1
- data/lib/contrast/agent/assess/property/updated.rb +1 -1
- data/lib/contrast/agent/assess/rule/provider/hardcoded_key.rb +1 -1
- data/lib/contrast/agent/assess/rule/provider/hardcoded_password.rb +1 -1
- data/lib/contrast/agent/assess/rule/provider/hardcoded_value_rule.rb +1 -1
- data/lib/contrast/agent/assess/rule/provider.rb +1 -1
- data/lib/contrast/agent/assess/rule/response/auto_complete_rule.rb +1 -1
- data/lib/contrast/agent/assess/rule/response/base_rule.rb +1 -1
- data/lib/contrast/agent/assess/rule/response/body_rule.rb +1 -1
- data/lib/contrast/agent/assess/rule/response/cache_control_header_rule.rb +1 -1
- data/lib/contrast/agent/assess/rule/response/click_jacking_header_rule.rb +1 -1
- data/lib/contrast/agent/assess/rule/response/csp_header_insecure_rule.rb +1 -1
- data/lib/contrast/agent/assess/rule/response/csp_header_missing_rule.rb +1 -1
- data/lib/contrast/agent/assess/rule/response/framework/rails_support.rb +1 -1
- data/lib/contrast/agent/assess/rule/response/header_rule.rb +1 -1
- data/lib/contrast/agent/assess/rule/response/hsts_header_rule.rb +1 -1
- data/lib/contrast/agent/assess/rule/response/parameters_pollution_rule.rb +1 -1
- data/lib/contrast/agent/assess/rule/response/x_content_type_header_rule.rb +1 -1
- data/lib/contrast/agent/assess/rule/response/x_xss_protection_header_rule.rb +1 -1
- data/lib/contrast/agent/assess/tag.rb +1 -1
- data/lib/contrast/agent/assess/tracker.rb +1 -1
- data/lib/contrast/agent/assess.rb +1 -1
- data/lib/contrast/agent/at_exit_hook.rb +1 -1
- data/lib/contrast/agent/deadzone/policy/deadzone_node.rb +1 -1
- data/lib/contrast/agent/deadzone/policy/policy.rb +1 -1
- data/lib/contrast/agent/disable_reaction.rb +1 -1
- data/lib/contrast/agent/excluder.rb +125 -43
- data/lib/contrast/agent/exclusion_matcher.rb +11 -55
- data/lib/contrast/agent/inventory/database_config.rb +1 -1
- data/lib/contrast/agent/inventory/dependencies.rb +1 -1
- data/lib/contrast/agent/inventory/dependency_analysis.rb +1 -1
- data/lib/contrast/agent/inventory/dependency_usage_analysis.rb +1 -1
- data/lib/contrast/agent/inventory/policy/datastores.rb +1 -1
- data/lib/contrast/agent/inventory/policy/policy.rb +1 -1
- data/lib/contrast/agent/inventory/policy/trigger_node.rb +1 -1
- data/lib/contrast/agent/inventory.rb +1 -1
- data/lib/contrast/agent/middleware.rb +22 -9
- data/lib/contrast/agent/module_data.rb +1 -1
- data/lib/contrast/agent/patching/policy/after_load_patch.rb +1 -1
- data/lib/contrast/agent/patching/policy/after_load_patcher.rb +1 -1
- data/lib/contrast/agent/patching/policy/method_policy.rb +1 -1
- data/lib/contrast/agent/patching/policy/method_policy_extend.rb +7 -3
- data/lib/contrast/agent/patching/policy/module_policy.rb +1 -1
- data/lib/contrast/agent/patching/policy/patch.rb +1 -1
- data/lib/contrast/agent/patching/policy/patch_status.rb +1 -1
- data/lib/contrast/agent/patching/policy/patcher.rb +1 -1
- data/lib/contrast/agent/patching/policy/policy.rb +1 -1
- data/lib/contrast/agent/patching/policy/policy_node.rb +1 -1
- data/lib/contrast/agent/patching/policy/trigger_node.rb +2 -2
- data/lib/contrast/agent/protect/exploitable_collection.rb +1 -1
- data/lib/contrast/agent/protect/input_analyzer/input_analyzer.rb +4 -2
- data/lib/contrast/agent/protect/input_analyzer/worth_watching_analyzer.rb +12 -11
- data/lib/contrast/agent/protect/policy/applies_command_injection_rule.rb +1 -1
- data/lib/contrast/agent/protect/policy/applies_deserialization_rule.rb +1 -1
- data/lib/contrast/agent/protect/policy/applies_no_sqli_rule.rb +1 -1
- data/lib/contrast/agent/protect/policy/applies_path_traversal_rule.rb +3 -3
- data/lib/contrast/agent/protect/policy/applies_sqli_rule.rb +1 -1
- data/lib/contrast/agent/protect/policy/applies_xxe_rule.rb +1 -1
- data/lib/contrast/agent/protect/policy/policy.rb +1 -1
- data/lib/contrast/agent/protect/policy/rule_applicator.rb +6 -1
- data/lib/contrast/agent/protect/policy/trigger_node.rb +1 -1
- data/lib/contrast/agent/protect/rule/base.rb +9 -19
- data/lib/contrast/agent/protect/rule/base_service.rb +34 -12
- data/lib/contrast/agent/protect/rule/bot_blocker/bot_blocker_input_classification.rb +1 -1
- data/lib/contrast/agent/protect/rule/bot_blocker.rb +1 -1
- data/lib/contrast/agent/protect/rule/cmd_injection.rb +1 -1
- data/lib/contrast/agent/protect/rule/cmdi/cmdi_backdoors.rb +9 -51
- data/lib/contrast/agent/protect/rule/cmdi/cmdi_base_rule.rb +12 -19
- data/lib/contrast/agent/protect/rule/cmdi/cmdi_chained_command.rb +11 -12
- data/lib/contrast/agent/protect/rule/cmdi/cmdi_dangerous_path.rb +11 -12
- data/lib/contrast/agent/protect/rule/cmdi/cmdi_input_classification.rb +1 -1
- data/lib/contrast/agent/protect/rule/default_scanner.rb +1 -1
- data/lib/contrast/agent/protect/rule/deserialization.rb +2 -3
- data/lib/contrast/agent/protect/rule/no_sqli/mongo_no_sql_scanner.rb +1 -1
- data/lib/contrast/agent/protect/rule/no_sqli/no_sqli_input_classification.rb +1 -1
- data/lib/contrast/agent/protect/rule/no_sqli.rb +1 -13
- data/lib/contrast/agent/protect/rule/path_traversal/path_traversal_input_classification.rb +1 -1
- data/lib/contrast/agent/protect/rule/path_traversal/path_traversal_semantic_security_bypass.rb +34 -9
- data/lib/contrast/agent/protect/rule/path_traversal.rb +1 -47
- data/lib/contrast/agent/protect/rule/sql_sample_builder.rb +1 -1
- data/lib/contrast/agent/protect/rule/sqli/default_sql_scanner.rb +1 -1
- data/lib/contrast/agent/protect/rule/sqli/mysql_sql_scanner.rb +1 -1
- data/lib/contrast/agent/protect/rule/sqli/postgres_sql_scanner.rb +2 -3
- data/lib/contrast/agent/protect/rule/sqli/sqli_base_rule.rb +1 -1
- data/lib/contrast/agent/protect/rule/sqli/sqli_input_classification.rb +1 -1
- data/lib/contrast/agent/protect/rule/sqli/sqli_semantic/sqli_dangerous_functions.rb +5 -5
- data/lib/contrast/agent/protect/rule/sqli/sqlite_sql_scanner.rb +1 -1
- data/lib/contrast/agent/protect/rule/sqli.rb +1 -13
- data/lib/contrast/agent/protect/rule/unsafe_file_upload/unsafe_file_upload_input_classification.rb +1 -1
- data/lib/contrast/agent/protect/rule/unsafe_file_upload.rb +1 -2
- data/lib/contrast/agent/protect/rule/xss/reflected_xss_input_classification.rb +1 -1
- data/lib/contrast/agent/protect/rule/xss.rb +1 -1
- data/lib/contrast/agent/protect/rule/xxe/entity_wrapper.rb +1 -1
- data/lib/contrast/agent/protect/rule/xxe.rb +2 -3
- data/lib/contrast/agent/protect/rule.rb +1 -1
- data/lib/contrast/agent/reporting/attack_result/attack_result.rb +1 -1
- data/lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb +1 -1
- data/lib/contrast/agent/reporting/attack_result/response_type.rb +1 -1
- data/lib/contrast/agent/reporting/attack_result/user_input.rb +1 -1
- data/lib/contrast/{api/communication → agent/reporting}/connection_status.rb +3 -17
- data/lib/contrast/agent/reporting/details/bot_blocker_details.rb +1 -1
- data/lib/contrast/agent/reporting/details/cmd_injection_details.rb +1 -1
- data/lib/contrast/agent/reporting/details/details.rb +1 -1
- data/lib/contrast/agent/reporting/details/ip_denylist_details.rb +1 -1
- data/lib/contrast/agent/reporting/details/no_sqli_details.rb +1 -1
- data/lib/contrast/agent/reporting/details/path_traversal_details.rb +1 -1
- data/lib/contrast/agent/reporting/details/path_traversal_semantic_analysis_details.rb +1 -1
- data/lib/contrast/agent/reporting/details/protect_rule_details.rb +1 -1
- data/lib/contrast/agent/reporting/details/sqli_dangerous_functions.rb +1 -1
- data/lib/contrast/agent/reporting/details/sqli_details.rb +1 -1
- data/lib/contrast/agent/reporting/details/untrusted_deserialization_details.rb +1 -1
- data/lib/contrast/agent/reporting/details/virtual_patch_details.rb +1 -1
- data/lib/contrast/agent/reporting/details/xss_details.rb +1 -1
- data/lib/contrast/agent/reporting/details/xss_match.rb +1 -1
- data/lib/contrast/agent/reporting/details/xxe_details.rb +1 -1
- data/lib/contrast/agent/reporting/details/xxe_match.rb +1 -1
- data/lib/contrast/agent/reporting/details/xxe_wrapper.rb +1 -1
- data/lib/contrast/agent/reporting/input_analysis/details/bot_blocker_details.rb +1 -1
- data/lib/contrast/agent/reporting/input_analysis/details/protect_rule_details.rb +1 -1
- data/lib/contrast/agent/reporting/input_analysis/input_analysis.rb +1 -1
- data/lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb +1 -1
- data/lib/contrast/agent/reporting/input_analysis/input_type.rb +1 -1
- data/lib/contrast/agent/reporting/input_analysis/score_level.rb +1 -1
- data/lib/contrast/agent/reporting/masker/masker.rb +1 -1
- data/lib/contrast/agent/reporting/masker/masker_utils.rb +1 -1
- data/lib/contrast/agent/reporting/report.rb +1 -1
- data/lib/contrast/agent/reporting/reporter.rb +14 -17
- data/lib/contrast/agent/reporting/reporting_events/agent_startup.rb +2 -2
- data/lib/contrast/agent/reporting/reporting_events/application_activity.rb +5 -4
- data/lib/contrast/agent/reporting/reporting_events/application_defend_activity.rb +13 -9
- data/lib/contrast/agent/reporting/reporting_events/application_defend_attack_activity.rb +5 -6
- data/lib/contrast/agent/reporting/reporting_events/application_defend_attack_sample.rb +1 -1
- data/lib/contrast/agent/reporting/reporting_events/application_defend_attack_sample_activity.rb +4 -3
- data/lib/contrast/agent/reporting/reporting_events/application_defend_attack_sample_stack.rb +1 -1
- data/lib/contrast/agent/reporting/reporting_events/application_defend_attacker_activity.rb +19 -12
- data/lib/contrast/agent/reporting/reporting_events/application_inventory.rb +2 -2
- data/lib/contrast/agent/reporting/reporting_events/application_inventory_activity.rb +2 -2
- data/lib/contrast/agent/reporting/reporting_events/application_reporting_event.rb +1 -1
- data/lib/contrast/agent/reporting/reporting_events/application_settings.rb +2 -2
- data/lib/contrast/agent/reporting/reporting_events/application_startup.rb +2 -2
- data/lib/contrast/agent/reporting/reporting_events/application_startup_instrumentation.rb +1 -1
- data/lib/contrast/agent/reporting/reporting_events/application_update.rb +2 -3
- data/lib/contrast/agent/reporting/reporting_events/architecture_component.rb +4 -10
- data/lib/contrast/agent/reporting/reporting_events/discovered_route.rb +10 -14
- data/lib/contrast/agent/reporting/reporting_events/finding.rb +2 -11
- data/lib/contrast/agent/reporting/reporting_events/finding_event.rb +5 -12
- data/lib/contrast/agent/reporting/reporting_events/finding_event_object.rb +4 -12
- data/lib/contrast/agent/reporting/reporting_events/finding_event_parent_object.rb +9 -13
- data/lib/contrast/agent/reporting/reporting_events/finding_event_property.rb +9 -13
- data/lib/contrast/agent/reporting/reporting_events/finding_event_signature.rb +5 -12
- data/lib/contrast/agent/reporting/reporting_events/finding_event_source.rb +10 -21
- data/lib/contrast/agent/reporting/reporting_events/finding_event_stack.rb +9 -12
- data/lib/contrast/agent/reporting/reporting_events/finding_event_taint_range.rb +10 -14
- data/lib/contrast/agent/reporting/reporting_events/finding_event_taint_range_tags.rb +1 -1
- data/lib/contrast/agent/reporting/reporting_events/finding_request.rb +4 -12
- data/lib/contrast/agent/reporting/reporting_events/library_discovery.rb +14 -14
- data/lib/contrast/agent/reporting/reporting_events/library_usage_observation.rb +14 -14
- data/lib/contrast/agent/reporting/reporting_events/observed_library_usage.rb +3 -11
- data/lib/contrast/agent/reporting/reporting_events/observed_route.rb +10 -16
- data/lib/contrast/agent/reporting/reporting_events/poll.rb +2 -2
- data/lib/contrast/agent/reporting/reporting_events/preflight.rb +13 -2
- data/lib/contrast/agent/reporting/reporting_events/preflight_message.rb +5 -13
- data/lib/contrast/agent/reporting/reporting_events/reportable_hash.rb +47 -0
- data/lib/contrast/agent/reporting/reporting_events/reporting_event.rb +4 -35
- data/lib/contrast/agent/reporting/reporting_events/route_coverage.rb +1 -3
- data/lib/contrast/agent/reporting/reporting_events/route_discovery.rb +9 -13
- data/lib/contrast/agent/reporting/reporting_events/route_discovery_observation.rb +9 -13
- data/lib/contrast/agent/reporting/reporting_events/server_reporting_event.rb +1 -1
- data/lib/contrast/agent/reporting/reporting_events/server_settings.rb +2 -2
- data/lib/contrast/agent/reporting/reporting_utilities/audit.rb +5 -2
- data/lib/contrast/agent/reporting/reporting_utilities/build_preflight.rb +5 -2
- data/lib/contrast/agent/reporting/reporting_utilities/endpoints.rb +8 -8
- data/lib/contrast/agent/reporting/reporting_utilities/headers.rb +6 -3
- data/lib/contrast/agent/reporting/reporting_utilities/ng_response_extractor.rb +4 -4
- data/lib/contrast/agent/reporting/reporting_utilities/reporter_client.rb +6 -19
- data/lib/contrast/agent/reporting/reporting_utilities/reporter_client_utils.rb +20 -3
- data/lib/contrast/agent/reporting/reporting_utilities/reporting_storage.rb +1 -1
- data/lib/contrast/agent/reporting/reporting_utilities/response.rb +1 -1
- data/lib/contrast/agent/reporting/reporting_utilities/response_extractor.rb +2 -22
- data/lib/contrast/agent/reporting/reporting_utilities/response_handler.rb +1 -1
- data/lib/contrast/agent/reporting/reporting_utilities/response_handler_mode.rb +1 -1
- data/lib/contrast/agent/reporting/reporting_utilities/response_handler_utils.rb +26 -9
- data/lib/contrast/agent/reporting/reporting_workers/application_server_worker.rb +1 -1
- data/lib/contrast/agent/reporting/reporting_workers/reporter_heartbeat.rb +1 -1
- data/lib/contrast/agent/reporting/reporting_workers/reporting_workers.rb +1 -1
- data/lib/contrast/agent/reporting/reporting_workers/server_settings_worker.rb +1 -1
- data/lib/contrast/agent/reporting/settings/application_settings.rb +1 -1
- data/lib/contrast/agent/reporting/settings/assess.rb +1 -1
- data/lib/contrast/agent/reporting/settings/assess_rule.rb +1 -1
- data/lib/contrast/agent/reporting/settings/assess_server_feature.rb +1 -1
- data/lib/contrast/agent/reporting/settings/bot_blocker.rb +1 -1
- data/lib/contrast/agent/reporting/settings/exclusion_base.rb +90 -12
- data/lib/contrast/agent/reporting/settings/exclusions.rb +11 -31
- data/lib/contrast/agent/reporting/settings/helpers.rb +41 -5
- data/lib/contrast/agent/reporting/settings/input_exclusion.rb +54 -10
- data/lib/contrast/agent/reporting/settings/ip_filter.rb +1 -1
- data/lib/contrast/agent/reporting/settings/keyword.rb +1 -1
- data/lib/contrast/agent/reporting/settings/log_enhancer.rb +1 -1
- data/lib/contrast/agent/reporting/settings/protect.rb +1 -1
- data/lib/contrast/agent/reporting/settings/protect_rule.rb +1 -1
- data/lib/contrast/agent/reporting/settings/protect_server_feature.rb +1 -1
- data/lib/contrast/agent/reporting/settings/reaction.rb +1 -1
- data/lib/contrast/agent/reporting/settings/rule_definition.rb +1 -1
- data/lib/contrast/agent/reporting/settings/sampling.rb +1 -1
- data/lib/contrast/agent/reporting/settings/sanitizer.rb +1 -1
- data/lib/contrast/agent/reporting/settings/security_logger.rb +1 -1
- data/lib/contrast/agent/reporting/settings/sensitive_data_masking.rb +1 -1
- data/lib/contrast/agent/reporting/settings/sensitive_data_masking_rule.rb +1 -1
- data/lib/contrast/agent/reporting/settings/server_features.rb +1 -1
- data/lib/contrast/agent/reporting/settings/syslog.rb +1 -1
- data/lib/contrast/agent/reporting/settings/url_exclusion.rb +2 -26
- data/lib/contrast/agent/reporting/settings/validator.rb +1 -1
- data/lib/contrast/agent/reporting/settings/virtual_patch.rb +1 -1
- data/lib/contrast/agent/reporting/settings/virtual_patch_condition.rb +1 -1
- data/lib/contrast/agent/request.rb +1 -1
- data/lib/contrast/agent/request_context.rb +1 -1
- data/lib/contrast/agent/request_context_extend.rb +1 -1
- data/lib/contrast/agent/request_handler.rb +1 -1
- data/lib/contrast/agent/response.rb +1 -1
- data/lib/contrast/agent/rule_set.rb +1 -1
- data/lib/contrast/agent/scope.rb +9 -1
- data/lib/contrast/agent/static_analysis.rb +1 -1
- data/lib/contrast/agent/telemetry/base.rb +23 -17
- data/lib/contrast/agent/telemetry/client.rb +109 -0
- data/lib/contrast/agent/telemetry/{events/event.rb → event.rb} +1 -1
- data/lib/contrast/agent/telemetry/{events/exceptions/telemetry_exception_base.rb → exception/base.rb} +2 -2
- data/lib/contrast/agent/telemetry/{events/exceptions/telemetry_exception_event.rb → exception/event.rb} +10 -10
- data/lib/contrast/agent/telemetry/{events/exceptions/telemetry_exception_message.rb → exception/message.rb} +9 -9
- data/lib/contrast/agent/telemetry/{events/exceptions/telemetry_exception_message_exception.rb → exception/message_exception.rb} +9 -9
- data/lib/contrast/agent/telemetry/{events/exceptions/telemetry_exception_stack_frame.rb → exception/stack_frame.rb} +4 -4
- data/lib/contrast/agent/telemetry/exception.rb +19 -0
- data/lib/contrast/agent/telemetry/hash.rb +71 -0
- data/lib/contrast/{utils/telemetry_identifier.rb → agent/telemetry/identifier.rb} +5 -5
- data/lib/contrast/agent/telemetry/{events/metric_event.rb → metric_event.rb} +2 -2
- data/lib/contrast/agent/telemetry/{events/startup_metrics_event.rb → startup_metrics_event.rb} +2 -2
- data/lib/contrast/{utils → agent}/telemetry.rb +4 -4
- data/lib/contrast/agent/thread.rb +1 -1
- data/lib/contrast/agent/thread_watcher.rb +28 -31
- data/lib/contrast/agent/tracepoint_hook.rb +1 -1
- data/lib/contrast/agent/version.rb +2 -2
- data/lib/contrast/agent/worker_thread.rb +1 -1
- data/lib/contrast/agent.rb +6 -2
- data/lib/contrast/agent_lib/api/command_injection.rb +1 -1
- data/lib/contrast/agent_lib/api/init.rb +1 -1
- data/lib/contrast/agent_lib/api/input_tracing.rb +1 -1
- data/lib/contrast/agent_lib/api/panic.rb +1 -1
- data/lib/contrast/agent_lib/api/path_semantic_file_security_bypass.rb +1 -1
- data/lib/contrast/agent_lib/interface.rb +1 -1
- data/lib/contrast/agent_lib/interface_base.rb +2 -2
- data/lib/contrast/agent_lib/return_types/eval_result.rb +1 -1
- data/lib/contrast/agent_lib/test.rb +1 -1
- data/lib/contrast/components/agent.rb +1 -1
- data/lib/contrast/components/api.rb +1 -1
- data/lib/contrast/components/app_context.rb +1 -1
- data/lib/contrast/components/app_context_extend.rb +1 -1
- data/lib/contrast/components/assess.rb +1 -1
- data/lib/contrast/components/assess_rules.rb +1 -1
- data/lib/contrast/components/base.rb +1 -1
- data/lib/contrast/components/config/sources.rb +1 -1
- data/lib/contrast/components/config.rb +2 -2
- data/lib/contrast/components/heap_dump.rb +1 -1
- data/lib/contrast/components/inventory.rb +1 -1
- data/lib/contrast/components/logger.rb +1 -1
- data/lib/contrast/components/polling.rb +4 -4
- data/lib/contrast/components/protect.rb +1 -1
- data/lib/contrast/components/ruby_component.rb +45 -6
- data/lib/contrast/components/sampling.rb +6 -6
- data/lib/contrast/components/scope.rb +9 -1
- data/lib/contrast/components/security_logger.rb +1 -1
- data/lib/contrast/components/settings.rb +13 -12
- data/lib/contrast/config/api_proxy_configuration.rb +1 -1
- data/lib/contrast/config/base_configuration.rb +1 -1
- data/lib/contrast/config/certification_configuration.rb +1 -1
- data/lib/contrast/config/config.rb +14 -12
- data/lib/contrast/config/diagnostics.rb +12 -3
- data/lib/contrast/config/diagnostics_tools.rb +2 -1
- data/lib/contrast/config/effective_config.rb +81 -15
- data/lib/contrast/config/effective_config_value.rb +4 -4
- data/lib/contrast/config/env_variables.rb +1 -1
- data/lib/contrast/config/exception_configuration.rb +1 -1
- data/lib/contrast/config/protect_rule_configuration.rb +1 -1
- data/lib/contrast/config/protect_rules_configuration.rb +1 -1
- data/lib/contrast/config/request_audit_configuration.rb +1 -1
- data/lib/contrast/config/server_configuration.rb +2 -2
- data/lib/contrast/config.rb +1 -1
- data/lib/contrast/configuration.rb +1 -1
- data/lib/contrast/extension/assess/array.rb +1 -1
- data/lib/contrast/extension/assess/erb.rb +1 -1
- data/lib/contrast/extension/assess/eval_trigger.rb +1 -1
- data/lib/contrast/extension/assess/exec_trigger.rb +1 -1
- data/lib/contrast/extension/assess/fiber.rb +1 -1
- data/lib/contrast/extension/assess/hash.rb +1 -1
- data/lib/contrast/extension/assess/kernel.rb +1 -1
- data/lib/contrast/extension/assess/marshal.rb +1 -1
- data/lib/contrast/extension/assess/regexp.rb +1 -1
- data/lib/contrast/extension/assess/string.rb +1 -1
- data/lib/contrast/extension/assess.rb +1 -1
- data/lib/contrast/extension/delegator.rb +1 -1
- data/lib/contrast/extension/extension.rb +1 -1
- data/lib/contrast/extension/inventory.rb +1 -1
- data/lib/contrast/extension/module.rb +1 -1
- data/lib/contrast/extension/object.rb +1 -1
- data/lib/contrast/extension/protect/psych.rb +1 -1
- data/lib/contrast/extension/protect.rb +1 -1
- data/lib/contrast/extension/thread.rb +1 -1
- data/lib/contrast/framework/base_support.rb +1 -1
- data/lib/contrast/framework/grape/support.rb +1 -1
- data/lib/contrast/framework/manager.rb +1 -1
- data/lib/contrast/framework/manager_extend.rb +1 -1
- data/lib/contrast/framework/rack/patch/session_cookie.rb +3 -2
- data/lib/contrast/framework/rack/patch/support.rb +1 -1
- data/lib/contrast/framework/rack/support.rb +1 -1
- data/lib/contrast/framework/rails/patch/action_controller_live_buffer.rb +1 -1
- data/lib/contrast/framework/rails/patch/assess_configuration.rb +1 -1
- data/lib/contrast/framework/rails/patch/rails_application_configuration.rb +1 -1
- data/lib/contrast/framework/rails/patch/support.rb +1 -1
- data/lib/contrast/framework/rails/railtie.rb +1 -1
- data/lib/contrast/framework/rails/support.rb +1 -1
- data/lib/contrast/framework/sinatra/patch/encrypted_session_cookie.rb +39 -0
- data/lib/contrast/framework/sinatra/support.rb +14 -1
- data/lib/contrast/funchook/funchook.rb +1 -1
- data/lib/contrast/logger/aliased_logging.rb +12 -14
- data/lib/contrast/logger/application.rb +1 -1
- data/lib/contrast/logger/cef_log.rb +1 -1
- data/lib/contrast/logger/format.rb +1 -1
- data/lib/contrast/logger/log.rb +1 -1
- data/lib/contrast/logger/request.rb +1 -1
- data/lib/contrast/logger/time.rb +1 -1
- data/lib/contrast/security_exception.rb +1 -1
- data/lib/contrast/tasks/config.rb +1 -1
- data/lib/contrast/utils/assess/event_limit_utils.rb +1 -1
- data/lib/contrast/utils/assess/object_store.rb +1 -1
- data/lib/contrast/utils/assess/propagation_method_utils.rb +1 -1
- data/lib/contrast/utils/assess/property/tagged_utils.rb +1 -1
- data/lib/contrast/utils/assess/sampling_util.rb +1 -1
- data/lib/contrast/utils/assess/source_method_utils.rb +1 -1
- data/lib/contrast/utils/assess/split_utils.rb +1 -1
- data/lib/contrast/utils/assess/tracking_util.rb +1 -1
- data/lib/contrast/utils/assess/trigger_method_utils.rb +1 -1
- data/lib/contrast/utils/class_util.rb +1 -1
- data/lib/contrast/utils/duck_utils.rb +19 -1
- data/lib/contrast/utils/env_configuration_item.rb +1 -1
- data/lib/contrast/utils/findings.rb +1 -1
- data/lib/contrast/utils/hash_digest.rb +1 -1
- data/lib/contrast/utils/hash_digest_extend.rb +1 -1
- data/lib/contrast/utils/head_dump_utils_extend.rb +1 -1
- data/lib/contrast/utils/heap_dump_util.rb +2 -2
- data/lib/contrast/utils/input_classification_base.rb +2 -5
- data/lib/contrast/utils/invalid_configuration_util.rb +1 -1
- data/lib/contrast/utils/io_util.rb +1 -1
- data/lib/contrast/utils/job_servers_running.rb +1 -1
- data/lib/contrast/utils/log_utils.rb +3 -3
- data/lib/contrast/utils/lru_cache.rb +1 -1
- data/lib/contrast/utils/metrics_hash.rb +1 -1
- data/lib/contrast/utils/middleware_utils.rb +5 -5
- data/lib/contrast/utils/net_http_base.rb +3 -3
- data/lib/contrast/utils/object_share.rb +2 -1
- data/lib/contrast/utils/os.rb +1 -1
- data/lib/contrast/utils/patching/policy/patch_utils.rb +3 -3
- data/lib/contrast/utils/patching/policy/patcher_utils.rb +1 -1
- data/lib/contrast/utils/reporting/application_activity_batch_utils.rb +12 -4
- data/lib/contrast/utils/request_utils.rb +1 -1
- data/lib/contrast/utils/resource_loader.rb +1 -1
- data/lib/contrast/utils/response_utils.rb +1 -1
- data/lib/contrast/utils/routes_sent.rb +5 -2
- data/lib/contrast/utils/sha256_builder.rb +1 -1
- data/lib/contrast/utils/silence_maker.rb +16 -0
- data/lib/contrast/utils/stack_trace_utils.rb +1 -1
- data/lib/contrast/utils/string_utils.rb +1 -1
- data/lib/contrast/utils/tag_util.rb +1 -1
- data/lib/contrast/utils/thread_tracker.rb +1 -1
- data/lib/contrast/utils/timer.rb +1 -1
- data/lib/contrast-agent.rb +1 -1
- data/lib/contrast.rb +7 -6
- data/ruby-agent.gemspec +6 -6
- metadata +41 -40
- data/lib/contrast/agent/reporting/settings/code_exclusion.rb +0 -32
- data/lib/contrast/agent/telemetry/events/exceptions/obfuscate.rb +0 -124
- data/lib/contrast/agent/telemetry/events/exceptions/telemetry_exceptions.rb +0 -19
- data/lib/contrast/utils/telemetry_client.rb +0 -107
- data/lib/contrast/utils/telemetry_hash.rb +0 -65
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Contrast
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require 'contrast/components/logger'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Contrast
|
@@ -12,7 +12,7 @@ module Contrast
|
|
12
12
|
LANGUAGE_DEPRECATION_VERSION = '2.7'
|
13
13
|
LANGUAGE_DEPRECATION_YEAR = '2023'
|
14
14
|
LANGUAGE_DEPRECATION_WARNING =
|
15
|
-
"[Contrast Security] [DEPRECATION] Support for Ruby #{ LANGUAGE_DEPRECATION_VERSION } will be removed in "\
|
15
|
+
"[Contrast Security] [DEPRECATION] Support for Ruby #{ LANGUAGE_DEPRECATION_VERSION } will be removed in " \
|
16
16
|
"April #{ LANGUAGE_DEPRECATION_YEAR }. Please contact Customer Support prior if you require continued support."
|
17
17
|
|
18
18
|
def setup_agent
|
@@ -68,10 +68,10 @@ module Contrast
|
|
68
68
|
# if the file already exists we do nothing.
|
69
69
|
def telemetry_disclaimer
|
70
70
|
return unless Contrast::Agent::Telemetry::Base.enabled?
|
71
|
-
return unless Contrast::
|
71
|
+
return unless Contrast::Agent::Telemetry.create_telemetry_file
|
72
72
|
|
73
|
-
logger.info(Contrast::
|
74
|
-
$stdout.print(Contrast::
|
73
|
+
logger.info(Contrast::Agent::Telemetry.disclaimer)
|
74
|
+
$stdout.print(Contrast::Agent::Telemetry.disclaimer)
|
75
75
|
true
|
76
76
|
end
|
77
77
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require 'net/http'
|
@@ -136,10 +136,10 @@ module Contrast
|
|
136
136
|
initialize_client.verify_depth = 5
|
137
137
|
# open connection timeout in ms
|
138
138
|
# if connection reaches timeout this will produce Net::OpenTimeout error
|
139
|
-
initialize_client.open_timeout =
|
139
|
+
initialize_client.open_timeout = 15
|
140
140
|
# if we can't read the response or a chunk within time this will cause a
|
141
141
|
# Net::ReadTimeout error when the request is made
|
142
|
-
initialize_client.read_timeout =
|
142
|
+
initialize_client.read_timeout = 15
|
143
143
|
initialize_client
|
144
144
|
end
|
145
145
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
# rubocop:disable Security/Object/Freeze
|
@@ -14,6 +14,7 @@ module Contrast
|
|
14
14
|
EMPTY_STRING = ''
|
15
15
|
COLON = ':'
|
16
16
|
COMMA = ','
|
17
|
+
CONTRAST_DOT = 'contrast.'
|
17
18
|
DASH = '-'
|
18
19
|
DOUBLE_QUOTE = '"'
|
19
20
|
EQUALS = '='
|
data/lib/contrast/utils/os.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require 'contrast/components/scope'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Contrast
|
@@ -23,8 +23,8 @@ module Contrast
|
|
23
23
|
# Given a method, return a symbol in the format
|
24
24
|
# <method_start>_unbound_<method_name>
|
25
25
|
def build_unbound_method_name patcher_method
|
26
|
-
"#{ Contrast::Utils::ObjectShare::CONTRAST_PATCHED_METHOD_START }unbound"\
|
27
|
-
"#{ Contrast::Utils::ObjectShare::UNDERSCORE }"\
|
26
|
+
"#{ Contrast::Utils::ObjectShare::CONTRAST_PATCHED_METHOD_START }unbound" \
|
27
|
+
"#{ Contrast::Utils::ObjectShare::UNDERSCORE }" \
|
28
28
|
"#{ patcher_method }".to_sym
|
29
29
|
end
|
30
30
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Contrast
|
@@ -1,7 +1,8 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require 'contrast/agent/reporting/reporting_events/application_activity'
|
5
|
+
require 'contrast/utils/timer'
|
5
6
|
|
6
7
|
module Contrast
|
7
8
|
module Utils
|
@@ -12,12 +13,15 @@ module Contrast
|
|
12
13
|
DEFAULT_REPORTING_INTERVAL_MS = 30_000.cs__freeze
|
13
14
|
|
14
15
|
# @return [Integer] time when activity batch was created in ms
|
15
|
-
|
16
|
+
def batch_age
|
17
|
+
@_batch_age ||= Contrast::Utils::Timer.now_ms
|
18
|
+
end
|
16
19
|
|
17
20
|
# Merge a ApplicationActivity into the ApplicationActivityBatch
|
18
21
|
# @param activity [Contrast::Agent::Reporting::ApplicationActivity] from a RequestContext
|
19
22
|
def add_activity_to_batch activity
|
20
23
|
return unless activity
|
24
|
+
return if activity.defend.attackers.empty?
|
21
25
|
|
22
26
|
activity_batch.query_count += activity.query_count
|
23
27
|
activity_batch.routes << activity.routes
|
@@ -62,13 +66,17 @@ module Contrast
|
|
62
66
|
|
63
67
|
# resets the activity_batch object and it's batch_age
|
64
68
|
def reset_activity_batch
|
65
|
-
@
|
69
|
+
@_batch_age = Contrast::Utils::Timer.now_ms
|
66
70
|
@activity_batch = Contrast::Agent::Reporting::ApplicationActivity.new
|
67
71
|
end
|
68
72
|
|
73
|
+
# We need to check for attackers to see if the batch is newly created along side with the age check.
|
74
|
+
# In the reader we reset the batch and the age is correct but the event is empty. We need to prevent
|
75
|
+
# sending of empty event.
|
76
|
+
#
|
69
77
|
# @return [Boolean] if the age of the batch is outside the reporting interval
|
70
78
|
def report_batch?
|
71
|
-
reporting_interval <= (Contrast::Utils::Timer.now_ms - batch_age)
|
79
|
+
activity_batch.defend.attackers.any? && reporting_interval <= (Contrast::Utils::Timer.now_ms - batch_age)
|
72
80
|
end
|
73
81
|
|
74
82
|
# @return [Integer] interval to report to TeamServer in seconds
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Contrast
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Contrast
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Contrast
|
@@ -1,8 +1,8 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
# require 'contrast/components/logger'
|
5
|
-
|
5
|
+
require 'contrast/utils/duck_utils'
|
6
6
|
|
7
7
|
module Contrast
|
8
8
|
module Utils
|
@@ -25,6 +25,9 @@ module Contrast
|
|
25
25
|
# @param route [Contrast::Agent::Reporting::ObservedRoute] the route
|
26
26
|
# @return [boolean]
|
27
27
|
def sendable? route
|
28
|
+
return false if Contrast::Utils::DuckUtils.empty_duck?(route.signature)
|
29
|
+
return false if Contrast::Utils::DuckUtils.empty_duck?(route.url)
|
30
|
+
|
28
31
|
route_hash = route.hash_id
|
29
32
|
|
30
33
|
# If hash doesn't exist in @cache...
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require 'singleton'
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Contrast
|
5
|
+
module Utils
|
6
|
+
# Silence sometimes is a bliss.
|
7
|
+
module SilenceMaker
|
8
|
+
def self.hush &block
|
9
|
+
old_verbose, $VERBOSE = $VERBOSE, nil # rubocop:disable Style/ParallelAssignment
|
10
|
+
yield(block)
|
11
|
+
ensure
|
12
|
+
$VERBOSE = old_verbose
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require 'contrast/utils/object_share'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Contrast
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Contrast
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Contrast
|
data/lib/contrast/utils/timer.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Contrast
|
data/lib/contrast-agent.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
# We need this to make bundler happy since it's the name of the gem, unless we
|
data/lib/contrast.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
# Used to prevent deprecation warnings from flooding stdout
|
@@ -61,27 +61,28 @@ require 'contrast/components/sampling'
|
|
61
61
|
require 'contrast/components/scope'
|
62
62
|
require 'contrast/components/settings'
|
63
63
|
require 'contrast/utils/routes_sent'
|
64
|
-
require 'contrast/
|
65
|
-
require 'contrast/
|
66
|
-
require 'contrast/agent/telemetry/
|
64
|
+
require 'contrast/agent/telemetry/hash'
|
65
|
+
require 'contrast/agent/telemetry'
|
66
|
+
require 'contrast/agent/telemetry/exception/event'
|
67
67
|
require 'contrast/agent_lib/interface'
|
68
68
|
|
69
69
|
module Contrast # :nodoc:
|
70
70
|
CONFIG = Contrast::Components::Config::Interface.new
|
71
71
|
SCOPE = Contrast::Components::Scope::Interface.new
|
72
|
+
APP_CONTEXT = CONFIG.application
|
72
73
|
API = CONFIG.api
|
73
74
|
SETTINGS = Contrast::Components::Settings::Interface.new
|
74
75
|
ASSESS = CONFIG.assess
|
75
76
|
PROTECT = Contrast::Components::Protect::Interface.new
|
76
77
|
INVENTORY = CONFIG.inventory
|
77
78
|
AGENT = CONFIG.agent
|
79
|
+
RUBY_INTERFACE = AGENT.ruby
|
78
80
|
LOGGER = AGENT.logger
|
79
81
|
AGENT_LIB = Contrast::AgentLib::Interface.new
|
80
|
-
APP_CONTEXT = CONFIG.application
|
81
82
|
end
|
82
83
|
|
83
84
|
module Contrast
|
84
|
-
TELEMETRY_EXCEPTIONS = (Contrast::
|
85
|
+
TELEMETRY_EXCEPTIONS = (Contrast::Agent::Telemetry::Hash.new if Contrast::Agent::Telemetry.exceptions_enabled?)
|
85
86
|
ROUTES_SENT = Contrast::Utils::RoutesSent.new
|
86
87
|
end
|
87
88
|
|
data/ruby-agent.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2023 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require_relative './lib/contrast/agent/version'
|
@@ -75,7 +75,7 @@ def self.add_specs spec
|
|
75
75
|
spec.add_development_dependency 'factory_bot'
|
76
76
|
spec.add_development_dependency 'fake_ftp'
|
77
77
|
spec.add_development_dependency 'openssl'
|
78
|
-
spec.add_development_dependency 'parallel_tests'
|
78
|
+
spec.add_development_dependency 'parallel_tests', '~> 3.0'
|
79
79
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
80
80
|
spec.add_development_dependency 'rspec-benchmark'
|
81
81
|
spec.add_development_dependency 'rspec_junit_formatter', '0.3.0'
|
@@ -92,11 +92,11 @@ end
|
|
92
92
|
|
93
93
|
# Dependencies used to run all of our Rubocop during the linting phase.
|
94
94
|
def self.add_rubocop spec
|
95
|
-
spec.add_development_dependency 'rubocop', '1.
|
96
|
-
spec.add_development_dependency 'rubocop-performance', '1.
|
97
|
-
spec.add_development_dependency 'rubocop-rails', '2.
|
95
|
+
spec.add_development_dependency 'rubocop', '1.37.1'
|
96
|
+
spec.add_development_dependency 'rubocop-performance', '1.15.0'
|
97
|
+
spec.add_development_dependency 'rubocop-rails', '2.17.2'
|
98
98
|
spec.add_development_dependency 'rubocop-rake', '0.6.0'
|
99
|
-
spec.add_development_dependency 'rubocop-rspec', '2.
|
99
|
+
spec.add_development_dependency 'rubocop-rspec', '2.14.2'
|
100
100
|
end
|
101
101
|
|
102
102
|
# Dependencies not mocked out during RSpec that we test real code of, beyond just frameworks.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contrast-agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- galen.palmer@contrastsecurity.com
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: exe
|
15
15
|
cert_chain: []
|
16
|
-
date:
|
16
|
+
date: 2023-01-10 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: bundler
|
@@ -161,42 +161,42 @@ dependencies:
|
|
161
161
|
requirements:
|
162
162
|
- - '='
|
163
163
|
- !ruby/object:Gem::Version
|
164
|
-
version: 1.
|
164
|
+
version: 1.37.1
|
165
165
|
type: :development
|
166
166
|
prerelease: false
|
167
167
|
version_requirements: !ruby/object:Gem::Requirement
|
168
168
|
requirements:
|
169
169
|
- - '='
|
170
170
|
- !ruby/object:Gem::Version
|
171
|
-
version: 1.
|
171
|
+
version: 1.37.1
|
172
172
|
- !ruby/object:Gem::Dependency
|
173
173
|
name: rubocop-performance
|
174
174
|
requirement: !ruby/object:Gem::Requirement
|
175
175
|
requirements:
|
176
176
|
- - '='
|
177
177
|
- !ruby/object:Gem::Version
|
178
|
-
version: 1.
|
178
|
+
version: 1.15.0
|
179
179
|
type: :development
|
180
180
|
prerelease: false
|
181
181
|
version_requirements: !ruby/object:Gem::Requirement
|
182
182
|
requirements:
|
183
183
|
- - '='
|
184
184
|
- !ruby/object:Gem::Version
|
185
|
-
version: 1.
|
185
|
+
version: 1.15.0
|
186
186
|
- !ruby/object:Gem::Dependency
|
187
187
|
name: rubocop-rails
|
188
188
|
requirement: !ruby/object:Gem::Requirement
|
189
189
|
requirements:
|
190
190
|
- - '='
|
191
191
|
- !ruby/object:Gem::Version
|
192
|
-
version: 2.
|
192
|
+
version: 2.17.2
|
193
193
|
type: :development
|
194
194
|
prerelease: false
|
195
195
|
version_requirements: !ruby/object:Gem::Requirement
|
196
196
|
requirements:
|
197
197
|
- - '='
|
198
198
|
- !ruby/object:Gem::Version
|
199
|
-
version: 2.
|
199
|
+
version: 2.17.2
|
200
200
|
- !ruby/object:Gem::Dependency
|
201
201
|
name: rubocop-rake
|
202
202
|
requirement: !ruby/object:Gem::Requirement
|
@@ -217,14 +217,14 @@ dependencies:
|
|
217
217
|
requirements:
|
218
218
|
- - '='
|
219
219
|
- !ruby/object:Gem::Version
|
220
|
-
version: 2.
|
220
|
+
version: 2.14.2
|
221
221
|
type: :development
|
222
222
|
prerelease: false
|
223
223
|
version_requirements: !ruby/object:Gem::Requirement
|
224
224
|
requirements:
|
225
225
|
- - '='
|
226
226
|
- !ruby/object:Gem::Version
|
227
|
-
version: 2.
|
227
|
+
version: 2.14.2
|
228
228
|
- !ruby/object:Gem::Dependency
|
229
229
|
name: simplecov
|
230
230
|
requirement: !ruby/object:Gem::Requirement
|
@@ -473,16 +473,16 @@ dependencies:
|
|
473
473
|
name: parallel_tests
|
474
474
|
requirement: !ruby/object:Gem::Requirement
|
475
475
|
requirements:
|
476
|
-
- - "
|
476
|
+
- - "~>"
|
477
477
|
- !ruby/object:Gem::Version
|
478
|
-
version: '0'
|
478
|
+
version: '3.0'
|
479
479
|
type: :development
|
480
480
|
prerelease: false
|
481
481
|
version_requirements: !ruby/object:Gem::Requirement
|
482
482
|
requirements:
|
483
|
-
- - "
|
483
|
+
- - "~>"
|
484
484
|
- !ruby/object:Gem::Version
|
485
|
-
version: '0'
|
485
|
+
version: '3.0'
|
486
486
|
- !ruby/object:Gem::Dependency
|
487
487
|
name: rspec
|
488
488
|
requirement: !ruby/object:Gem::Requirement
|
@@ -684,22 +684,22 @@ email:
|
|
684
684
|
executables: []
|
685
685
|
extensions:
|
686
686
|
- ext/cs__common/extconf.rb
|
687
|
-
- ext/cs__assess_yield_track/extconf.rb
|
688
|
-
- ext/cs__assess_kernel/extconf.rb
|
689
687
|
- ext/cs__assess_module/extconf.rb
|
688
|
+
- ext/cs__scope/extconf.rb
|
689
|
+
- ext/cs__assess_string_interpolation/extconf.rb
|
690
|
+
- ext/cs__assess_kernel/extconf.rb
|
691
|
+
- ext/cs__assess_basic_object/extconf.rb
|
690
692
|
- ext/cs__assess_test/extconf.rb
|
693
|
+
- ext/cs__assess_yield_track/extconf.rb
|
694
|
+
- ext/cs__assess_hash/extconf.rb
|
691
695
|
- ext/cs__assess_string/extconf.rb
|
692
696
|
- ext/cs__tests/extconf.rb
|
693
|
-
- ext/
|
694
|
-
- ext/cs__assess_regexp/extconf.rb
|
695
|
-
- ext/cs__assess_string_interpolation/extconf.rb
|
697
|
+
- ext/cs__assess_fiber_track/extconf.rb
|
696
698
|
- ext/cs__contrast_patch/extconf.rb
|
697
|
-
- ext/cs__assess_basic_object/extconf.rb
|
698
|
-
- ext/cs__os_information/extconf.rb
|
699
|
-
- ext/cs__assess_hash/extconf.rb
|
700
|
-
- ext/cs__scope/extconf.rb
|
701
699
|
- ext/cs__assess_array/extconf.rb
|
702
|
-
- ext/
|
700
|
+
- ext/cs__os_information/extconf.rb
|
701
|
+
- ext/cs__assess_marshal_module/extconf.rb
|
702
|
+
- ext/cs__assess_regexp/extconf.rb
|
703
703
|
extra_rdoc_files: []
|
704
704
|
files:
|
705
705
|
- ".clang-format"
|
@@ -1048,6 +1048,7 @@ files:
|
|
1048
1048
|
- lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb
|
1049
1049
|
- lib/contrast/agent/reporting/attack_result/response_type.rb
|
1050
1050
|
- lib/contrast/agent/reporting/attack_result/user_input.rb
|
1051
|
+
- lib/contrast/agent/reporting/connection_status.rb
|
1051
1052
|
- lib/contrast/agent/reporting/details/bot_blocker_details.rb
|
1052
1053
|
- lib/contrast/agent/reporting/details/cmd_injection_details.rb
|
1053
1054
|
- lib/contrast/agent/reporting/details/details.rb
|
@@ -1110,6 +1111,7 @@ files:
|
|
1110
1111
|
- lib/contrast/agent/reporting/reporting_events/poll.rb
|
1111
1112
|
- lib/contrast/agent/reporting/reporting_events/preflight.rb
|
1112
1113
|
- lib/contrast/agent/reporting/reporting_events/preflight_message.rb
|
1114
|
+
- lib/contrast/agent/reporting/reporting_events/reportable_hash.rb
|
1113
1115
|
- lib/contrast/agent/reporting/reporting_events/reporting_event.rb
|
1114
1116
|
- lib/contrast/agent/reporting/reporting_events/route_coverage.rb
|
1115
1117
|
- lib/contrast/agent/reporting/reporting_events/route_discovery.rb
|
@@ -1138,7 +1140,6 @@ files:
|
|
1138
1140
|
- lib/contrast/agent/reporting/settings/assess_rule.rb
|
1139
1141
|
- lib/contrast/agent/reporting/settings/assess_server_feature.rb
|
1140
1142
|
- lib/contrast/agent/reporting/settings/bot_blocker.rb
|
1141
|
-
- lib/contrast/agent/reporting/settings/code_exclusion.rb
|
1142
1143
|
- lib/contrast/agent/reporting/settings/exclusion_base.rb
|
1143
1144
|
- lib/contrast/agent/reporting/settings/exclusions.rb
|
1144
1145
|
- lib/contrast/agent/reporting/settings/helpers.rb
|
@@ -1170,17 +1171,20 @@ files:
|
|
1170
1171
|
- lib/contrast/agent/rule_set.rb
|
1171
1172
|
- lib/contrast/agent/scope.rb
|
1172
1173
|
- lib/contrast/agent/static_analysis.rb
|
1174
|
+
- lib/contrast/agent/telemetry.rb
|
1173
1175
|
- lib/contrast/agent/telemetry/base.rb
|
1174
|
-
- lib/contrast/agent/telemetry/
|
1175
|
-
- lib/contrast/agent/telemetry/
|
1176
|
-
- lib/contrast/agent/telemetry/
|
1177
|
-
- lib/contrast/agent/telemetry/
|
1178
|
-
- lib/contrast/agent/telemetry/
|
1179
|
-
- lib/contrast/agent/telemetry/
|
1180
|
-
- lib/contrast/agent/telemetry/
|
1181
|
-
- lib/contrast/agent/telemetry/
|
1182
|
-
- lib/contrast/agent/telemetry/
|
1183
|
-
- lib/contrast/agent/telemetry/
|
1176
|
+
- lib/contrast/agent/telemetry/client.rb
|
1177
|
+
- lib/contrast/agent/telemetry/event.rb
|
1178
|
+
- lib/contrast/agent/telemetry/exception.rb
|
1179
|
+
- lib/contrast/agent/telemetry/exception/base.rb
|
1180
|
+
- lib/contrast/agent/telemetry/exception/event.rb
|
1181
|
+
- lib/contrast/agent/telemetry/exception/message.rb
|
1182
|
+
- lib/contrast/agent/telemetry/exception/message_exception.rb
|
1183
|
+
- lib/contrast/agent/telemetry/exception/stack_frame.rb
|
1184
|
+
- lib/contrast/agent/telemetry/hash.rb
|
1185
|
+
- lib/contrast/agent/telemetry/identifier.rb
|
1186
|
+
- lib/contrast/agent/telemetry/metric_event.rb
|
1187
|
+
- lib/contrast/agent/telemetry/startup_metrics_event.rb
|
1184
1188
|
- lib/contrast/agent/thread.rb
|
1185
1189
|
- lib/contrast/agent/thread_watcher.rb
|
1186
1190
|
- lib/contrast/agent/tracepoint_hook.rb
|
@@ -1196,7 +1200,6 @@ files:
|
|
1196
1200
|
- lib/contrast/agent_lib/return_types/eval_result.rb
|
1197
1201
|
- lib/contrast/agent_lib/test.rb
|
1198
1202
|
- lib/contrast/api/.gitkeep
|
1199
|
-
- lib/contrast/api/communication/connection_status.rb
|
1200
1203
|
- lib/contrast/components/agent.rb
|
1201
1204
|
- lib/contrast/components/api.rb
|
1202
1205
|
- lib/contrast/components/app_context.rb
|
@@ -1264,6 +1267,7 @@ files:
|
|
1264
1267
|
- lib/contrast/framework/rails/patch/support.rb
|
1265
1268
|
- lib/contrast/framework/rails/railtie.rb
|
1266
1269
|
- lib/contrast/framework/rails/support.rb
|
1270
|
+
- lib/contrast/framework/sinatra/patch/encrypted_session_cookie.rb
|
1267
1271
|
- lib/contrast/framework/sinatra/support.rb
|
1268
1272
|
- lib/contrast/funchook/funchook.rb
|
1269
1273
|
- lib/contrast/logger/aliased_logging.rb
|
@@ -1311,13 +1315,10 @@ files:
|
|
1311
1315
|
- lib/contrast/utils/response_utils.rb
|
1312
1316
|
- lib/contrast/utils/routes_sent.rb
|
1313
1317
|
- lib/contrast/utils/sha256_builder.rb
|
1318
|
+
- lib/contrast/utils/silence_maker.rb
|
1314
1319
|
- lib/contrast/utils/stack_trace_utils.rb
|
1315
1320
|
- lib/contrast/utils/string_utils.rb
|
1316
1321
|
- lib/contrast/utils/tag_util.rb
|
1317
|
-
- lib/contrast/utils/telemetry.rb
|
1318
|
-
- lib/contrast/utils/telemetry_client.rb
|
1319
|
-
- lib/contrast/utils/telemetry_hash.rb
|
1320
|
-
- lib/contrast/utils/telemetry_identifier.rb
|
1321
1322
|
- lib/contrast/utils/thread_tracker.rb
|
1322
1323
|
- lib/contrast/utils/timer.rb
|
1323
1324
|
- resources/assess/policy.json
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'contrast/agent/reporting/settings/exclusion_base'
|
5
|
-
|
6
|
-
module Contrast
|
7
|
-
module Agent
|
8
|
-
module Reporting
|
9
|
-
module Settings
|
10
|
-
# CodeExclusions class
|
11
|
-
class CodeExclusion < ExclusionBase
|
12
|
-
ATTRIBUTES = BASE_ATTRIBUTES.dup << :denylist
|
13
|
-
ATTRIBUTES.cs__freeze
|
14
|
-
|
15
|
-
# @return [Array<String>]
|
16
|
-
attr_accessor :denylist
|
17
|
-
|
18
|
-
def initialize
|
19
|
-
super
|
20
|
-
@denylist = []
|
21
|
-
end
|
22
|
-
|
23
|
-
def to_controlled_hash
|
24
|
-
hash = super
|
25
|
-
hash[:denylist] = denylist
|
26
|
-
hash
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|