lib/contrast/utils/invalid_configuration_util.rb in contrast-agent-3.15.0 vs lib/contrast/utils/invalid_configuration_util.rb in contrast-agent-3.16.0
- old
+ new
@@ -1,8 +1,9 @@
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true
+require 'contrast/agent/assess/policy/trigger_method'
require 'contrast/components/interface'
module Contrast
module Utils
# This utility allows us to report invalid configurations detected in
@@ -39,14 +40,10 @@
finding.properties[CS__SNIPPET] = Contrast::Utils::StringUtils.force_utf8(snippet)
hash = Contrast::Utils::HashDigest.generate_config_hash(finding)
finding.hash_code = Contrast::Utils::StringUtils.force_utf8(hash)
finding.preflight = Contrast::Utils::PreflightUtil.create_preflight(finding)
-
- activity = Contrast::Api::Dtm::Activity.new
- activity.findings << finding
-
- Contrast::Agent.messaging_queue.send_event_eventually(activity)
+ Contrast::Agent::Assess::Policy::TriggerMethod.report_finding(finding)
end
rescue StandardError => e
logger.error('Unable to build a finding', e, rule: rule_id)
end