D3 - T5 - Variables-092015
D3 - T5 - Variables-092015
© Copyright 2014 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
* Lab during this session
Objectives
2 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Variables
Variables are functions used to derive values from events,
assets, and other resources (for example, a target IP address in an attack
event, the MAC address or the zone of a vulnerable asset, the timestamps on a user
login session, entries in a hot list, and so forth).
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Variables : Quick Reminders !
Variables
2 Types of Variables increase
processing
overhead and
• Local variables: can affect
performances
4 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Functions
Alias: creates alternate name for a specified field
Arithmetic: Ceil, Round, Add, Absolute functions
Category Model: test whether 2 actors (IdentityView), or 1 actor and 1 group have relationship
Condition: conditional filter with 3 arguments (value returned)
Group: operations on Network zones, Asset Groups,
IP Address: parse IP address ( retuning integer from 0 to 255 representing 1 octet)
List: return specific field of specified lists (Active or Session)
String: operations on strings (ToUpper, LastIndexOf, Substring, LenghtOf, IndexOf, ToLower)
Timestamp: time related function (date, time)
Type Conversion: conversion operations (strings, integers)
5 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Use Cases with Variables
• Calculate network latency in the ESM Event Flow
• View location of attacker and target, plus number of events communicated between them
• Display location within the network model of an attacked asset in a report or graphical display
• Modify priority of a correlation event based upon an evaluation of base event’s target zone
• Track a user’s activity regardless of the case structure utilized for the login credentials – Jdonan,
jdonan, JDonan, JDONAN – should be shown as a single line in the Active List
6 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Global Variables
Where are Global Variables located ?
• Go in the Navigator Panel
• Select ‘Field Sets’ from the Dropdown list
7 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Global Variables
Where are Global Variables located ?
• Select ‘Fields and Global Variables’ tab
8 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Creating Global Variables
Select Field Sets Resource
Go in Navigator Panel
Select Field Sets Resource
Select “Fields & Global Variables” tab
Right Click on ‘<admin>’s Fields’
Select “New Global Variable”
In the Attributes tab give a Name to the GV
Select ‘Parameters’ tab
From the Function drop down list
Select a category
9
Select a function in this category
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Creating Local Variables
Local variables can be created within the
following ArcSight resources, using ‘Local
Variables’ tab
• Active Channels
• Field Sets*
• Filters
• Rules
Local Variables
• Data Monitors add, edit, remove or promote
• Query Viewers
• Reports
10 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Creating Local Variables
Select Local Variable in a parent resource
Select “Add”
Give a Name
Select a desired Function
Provide arguments as needed
Click OK
11 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Example #1: Global Variable in Active Channel
Use Case: Display Network Latency values during event transmission from
devices to ESM
• How do we do ?
• We will make use of a Global Variable using Time Stamp difference function
• What Content do we need ?
• Create 1global variable using a function evaluating time difference
• Create 1Field Set with columns – 1 will display the time difference
• 1 Active Channel to display events
• Result:
• Active Channel will display in 1 Column time difference in seconds between End Time
and Manager Receipt Time
12 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Start/End Time, Device Time, Connector Time, Manager Time ?
Device Agent Manager
EVENT ! receipt Receipt Receipt
Time Time Time
End Time
The
13 time at which
© Copyright the event
2012 Hewlett-Packard actually
Development ended,
Company, asinformation
L.P. The recorded by the
contained hereinsource
is subject tosensor
change without notice.
Start TimeDevice Receipt Time Connector Receipt Time Manager Receipt Time
This is the time
The timestamp
at which the
applied
event by
actually
the source
began,
The
sensor
astimestamp
recorded
device when
by
applied
thean
source
event
by theisArcSight
received
TheSmartConnector's
from
timestamp
its source.
applied
JVMby(Java
the ArcSight
Virtual Manager's JVM (Java Virtual
sensor device or, possibly, a secondary source monitored
Machine) when
by that
thedevice.
event is received from
Machine)
the originating
when the event
sensoris device.
received from the ArcSight SmartConnector.
End Time
The time at which the event actually ended, as recorded by the source sensor
device or, possibly, a secondary source monitored by that device.
14 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Display Network Latency
Go in Navigator Panel
Select Field Sets Resource
Select “Fields & Global Variables” tab
Right Click on ‘<admin>’s Fields’
Select “New Global Variable”
15 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Display Network Latency
16 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Display Network Latency
17 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Display Network Latency
18 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Display Network Latency
19 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Display Network Latency
20 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Display Network Latency
21 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Want to Highlight Events with Significant Latency ?
23 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Creating Rule with Local Variable
Rule is created as we did in previous lab
We create a New Rule and give a Name to it
Then we select the ‘Conditions’ tab
We add two lines
categoryBehavior and categoryOutcome
Then we create a local variable by
clicking on ‘Local Variables’ tab
Click Add (with a + sign)
A new window opens
24 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Creating Local Variable in Rules
We use Timestamp function here
We give a name for the Local Variable
From the scroll down ‘Function’ list we select
« Timestamp »
In right panel we select the « GetHour » function
Click OK
We map the Event Field we want to get the
time (hour) from
Select End Time
Click OK
Local Variable function will derive time from the
End Time Field in the evaluated event
25 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Creating Local Variable in Rules
We can verify how the function operates
Click on calculate to test this function
Function (hour) displays result
Click OK
Local Variable is created and ready for use
We can add as much as variables we needed
Time when we created
this Variable
26 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Creating Local Variable in Rules
We can verify how the function operates
Click on calculate to test this function
Function (hour) displays result
Click OK
Local Variable is created and ready for use
We can add as much as variables we needed
Time when we created
this Variable
27 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Creating Rule with Local Variable
We can now add a time based
condition in filter using the Variable
we just created
Click back on “Conditions” tab
Add New Condition
Then select « Variables »
Then select our new Local Variable
« Time_of_Day »
Click OK
We need a time range defined
28 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Creating Rule with Local Variable
We define the Office Hours time range
Double Click on “=“
Scroll Down and select “Between”
See the NOT
Enter 8,20 operator
EVENT 1
Fired Rule
32 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Lab 10-1 Create a Rule with 2 Local Variables
Use Case: Detecting Root user login in a specified time range
• Conditions will filter:
successful logins events
Destination User Name is root
Time of day and day of week evaluation requires 2 Local Variables here:
GetHour As we use CloudShare in a different time
GetDayOfWeek (make sure it’s today) ! zone – West Cost US based- the time range
will be set between XXX and XXX TODAY
• Aggregation
Attacker Address, Target Address and Target User Name
• Action
• First Event SET EVENT FIELD NAME “Unauthorized ROOT login in a time range”
33 © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Thank You
Questions ?
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. HP Restricted. For HP and Partner Internal Use