Sophos Endpoint and Server products all come equipped with Application Control. This technology allows operators to monitor or restrict access to different programs and applications, such as System Tools or Browsers.
If you are not using this, our docs are here:
Often, an administrator may want to export a report of their current monitoring or block list. There may even come a time where the operator wants to see specific time stamps for frequency or use the information during a threat hunt.
You must have XDR enabled in your environment.
This is intended for Windows only on Live Discovery.
WITH policyStamp (stamp) AS
WHERE key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Sophos\Management\Policy\ApplicationControl\'
AND name = 'latest'),
policyFullStamp AS (
SELECT 'HKEY_LOCAL_MACHINE\SOFTWARE\Sophos\Management\Policy\ApplicationControl\' || stamp
appControl (name, status) AS (
WHEN data = 1 THEN 'Enabled'
WHEN data = 0 THEN 'Disabled'
WHERE key = (SELECT * FROM policyFullStamp))
SELECT * FROM appControl
There are a few key areas you want to look at:
Policy Decision Making
app_control_detection_action = enabled = block
app_control_detection_action = disabled = allow (monitor/log)
Policy App List
app_control_blocked_app_list = list of apps that app_control_detection_action is looking for
-- Variable Type String
-- Variable Name YYYY-MM
-- Ex: 2022-10
WITH sspLog AS (
WHERE path = 'C:\ProgramData\Sophos\Endpoint Defense\Logs\SSP.log'
AND pattern = '$$YYYY-MM$$'),
logDetails (timestamp, description) AS (
SELECT datetime(CAST(SPLIT(line, ' ', 0) AS VARCHAR),'localtime'),
CAST(SPLIT(line, ']', 1) AS VARCHAR)
SELECT * FROM logDetails
WHERE description LIKE '%controlled app%'
ORDER BY timestamp DESC
Focusing our attention to the variable in this query, we can pinpoint more specifics. For example, we used YYYY-MM to return an entire month of logs. This is why we see large costs in resources to compute this. If you modify the variable, to YYYY-MM-DD, this will allow us a more precise timeline and smaller query.
You will want to also reflect this change in line 9 of the shared code. If not, you can expect an error. In doing so, this will return a smaller cost in resources to the machines. You may want to query this further.
At the end of the query, you could add the program interaction you are hunting for.