Class: TCellAgent::SensorEvents::DlpEvent

Inherits:
TCellSensorEvent show all
Defined in:
lib/tcell_agent/sensor_events/dlp.rb

Constant Summary collapse

FOUND_IN_BODY =
"body"
FOUND_IN_LOG =
"log"
FOUND_IN_CONSOLE =
"console"
FRAMEWORK_VARIABLE_SESSION_ID =
"session_id"
REQUEST_CONTEXT_FORM =
"form"
"cookie"
REQUEST_CONTEXT_HEADER =
"header"

Instance Attribute Summary

Attributes inherited from TCellSensorEvent

#ensure, #flush, #send

Instance Method Summary collapse

Methods inherited from TCellSensorEvent

#bucket_key, #calculateOffset

Constructor Details

#initialize(route_id, raw_uri, found_in, id = nil, hmac_session_id = nil, user_id = nil) ⇒ DlpEvent

Returns a new instance of DlpEvent.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/tcell_agent/sensor_events/dlp.rb', line 19

def initialize(route_id, raw_uri, found_in, id=nil, hmac_session_id=nil, user_id=nil)
    super("dlp")
    if route_id
        self["rid"] = route_id
    end
    self["found_in"] = found_in
    @raw_uri = raw_uri
    if hmac_session_id
        self["sid"] = hmac_session_id
    end
    if user_id
        self["uid"] = user_id
    end
    if id
        self["rule"] = id
    end
end

Instance Method Details

#for_database(database, schema, table, field) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/tcell_agent/sensor_events/dlp.rb', line 36

def for_database(database, schema, table, field)
    self["type"] = "db"
    self["db"] = database
    self["schema"] = schema
    self["table"] = table
    self["field"] = field
    return self
end

#for_framework(variable) ⇒ Object



44
45
46
47
48
49
# File 'lib/tcell_agent/sensor_events/dlp.rb', line 44

def for_framework(variable)
    self["type"] = "fw"
    self["context"] = "framework"
    self["variable"] = variable
    return self
end

#for_request(variable_context, variable) ⇒ Object



50
51
52
53
54
55
# File 'lib/tcell_agent/sensor_events/dlp.rb', line 50

def for_request(variable_context, variable)
    self["type"] = "req"
    self["context"] = variable_context
    self["variable"] = variable
    return self
end

#post_processObject



56
57
58
59
60
# File 'lib/tcell_agent/sensor_events/dlp.rb', line 56

def post_process
    if @raw_uri
        self["uri"] = Util.strip_uri_values(@raw_uri)
    end
end