This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Query to check file contents

Hello,

I want to have a query to check for possible PII. There is the query to check for metadata such a password.docx or password.txt. Below is what I have so far and this works as long as you have the exact file path and pattern you are looking for. I tried to use % wildcards for path and %-, %%%-%%%-%%%% and even tried using grep syntax to look for socials in this example. Any help on how to get this to scan directories for files containing specific patterns either with a wildcard or another means. Thank you!

SELECT
*
FROM
grep
WHERE
path = '$$Location$$'
AND pattern = '$$Data$$'



This thread was automatically locked due to age.
Parents Reply
  • FormerMember
    0 FormerMember in reply to Sophos User930

    the problem with splitting on the . is that you can technically have .'s in a folder name. C:\This.Folder\This\Folder.This\this.txt would be a valid path and not be processed by that query. Not sure if the OP needs that sort of constraint/folder handling. 

    At this stage its more about thinking up the most robust solution.

Children