lib/contrast/agent/protect/rule/unsafe_file_upload.rb in contrast-agent-6.9.0 vs lib/contrast/agent/protect/rule/unsafe_file_upload.rb in contrast-agent-6.10.0
- old
+ new
@@ -2,10 +2,11 @@
# frozen_string_literal: true
require 'contrast/agent/protect/rule/base_service'
require 'contrast/agent/reporting/input_analysis/input_type'
require 'contrast/agent/reporting/input_analysis/score_level'
+require 'contrast/agent/protect/rule/unsafe_file_upload/unsafe_file_upload_input_classification'
module Contrast
module Agent
module Protect
module Rule
@@ -27,9 +28,28 @@
APPLICABLE_USER_INPUTS
end
def block_message
BLOCK_MESSAGE
+ end
+
+ # Unsafe File Upload input classification
+ #
+ # @return [module<Contrast::Agent::Protect::Rule::UnsafeFileUploadInputClassification>]
+ def classification
+ @_classification ||= Contrast::Agent::Protect::Rule::UnsafeFileUploadInputClassification.cs__freeze
+ end
+
+ private
+
+ # @param context [Contrast::Agent::RequestContext]
+ # @return [Boolean]
+ def prefilter? context
+ return false unless context
+ return false unless enabled?
+ return false if protect_excluded_by_code?
+
+ true
end
end
end
end
end