Guide
Watch a deployment folder
Not released yet. Logthread Agent can watch the folder your web app runs from, for example D:\inetpub\app, and tell you when a file changes outside a deployment. A changed web.config or a new .aspx file that no one deployed is what tampering and web shells look like.
How it works#
- The agent takes a baseline of every file in the folders you name: its name, size and SHA-256.
- It then watches the folders. A file that is created, changed or deleted is reported within seconds, with its old and new SHA-256, the folder and the file type. A periodic scan every 15 minutes catches anything a watch missed.
- Logthread compares each change with your deployments. A change inside a deployment is expected. A change outside one is a finding.
A file is read again only when its size or modification time changed, so a large folder costs little.
Turn it on#
- Open Integrations → Windows server and tick Watch folders.
- Give the folders, separated by
;, for exampleD:\inetpub\app;D:\inetpub\admin. Up to ten. - Add anything else to ignore under Also ignore: names or patterns such as
reportsor*.bak. Already ignored:logs,log,temp,tmp,cache,App_Data,uploads,node_modules,*.log,*.tmp. A name without a path matches a file or folder of that name anywhere under the watched folder, and matching ignores case on Windows. - Run the install or upgrade command the setup gives you, in PowerShell as Administrator. It adds the agent profile
security-deploy-watch.
To turn it on for many servers at once, use Data in → Host agents → Configs → Roll out a setting with the template Deployment folder watch, servers picked by label (for example role=web). Change its paths to your folders before you activate it. It needs agent 0.4.0 or later.
Each folder holds at most 50,000 files and goes 12 levels deep. A folder over the limit sends one record, fim_limit_reached, with the count and the limit, and the other folders keep being watched. Narrow the folder or add to the ignore list.
Check#
The check step shows each folder's baseline record with its file count. A folder that shows no baseline has not been scanned yet or cannot be read: check the path, and that the service runs as LocalSystem, which the installer sets up.
To see the changes, in Explore:
event.dataset:fim fim.root:* | stats count() by fim.root, event.action, file.extensionChange a file in the folder, for example add a line to a text file, and the record appears within seconds.
Mark your deployments#
A deployment changes many files at once, and that is not suspicious. Tell Logthread when one happens, in either of two ways. Use both if you like.
From your pipeline. Send the change when you deploy, with an API key that has the annotate scope:
curl -X POST https://logthread.com/api/changes \
-H "Authorization: Bearer $LOGTHREAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"deploy","service":"web","version":"2026.12.01-42","summary":"Release 42"}'See What changed before an incident for every field and the SDKs.
From the deployment itself. Write a file called .logthread-deploy into the folder as the deployment's last step, with the build id on its first line (up to 128 bytes):
Set-Content -Path D:\inetpub\app\.logthread-deploy -Value "build-42"Every change the agent reports under that folder then carries deployment.marker, and a change with the marker never counts as outside a deployment. Use this when you cannot call the API from where you deploy.
Detections#
Open Alerts → Detections and search for deployment or web root.
| Detection | Fires on |
|---|---|
| Deployment folder changed outside a deployment | A changed or new .dll, .config, .aspx, .ascx, .ashx, .asmx, .asax, .cshtml, .master or .svc file in a watched folder. It stays quiet for 30 minutes after a deployment marker or a new service version, and never fires for a change that carries the marker |
| New program or script in a web root | A new executable or script file under a folder named inetpub, wwwroot, webroot, htdocs or public_html (critical) |
For the first one to know about deployments, report them as above. Without that, every change in the folder looks outside a deployment.
Troubleshooting#
- No baseline record. Check the folder path in the setup and that the folder exists on that server. Run
Get-Service LogthreadAgent, and readC:\ProgramData\Logthread\Agent\logs\agent.log. - Too many records. A folder the app writes into by itself: add it under Also ignore.
- A change shows no
deployment.marker. The marker file must be in the watched folder itself (the folder you gave in the setup, not a subfolder), and should be written as the deployment's last step. - The detection fires after every deployment. The deployment was not reported. Send
POST /api/changesfrom your pipeline or write the marker file. fim_limit_reached. The folder holds more than 50,000 files. Ignore the folders that hold assets or generated files.
Price#
Nothing extra. File change records are billed as data ingested, like any other data. See Prices.