lib/tasks/threat/search_fraudguard.rb
def run
    super

      #get entity name and type
      entity_name = _get_entity_name

      #get keys for API authorization
      username =_get_task_config("fraudguard_username")
      password =_get_task_config("fraudguard_api_key")

      unless password or username
        _log_error "unable to proceed, no API key for AdblockPlus provided"
        return
      end

      # Get responce

      response = JSON.parse(get_ip("api.fraudguard.io","/ip/#{entity_name}",username,password))

      if response
        _create_linked_issue("suspicious_activity_detected", {
          status: "confirmed",
          description: "This ip was flagged by fraudguard.io for #{response["threat"]} threat with risk level: #{response["risk_level"]} ",
          fraudguard_details: response,
          source: "FraudGuard.io"
        })
        # Also store it on the entity
        blocked_list = @entity.get_detail("suspicious_activity_detected") || []
        @entity.set_detail("suspicious_activity_detected", blocked_list.concat([{}]))
    end
  end
## Default method, subclasses must override this
Default method, subclasses must override this
Default method subclasses must override this
def run
    super
      entity_name = _get_entity_name
      username =_get_task_config("fraudguard_username")
      password =_get_task_config("fraudguard_api_key")
      unless password or username
        _log_error "unable to proceed, no API key for AdblockPlus provided"
        return
      end
      response = JSON.parse(get_ip("api.fraudguard.io","/ip/#{entity_name}",username,password))
      if response
        _create_linked_issue("suspicious_activity_detected", {
          status: "confirmed",
          description: "This ip was flagged by fraudguard.io for #{response["threat"]} threat with risk level: #{response["risk_level"]} ",
          fraudguard_details: response,
          source: "FraudGuard.io"
        })
        blocked_list = @entity.get_detail("suspicious_activity_detected") || []
        @entity.set_detail("suspicious_activity_detected", blocked_list.concat([{}]))
    end
  end
def run super entity_name = _get_entity_name username = _get_task_config ( "fraudguard_username" ) password = _get_task_config ( "fraudguard_api_key" ) unless password or username _log_error "unable to proceed, no API key for AdblockPlus provided" return end response = JSON . parse ( get_ip ( "api.fraudguard.io" , "/ip/#{entity_name}" , username , password ) ) if response _create_linked_issue ( "suspicious_activity_detected" , { status : "confirmed" , description : "This ip was flagged by fraudguard.io for #{response["threat"]} threat with risk level: #{response["risk_level"]} " , fraudguard_details : response , source : "FraudGuard.io" } ) blocked_list = @entity . get_detail ( "suspicious_activity_detected" ) || [ ] @entity . set_detail ( "suspicious_activity_detected" , blocked_list . concat ( [ { } ] ) ) end end
Default method, subclasses must override this
Default method subclasses must override this
#get entity name and type #get keys for API authorization # Get responce # Also store it on the entity