File Integrity Monitoring
File Integrity Monitoring
File Integrity Monitoring
Contents:
Re-Baseline a Policy
Specifying Exceptions
Responding to Alerts
Re-Baselining a Policy
Server group. The administrator uses the Halo Portal to assign the policy to a server groupan administratordefined collection of servers that are identical to the baseline server in terms of system structure and configuration,
at least for the targets specified in the policy.
Monitoring scans. At a frequency determined by the administrator, Halo automatically runs monitoring scans of
all servers in the group, including servers that come online automatically through cloning or auto-scaling. The Halo
Daemon running on each server collects metadata and computes hashes of each targeted object on the server
and sends them to the Halo Grid, which compares them with the baseline information, and reports any differences
found to the Halo Portal. Modifications, deletions, or additions of files or directoriesas well as changes to
metadataare all detected.
Security events and alerts . Halo records information on any detected changes as scan results, and also as
security events . Administrators can view and act on those results and events in the Halo Portal. Administrators
may also receive email alerts triggered by designated high-priority events.
As targets, you can specify the following objects: individual files, directories, symbolic links, devices and
special files (such as named pipes), andon WindowsRegistry keys.
If you specify a directory, you can make the scan recursive (objects at all levels within the target directory
are scanned) or non-recursive (only objects at the uppermost level within the directory are scanned).
Within a directory target, you can either exclude objects that match a specific pattern, or you can include
only objects that match the pattern.
Mark or unmark the rule as active (will be scanned), critical (will be flagged in scan results), and/or alert
(will generate an email alert). Make sure your policy has at least one active target.
If you need more detailed instructions, see Creating a File Integrity Policy .
For a list of restrictions on allowable targets in a policy and allowable kinds of information to scan, see
Limitations on Targets and Scans .
You normally assign the baseline server to the policy immediately after saving the policy. When you click the
Add Baseline button on the policy's page in the Halo Portal, you are asked to select the server. As soon as
you have done that and clicked Request Baseline, the baseline scan runs. When it finishes, your policy is
complete.
Note: Depending on the server configurations in your server group, you may wish to specify multiple
baseline servers for a single policy. See Using Multiple Baselines.
Before you run a baseline scan, you can optionally give it an expiration date. After you run the scan, you can
inspect the baseline report to verify that no targets were missed.
If you need more detailed instructions about baselines, see Specifying a Baseline Server and Running a
Baseline Scan.
Once you have run the baseline scan for a policy, assigned the policy to a server group, and then manually scanned
your servers, you can view the results to address security events and alerts, and to manage updates to file integrity
settings and policies.
Note: Going forward, be sure to set up automatic scanning to make sure that your servers are regularly
examined for file integrity issues. You can do that at [Site Administrator menu] > Site Administration in
the Halo Portal; for details, see Specifying File Integrity Monitoring Settings .
As security events on the Halo Portal's Security Events History page. Go to Servers > Security Events History
and apply one or more of the following event-type search filters: File Integrity object added , File Integrity
object missing, and File Integrity object signature changed .
The results displayed for each violation or event include a flag if the event is critical, the date/time of its occurrence,
and various event details. Click More details to see both the original baseline metadata and the current metadata for
the changed file or directory.
See Viewing Scan Results for a more complete explanation of file integrity scan results.
object's target or inclusion from your policy, or create an exclusion for the object within the target (see Defining an
Exclusion).
If the event occurred because the object was added, changed, or removed legitimately and you want to start
monitoring its new state, make the same object change to a baseline server and re-run the baseline scan.
If the event occurred for an object that you want to keep monitoring, but the change is currently not an issuefor
example, if the object is undergoing testing or is scheduled for upgradecreate an exception to suppress the
event temporarily (see Specifying Exceptions). No policy change or re-baselining is needed.
If the event occurred because an object that you want to keep monitoring was changed, added or removed in
error, just restore the previous state of the affected server(s). No policy change or re-baselining is needed.
If none of the above conditions applies and it appears that the event may indeed indicate potential malicious activity
on the server, stop using the server and immediately notify your incident response team or security forensics team.
Respond to Alerts
If you are the administrator or security specialist assigned to handle file integrity security events for a given server
group, you may receive automatically generated email alerts whenever a monitoring scan detects important changes
to the monitored objects on the servers in that group. When you receive such an alert, follow the link in the email to
the Halo Portal, where you can address the issue.
If you need more detailed instructions, see Responding to Alerts.
Re-Baseline a Policy
Whenever you alter a target in a file integrity policy, the policy's existing baselines involving that target are invalidated.
You must re-run the baseline scan for any affected baseline server, or add a new baseline. Note that re-running a
baseline is not required during the normal elastic operation of your cloud, because Halo automatically accounts for
servers that come online or go offline due to server cloning or auto-scaling.
Whenever you make a configuration change, addition, or deletion to any of the monitored objects in a policy's server
group, you must make the change to the appropriate baseline server itself, propagate that change to all the servers in
the group, and then re-run the baseline scan for that policy.
To re-run a baseline scan, go to Policies > File Integrity Policies in the Halo Portal and locate the policy that you
wish to re-baseline. If you need more detailed instructions, see Re-Baselining a Policy .
Under Scanner Scheduling, in the line for "File Integrity Monitoring", select Enable Automatic Scanning , then
choose a scan frequency from once per hour to once per week. Leave Execute scan on daemon start selected if
you want to run an initial scan on each server as soon as it starts up.
The next scheduled scan will occur in as little as one hour or as much as 24 hours later, depending on the frequency
you have specified. Note that only servers in groups that have an assigned file integrity policy are scanned at each
8
automatic scan.
Note: Depending on the number and size of the targets in your policy, running a monitoring scan on all the
servers in a server group may take some time. Specifying a high scanning frequency for a large group
might impact the performance of your servers.
The cloned policy now appears on the File Integrity Policies page.
10
5. For each target, specify values for its flags; see Configuring the Targets , below.
6. When you are finished, click Save. The policy appears on its own page, along with a caution that the policy will
remain inactive until you perform a baseline scan.
7. Click Add Baseline and then Request Baseline to run a baseline scan immediately: see Specifying a Baseline
Server and Running a Baseline Scan , below.
8. Click Return to Policy List to return to the File Integrity Policies list.
Note: If you do not perform a baseline scan at this time, you can do it later by returning to the File Integrity
Policies list, clicking Actions in the row for this policy, and selecting Baseline.
Specifying Targets
A file integrity policy includes a list of target objects to be monitored for changes. When creating or editing a policy,
) to add or remove targets. Optionally provide a description for each
use the Add Target link or the Delete icon (
target.
The following are the kinds of target objects you can specify, and the kinds of changes to each that a scan can
detect.
File type
Text or binary file
Added/Deleted
Content
Metadata
Target path
Yes
Yes
Yes
11
Directory
Yes
Yes
Symbolic link
Yes
Yes
Yes
Device/special file
Yes
Yes
Yes
Yes
Yes
Note that for devices and special files (such as named pipes), only additions, deletions, and metadata changes are
detected. For symlinks, changes to the target specification are also detectedalthough changes to the target file itself
are not detected.
Here are some examples of targets:
Individual binary or text files. For example:
Linux:
/vmlinux
/usr/sbin/httpd
/etc/passwd
Windows:
C:\Windows\regedit.exe
C:Program Files\WinZip\WINZIP64.EXE
Important: In Windows, the names of all target files (except symbolic links) must include the file extension.
Directories and their contained objects (at top-level only if non-recursive, at all levels if recursive).
For example:
Linux:
/bin (objects in the / bin directory)
/etc (objects in / etc)
Windows:
C:\Windows\System32 (objects in the System subfolder of the Windows folder)
C:Program Files\ (objects in the Program Files folder)
Windows Registry keys (on Windows only):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon\Shell
When Halo performs a baseline scan using the target expressions in the policy, it creates a checksum (signature) for
each text or binary file and records it, along with the directory in which the file was found. For all scanned objects,
Halo records values for the following metadata:
Linux:
user owner
group owner
permissions
ctime
mtime
Windows:
owner
permissions (access control list)
Alternate data streams content
creation date-time
modification date-time
Subsequent scans will then detect whether the content of any of the files has been altered, whether any object has
been deleted from or added to any monitored directory, and whether any critical metadata (owners or permissions)
has changed. Any of those changes are reported as issues in the scan results and as security events.
(3) severe slowdown of the Portal UI when trying to display the policy.
For best performance, CloudPassage recommends that you use recursion (with exclusions and inclusions as
needed) to scan up to thousands of objects, while keeping the number of defined targets ( = lines in the policy)
below a thousand.
CloudPassage recommends that you do not scan files that change often, such as log files, active database data
files, and email files.
Defining an Inclusion
To make sure that your scans include just a certain set of objects within your target, specify as the inclusion a search
pattern that will match all objects in the set but no others. For example, if you are interested in scanning only
executable files and code libraries within a particular target directory on Windows, you can specify *.exe and *.dll
as two inclusions.
13
To add an inclusion to your file integrity policy, click the Add Pattern link for the target directory, then move the slider
to read "Include". Enter a string or pattern representing the inclusion. You can add any number of inclusions to a
target.
Defining an Exclusion
To avoid scanning a certain set of objects within your target, specify as the exclusion a search pattern that will match
all objects in the set but no others. For example, if you do not wish to scan PDF files within a particular target
directory, specify *.pdf as the exclusion. (On Windows, that will match all files ending with .pdf or .PDF. On Linux,
you might want to define another exclusion that is *.PDF.)
To add an exclusion to your file integrity policy, click the Add Pattern link for the target directory, then move the
slider to read "Exclude". Enter a string or pattern representing the exclusion. You can add any number of exclusions
to a target.
Before you can use a file integrity policy or assign it to a server group, you need to run a baseline scan on it. To do
that, you need to assign a baseline server to the policy.
Also, you will need to re-run a baseline scan whenever you make changes to the baseline server's target objects, or
the policy that the baseline server is assigned to.
A baseline server represents the golden masterthe canonical, correctly configured, clean system of the server
group that you will assign the policy to. The baseline server could be one of the servers in that server group, or it
could be a server set up solely as a template for the correct configuration of that type of server.
The baseline scan is run only on the baseline server; subsequent monitoring scans are run on all the servers of the
policy's server group. Therefore, the structure and content of all servers in the group should in general be identical to
the baseline serverat least for the specific file targets defined in the policy. (Exceptions to this are possible; see
Using Multiple Baselines.)
Immediately after saving a new file integrity policy or saving changes to an existing one, you are prompted to request
a baseline scan. You can do it then, or you can later navigate to the File Integrity Policies list and select that policy.
Then do this:
1. Click the Add Baseline button (if you are on the File Integrity Policy page), or choose Baseline from the Action
dropdown list in the line for that policy (if you are on the File Integrity Policies list).
2. In the Select Baseline Server dialog box, use the dropdown list to choose the server that you want as the
baseline. The list includes all of your currently online servers that have an installed Halo Daemon and are of the
same general operating system (Linux or Windows) as your policy.
Select the lifetime of the baseline scan (the number of days before it expires), and optionally add a comment
about this baseline server.
3. Click Request Baseline to start the baseline scan.
Note: Depending on the number and size of the targets in your policy, running a baseline scan can take
several minutes or longer.
When the scan is finished, a "File Integrity baseline" event appears on the Security Events
History page, and information about the scan appears in the Baselines area of the File
Integrity Policy page:
15
Once the baseline scan is complete and shows a status of Active, you can assign the policy to a server group and
start running file integrity scans.
2. Select Details from the drop-down list. The File Integrity Baseline Results page appears, displaying at the top of
the page the baseline's policy, the baseline server's name, the date of the baseline scan, and the total number of
objects scanned for the baseline.
IMPORTANT: A baseline cannot contain more than 10,000 objects. Halo will invalidate a baseline scan that
would return more than 10,000 objects.
For each top-level target in your policy, the baseline report displays:
The target path, the inclusions and exclusions defined for the target, and the total number of objects scanned
within the target.
A line of information for each individual scanned element or sub-element of that target. The information
includes the full path and type (directory, file, or link) of the element, plus its metadata and its cryptographic
signature (or target value, if it is a link).
16
The report includes one table for each top-level directory target specified in the policy. For example, if the policy
contains target paths starting with /bin, /etc, and /usr, the report will include three tables of scanned elements.
3. Examine the pathnames and metadata in the report to satisfy yourself that the file integrity policy specifies the
appropriate elements for ensuring the integrity of critical files, and that it does not waste time scanning unimportant
elements. If necessary, refine the policy by modifying targets and inclusions/exclusions.
17
If you make any changes to your file integrity policy, all baselines in effect at that time become invalid. You will need
to re-baseline all invalid baseline servers before you will be able to run a file integrity scan with that policy.
3. In the Edit Group Details dialog box, Select the policy's name from the File Integrity Policies dropdown list. The
policy is added to the group.
(You may also add other file integrity policies to the group.)
4. Click Save to commit your assignment and return to the server view.
18
2. Click the number of Critical or Other events for a server to view that server's Scan Results page, which lists and
describes the violations from its most recent file integrity scan.
You can sort the resulting list of events by criticality, creation date, event type, server group, and server, to display
the events of most interest to you toward the top of the list.
See Viewing the Details of an Event for a full description of what each event contains. See Act on Reported File
Integrity Events for suggested remediation steps to take.
For Windows, Halo reports the following metadata items for each scanned file:
Owner. User or group.
Permissions. See Windows Access Control Entries for more information.
ADS. Filename and content signature of any alternate data streams content attached to the target.
Content. Final 8 digits of the cryptographic signature of the file content (SHA-256 hash).
Created. When the file was created.
Modified. The last time the file was written to.
Changes to Object ctime and Object mtime on Linux, or Created and Modified on Windows, are not considered
critical. if these values do not match the baseline but the other metadata and the signature still match, no event is
created.
The details drop-down also includes the date of the last baseline scan and a link to the Server Summary page of the
server for each of the active baselines of this server group.
21
For example, in the scan details above, the first item in the list ("local\R9:...") was in the baseline scan but was
replaced on this server with a different permission ("Local\QA:...") before the most recent scan. The remaining 3 items
did not change their content or position in the list, so they remain black. The added item appears underlined in green
at its appropriate point in the list, and the removed item appears after the list, lined-through in red.
In another example of scan details (above), the first item in the list ("local\R9:...") was in the baseline scan but was
removed from this server before the most recent scan. The remaining 3 items have changed positionwhat was item
two is now item one, and so on. Therefore the entire original list appears to have been removed (and is lined-through
in red), and the server's entire current list appears to have been added (and is underlined in green).
Linux Permissions
Every file and directory on a Linux system is owned by a user and by a group. Permissions for accessing that file are
defined separately for the user, for the group, and for all others. "Other" is defined as a user that is not the owning
user and is not a member of the owning group.
Linux supports three types of access permission:
22
read. For a file, the ability to open it and read its contents. For a directory, the ability to list its contents.
write. For a file, the ability to modify it (write new data to it). For a directory, the ability to add, remove, or rename
files within the directory.
execute. For a file, the ability to execute it as a program or script. For a directory, the ability to make it the current
directory (as with the cd shell command), and the ability to access files within it.
Halo displays a Linux file or directory's permissions using the symbolic mode common to shell displays, with three
sets of three single character symbols, specifying the permissions of the owner, group, and others, respectively. For
example:
In this example, the user owner has full permissions on the file, the owning group can read and execute the file but
not modify it, and others can open and read the file, but not modify or execute it.
Special Linux permissions . The above permissions string can include several additions or substitutions in special
cases:
Directory. If the file is a directory, the permissions string may be prefixed with d. For example:
drwxr-xr-setuid /setgid bit . If the executable file's setuid or setgid bit is set (meaning that the file will execute as the user
owner or group owner, with the owner's permissions), s or S is substituted for r in in the "User" or "Group"
permission. For example:
swxr-xr-- or rwxs-xr-Sticky bit . If a directory's sticky bit is set (meaning that no users except the directory's owner and the superuser
can rename or delete files within the directory), t or T is is substituted for x in the "Others" (all users) permission.
For example:
drwxr-xr-t
23
These are values you might see for each of the ACE elements:
Principal. This is the name of the user or group owner, preceded by a scope designation. The scope may be NT
AUTHORITY, BUILTIN, the local domain (machine name), or Active Directory/LDAP domain.
For local user accounts where the scope is the machine name, Halo replaces the machine name with "Local" so
that events will not be created when local accounts on different machines differ only by the machine name.
Inheritance. The inheritance strings can have these values and meanings:
OI. Object inherit (applies only to folders and non-leaf registry keys)
CI. Container inherit (applies only to folders and non-leaf registry keys)
IO. Inherit only (applies only to folders and non-leaf registry keys)
NP. Do not propagate the inherit (applies only to folders and non-leaf registry keys)
I. Access control is inherited from parent container
It is also possible for a file object to have no inheritance designation in its ACE.
Type. The type of the access control entry can be either Allow or Deny.
Permissions. The following are the rights that can appear in the permissions string in the Halo Portal. Note that
Halo displays only "specific rights," not the "simple rights" groupings that you may find using icacls or a similar
tool.
File or folder:
Registry key:
24
Specifying Exceptions
Important: In its recommended configuration, in which all changes detected within a single directory target are
grouped into a single event, File Integrity Monitoring does not support the use of exceptions.
Exceptions are based on events, so the occurrence of one change to a single file out of possiby
hundreds in a target would, if made an exception, prevent changes in any of the other files from
being reported in future scans. If there are individual files or subdirectories within a target that you
want File Integrity Monitoring to ignore, a preferable strategy is to add exclusions for those files to
the target in your file integrity policy.
When addressing file integrity scan results or events, you may decide not to act on (remediate) a particular event at
this time. If you do not wish to see the event repeated in future scans, you can classify it as an exception, which
means that it will not appear in future scan results for a specified period of time.
Exceptions are useful for issues that you intend to correct eventually, but you would rather not be distracted by them
until you have addressed more pressing file integrity issues.
4. Enter a reason or explanation for creating the exception, then click Save.
The selected events and any associated alerts will no longer be reported, until the exception period ends or you rebaseline the policy. Running a baseline scan removes all exceptions from all of the policy's scanned servers.
The table includes one line for every defined exception, showing the target path, the policies/servers/groups that
the exception applies to, when it expires, who created, it, and why.
2. Exceptions will automatically disappear from this list when they expire (or when you re-run a baseline scan). To
explicitly remove an exception, click the Delete icon (
) in the line for that exception.
The exception will no longer appear on the File Integrity Exceptions page. Any future events involving that target
will appear on the Security Events History page and in individual servers' scan results.
Responding to Alerts
A file integrity policy may specify that changes to certain targets constitute events that are severe enough that an
alert should be sent to the appropriate administrators. The person creating or editing the policy specifies which events
should be associated with alerts. (See Configuring the Targets .)
Alerts go to the users listed in an alert profile assigned to the server group to which the file integrity policy is
assigned. By default, all server groups have an alert profile consisting of the registered Halo user for the company. A
Halo site administrator can create additional alert profiles that list one or more other Halo users that should receive
alerts involving that server group. (For instructions see, for example, Steps 10 and 11 under Generate User Access
Alerts.)
If you are an administrator or security specialist listed in a given server group's alert profile, you may receive an
automatically generated email alert whenever a file integrity monitoring scan of that group detects a target change
that is flagged for alerting. When you receive such an alert, take these steps:
1. Open the notification email and follow its link to the Security Event History List in the Halo Portal.
2. View detailed information about the event, as described in Viewing the Details of an Event , above.
3. Take the necessary steps to resolve the issue, as described in Act on Reported File Integrity Events , above.
Re-Baselining a Policy
Whenever you alter the targets in a policy, or whenever changes, additions, or deletions are made to the scanned
26
files in that policy's server group, you must re-run a baseline scan for that policy.
To re-run a baseline scan:
1. Open the File Integrity Policy page for the policy that you want to re-baseline.
2. In the Baselines area, click the Action button in the row for the baseline that you want to re-run, and select Rebaseline.
Note: Whenever you re-baseline a policy, you have the opportunity to assign a different baseline server.
A success message is displayed, meaning that the policy's baseline server is being re-scanned. When the process is
finished, a "File Integrity baseline" event is created and is visible on the Security Events History page.
Editing a Policy
To make changes to a file integrity policy:
1. Open the active File Integrity Policy list.
2. Click a policy in the list. The File Integrity Policy page for that policy appears.
27
Retiring a Policy
When you are no longer using a file integrity policy, you can retire it.
1. Open the Active File Integrity Policy list, by navigating to Policies > File Integrity Policies .
2. Click Actions in the row for the policy you want to retire, and select Retire from the drop-down list.
The policy moved from the Active File Integrity Policy list to the Retired File Integrity Policy list.
Unretiring a Policy
If you want to restore a retired policy to active status, you can unretire it.
1. Open the Retired File Integrity Policy list, by navigating to Policies > File Integrity Policies and clicking Retired
Policies.
2. Click Actions in the row for the policy you want to re-activate, and select Unretire from the list.
The policy is removed from the Retired File Integrity Policy list, and is restored to the Active File Integrity Policy list.
Note: Unretiring a policy does not re-assign it to the server groups it used to apply to. You must make those
assignments manually once the policy is active.
running on top of them, you might append an application identifier to the server group name, to clarify which
policies should be applied to each groupfor example, "US-East-Web-Servers-Login" and "US-East-WebServers-Messaging". Being this specific and granular with groups and their names can make the assignment of
policies and the generation of baselines simpler to manage.
Servers within a given group should have the same function and very similar configurations. Usually, that means
the same O.S. and the same applications. Often, the servers in a group are all clones of the same gold master
image.
You can have multiple versions of the same operating system or application in a single group. The multiple
baselines feature of File Integrity Monitoring allows you to accommodate this kind of departure from absolute
uniformity.
You can also have more than one operating-system platform in the same server group. File Integrity Monitoring
allows you to assign both a Windows and a Linux policy to a single server group. Halo automatically applies the
appropriate policy and its baselines to each server, depending on its platform.
Naming groups according to function complements the modular policy-design best practice described below, in which
you create broad policies that cover the common operating systems and applications, plus additional focused policies
for the specific applications or data that might be unique to certain subsets of servers.
policy set for each server group, depending on its O.S. platform and its specific applications.
Note: Halo currently provides default O.S.-level file integrity policies for Windows Server platforms.
coordination with the responsible party (or parties) as policies change, or as baselined servers are retired or removed
from your environment.
Automate baselining
If you use an IT automation tool like Puppet, Chef, or Ansible in your environment, consider leveraging the Halo
REST API in your scripts or recipes.
For example, if you have an automation script that handles things like new package installs or file content updates,
have the script create a new a file integrity baseline of the new or updated server configuration, so that the server
group's file integrity policy can automatically adapt to the changed environment, instead of reporting false positives
when the next file integrity scan is run.
31
help you keep everything clarified, making it easier to manage updates and baseline retirement.
Also keep in mind that you can automate the process of baselining and integrate it into your upgrade process by
inserting Halo API client scripts into your server orchestration tools.
Copyright 2014 CloudPassage Inc. All rights reserved. CloudPassage and Halo are registered trademarks of CloudPassage, Inc.
33