Custom Lookup Tables
Enrich events with your own stored data
Last updated
Was this helpful?
Enrich events with your own stored data
Last updated
Was this helpful?
Custom Lookup Tables (also referred to as simply "Lookup Tables") allow you to store and reference custom enrichment data in Panther. This means you can reference this added context in detections and pass it into alerts. It may be particularly useful to create Lookup Tables containing identity/asset information, vulnerability context, or network maps.
You can associate one or more log types with your Lookup Table—then all incoming logs of those types (that have a match to a Lookup Table value) will contain enrichment data from your Lookup Table. Learn more about the enrichment process in . It's also possible to .
Learn how to , and how to .
If your lookup data is only needed for a few specific detections and will not be frequently updated, consider using instead of a Lookup Table. Also note that there are , including Enrichment Providers like IPinfo and Tor Exit Nodes, as well as .
To increase the limit on the number of Lookup Tables or the size of Lookup Tables in your account, please contact your Panther support team.
Lookup Tables in Panther traditionally define both of the following:
A primary key: A field in the Lookup Table data.
If the Lookup Table is defined in the CLI workflow, this is designated by the PrimaryKey
field in the .
One or more associated log types, each with one or more Selectors: A Selector is an event field whose values are compared to the Lookup Table's primary key values to find a match.
There are two ways to set log types/Selectors for a Lookup Table. See , below.
When a log is ingested into Panther, if its log type is one that is associated to a Lookup Table, the values of all of its Selector fields are compared against the Lookup Table's primary key values. When a match is found between a value in a Selector field and a primary key value, the log is enriched with the matching primary key's associated Lookup Table data in a p_enrichment
field. Learn more about p_enrichment
below, in .
In the example in the image below, the Selector field (in the events in Incoming Logs) is ip_address
. The primary key of the Lookup Table LUT1 is bad_actor_ip
. In the right-hand Alert Event, the log is enriched with the Lookup Table data (including bad_actor_name
) because there was a match between the Selector value (1.1.1.1
) and a primary key value (1.1.1.1
).
When creating a Lookup Table, you can choose one or more log types the Lookup Table should be associated to—and for each log type, one or more Selector fields.
Finds all Active log schemas (or log types) that designate any event field as that same indicator.
Associates those log types to the Lookup Table.
For each log type, sets the p_any
field associated to the indicator as a Selector.
For example, if your Lookup Table data's schema designates an address
field (which has also been set as the primary key) as an ip
indicator, all log types in your Panther instance that also set an ip
indicator will be associated to the Lookup Table, each with a p_any_ip_addresses
Selector.
p_enrichment
structureIf your log events are injected with enrichment data, a p_enrichment
field is appended to the event and accessed within a detection using deep_get()
or DeepKey
. The p_enrichment
field will contain:
One or more Lookup Table name(s) that matched the incoming log event
The name of the Selector from the incoming log that matched the Lookup Table
The data from the Lookup Table that matched via the Lookup Table's primary key (including an injected p_match
field containing the Selector value that matched)
This is the structure of p_enrichment
fields:
deep_get()
lookup()
Your Lookup Table data is in JSON or CSV format. (JSON files can format events in various ways, including in lines, arrays, or objects.)
A schema specifically for your Lookup Table data.
This describes the shape of your Lookup Table data.
A primary key for your Lookup Table data.
This primary key is one of the fields you defined in your Lookup Table's schema. The value of the primary key is what will be compared with the value of the selector(s) from your incoming logs.
(Optional) Selector(s) from your incoming logs.
The values from these selectors will be used to search for matches in your Lookup Table data.
(CLI workflow): A Lookup Table configuration file.
Your Lookup Table's primary key column must be one of the following data types:
String
Number
Array (of strings or numbers)
Using an array lets you associate one row in your Lookup Table with multiple string or number primary key values. This prevents you from having to duplicate a certain row of data for multiple primary keys.
The maximum size for a row in a Lookup Table is 65535 bytes.
This option is best for data that is relatively static, such as information about AWS accounts or corporate subnets. You may want to set up a Lookup Table via a File Upload in the Panther Console. For example, a possible use case is adding metadata to distinguish developer accounts from production accounts in your AWS CloudTrail logs.
You can import via file upload through the Panther Console or with PAT:
In some cases, you may want to sync from an S3 source to set up a Lookup Table. For example, if you want to know what groups and permission levels are associated with the employees at your company. In this scenario, your company might have an AWS S3 source with an up-to-date copy of their Active Directory listing that includes groups and permissions information.
This option is best for a larger amount of data that updates more frequently from an S3 bucket. Any changes in the S3 bucket will sync to Panther.
You can sync via S3 through the Panther Console or with PAT:
After you configure a Lookup Table, you can write detections based on the additional context from your Lookup Table.
For example, if you configured a Lookup Table to distinguish between developer and production accounts in AWS CloudTrail logs, you might want receive an alert only if the following circumstances are both true:
A user logged in who did not have MFA enabled.
The AWS account is a production (not a developer) account.
See how to create a detection using Lookup Table data below:
Accessing Lookup Table data the event was automatically enriched with
The rule would become:
Dynamically accessing Lookup Table data
The Panther rules engine will take the looked up matches and append that data to the event using the key p_enrichment
in the following JSON structure:
Example:
If the value of the matching log key is an array (e.g., the value of p_any_aws_accout_ids
), then the lookup data is an array containing the matching records.
Example:
For rules that use p_enrichment
, click Enrich Test Data in the upper right side of the JSON code editor to populate it with your Lookup Table data. This allows you to test a Python function with an event that contains p_enrichment
.
Lookup Tables will generate a number of tables in the Data Explorer. There are two main types of tables generated:
The current Lookup Table version: example
Contains the most up to date Lookup Table data
Should be targeted in any Saved Searches, or anywhere you expect to see the most current data
This table name will never change
In the example above, the table is named example
The current History Table version: example_history
Contains a version history of all data uploaded to the current Lookup Table
The table schema is identical to the current Lookup Table (here named example
) except for two additional fields:
p_valid_start
p_valid_end
These fields can be used to view the state of the Lookup Table at any previous point in time
When a new schema is assigned to the Lookup Table, the past versions of the Lookup Table and the History Table are both preserved as well.
These past versions are preserved by the addition of a numeric suffix, _###
and will be present for both the Lookup Table and the History Table. This number will increment by one each time the schema associated with the Lookup Table is replaced, or each time the primary key of the Lookup Table is changed.
You can manually set associated log types and Selectors when creating a Lookup Table (), and/or let them be automatically mapped ().
Note that even if you manually choose log types and Selectors in this way, the automatic mappings described in will still be applied.
When creating a Lookup Table in the Panther Console, you can set associated log types and Selectors. Learn more in , below.
See the for a full list of fields.
This method of associating log types and Selectors to a Lookup Table is not available for Lookup Tables that are populated using . It is only applicable to Lookup Tables that are populated using .
If, in the schema for your Lookup Table data, the primary key field is marked as an (e.g., as an email
and/or username
), for each indicator value, Panther automatically:
Note that p_enrichment
is not stored with the log event in the data lake. See for more information.
If your log event was enriched on ingest (as described in ), you can access the data within the p_enrichment
field () using the deep_get()
event object function. Learn more about deep_get()
.
See a full example of this method below, in .
It's also possible to dynamically access Lookup Table data from Python detections using . In this way, you can retrieve data from any Lookup Table, without it being injected into an incoming event as described in .
See the below section to learn more about primary key requirements.
See for a full list of fields.
We recommend you and install the .
After fulfilling the , Lookup Tables can be created and configured using either of the following methods:
After choosing one of these methods, you can opt to work within the Panther Console or with .
Next to Enabled? toggle the setting to Yes. Note: This is required to import your data later in this process.
You also can reference attributes in nested objects using . For example, if you wanted to reference a field in a map, you could enter $.field.subfield
.
Click Add Log Type to add another if needed.
In the example screen shot above, we selected AWS.CloudTrail logs and typed in accountID
and recipientAccountID
to represent keys in the CloudTrail logs.
Configure the Table Schema. Note: If you have not already created a new schema, please see . You can also use your Lookup Table data to infer a schema. Once you have created a schema, you will be able to choose it from the dropdown on the Table Schema page while configuring a Lookup Table. Note: CSV schemas require column headers to work with Lookup Tables.
Select a Primary Key Name from the dropdown. This should be a unique column on the table, such as accountID
.
Drag and drop a file or click Select File to choose the file of your Lookup Table data to import. The file must be in .csv
or .json
format.
The alert destinations for this alarm are displayed at the bottom of the page. To configure and customize where your notification is sent, see documentation on .
​ ​
All files related to your Lookup Tables must be stored in a folder with a name containing lookup_tables
. This could be a top-level lookup_tables
directory, or sub-directories with names matching *lookup_tables*
. You can use the repo as a reference.
Create a YAML file for the schema, and save it with the rest of your custom schemas, outside the lookup_tables
directory (for example, /schemas
in the root of your panther analysis repo). This schema defines how to read the files you'll use to upload data to the table. If using a CSV file for data, then the schema should be able to parse CSV.
The table schema is formatted the same as a log schema. For more information on writing schemas, read our documentation around
You also can reference attributes in nested objects using . For example, if you wanted to reference a field in a map, you could enter $.field.subfield
.
Click Add Log Type to add another if needed.
In the example screen shot above, we selected AWS.VPCFlow logs and typed in account
to represent keys in the VPC Flow logs.
Configure the Table Schema. Note: If you have not already created a new schema, please see . Once you have created a schema, you will be able to select it from the dropdown on the Table Schema page while configuring a Lookup Table.
On the "Choose Import Method" page, click Set Up next to "Sync Data from an S3 Bucket."
Enter the Update Period, the cadence your S3 source gets updated (defaulted to 1 hour).
Please see the next section, , for instructions on the three options available to do this.
The alert destinations for this alarm are displayed at the bottom of the page. To configure and customize where your notification is sent, see documentation on .
​​
.
.
Click Launch Console UI.
All files related to your Lookup Tables must be stored in a folder with a name containing lookup_tables
. This could be a top-level lookup_tables
directory, or sub-directories with names matching *lookup_tables*
. You can use the repo as a reference.
Create a YAML file for the schema, and save it in the lookup table directory (for example, lookup_tables/my_table/my_table_schema.yml
). This schema defines how to read the files you'll use to upload data to the table. If using a CSV file for data, then the schema should be able to parse CSV.
The table schema is formatted the same as a log schema. For more information on writing schemas, read our documentation around
The ARN of an IAM role in AWS, which Panther can use to access the S3 bucket. For more information on setting up an IAM role for Panther, see the section on
In Python, you can use the to retrieve the looked up field from p_enrichment
using the foreign key field in the log. The pattern looks like this:
You can also use the to dynamically access Lookup Table data in your detection. This may be useful when your event doesn't contain an exact match to a value in the Lookup Table's primary key column.
In a , you can create an .