Cotool + Salesforce
Connect Salesforce to Cotool so agents investigate Setup Audit Trail changes, Login History, and Threat Detection events, and ingest them for detections.
The short answer
Salesforce records admin configuration changes in the Setup Audit Trail, every login attempt in Login History, and, with Shield or Event Monitoring, real-time login, API, report, and threat events. Cotool gives agents tools over these sources and ingests them into its own log store with built-in detections.[1][2][7][8][9]
How it connects: Cotool authenticates with the OAuth 2.0 client credentials flow: a connected app's consumer key and secret are exchanged for an access token issued on behalf of a dedicated integration user, so Cotool sees only what that user can see.[2][12]
What Cotool uses from Salesforce
- Setup Audit Trail
- Changes admins make in Setup. Each row has an Action code such as PermSetCreate, the Setup Section, a Display description, who made the change, and DelegateUser when an admin acted through Login-As.[7]
- Login History
- Successful and failed login attempts, with Status (success or the failure reason), SourceIp, LoginType, Application, Browser, Platform, CountryIso, LoginUrl, and the TLS protocol and cipher suite.[8]
- Real-time activity events
- Real-Time Event Monitoring emits login, logout, Login-As, API, report, and permission set events as platform events, with storage objects such as LoginEvent, ApiEvent, and PermissionSetEventStore.[9]
Detections, hunts, and triage
- Triage a session hijacking eventTriage
- An agent reads the event's current and previous fingerprint fields and contributing features, then pulls the user's recent Login History to see whether the new IP address and user agent ever logged in on their own.[6][8][10]
- Detect risky Setup changesDetection
- With the Setup Audit Trail in Cotool, detections flag permission set creation, changes in sections such as Manage Users, and any Setup change made through Login-As, using the Action, Section, and DelegateUser fields.[1][4][7]
Example query
SELECT UserId, LoginTime, Status, SourceIp, LoginType, CountryIso
FROM LoginHistory
WHERE LoginTime > 2026-11-01T00:00:00.000Z
AND LoginTime < 2026-11-02T00:00:00.000ZA SOQL query in the shape Salesforce documents for Login History, returning each attempt's user, time, result, IP address, login type, and country for a time window. Change the timestamps, or filter on UserId or CountryIso, both of which LoginHistory accepts as filters.[8]
Setup and permissions
Create a dedicated user with the Salesforce Integration user license and the Minimum Access - API Only Integrations profile. Then enable the client credentials flow on a connected app and set that user as its Run As user.[12]
| Permission | Access | Why |
|---|---|---|
| API EnabledGranted by the Minimum Access - API Only Integrations profile, which also restricts the user to API access.[12] | Read | Granted by the Minimum Access - API Only Integrations profile, which also restricts the user to API access.[12] |
| Salesforce API Integration permission set licenseEntitles the integration user to the permissions granted through a dedicated permission set.[12] | Read | Entitles the integration user to the permissions granted through a dedicated permission set.[12] |
| Monitor Login HistoryLets the integration user read LoginHistory records for all users.[8] | Read | Lets the integration user read LoginHistory records for all users.[8] |
| View Real-Time Event Monitoring DataRequired, with Shield or Event Monitoring, to read real-time events and Threat Detection stores such as SessionHijackingEventStore.[10][11] | Read | Required, with Shield or Event Monitoring, to read real-time events and Threat Detection stores such as SessionHijackingEventStore.[10][11] |
- Real-time events and Threat Detection objects need either the Salesforce Shield or the Event Monitoring add-on subscription.[10][11]
- The client credentials flow returns no refresh token. The client requests a new access token with its client ID and secret when the old one expires.[12]
- Salesforce recommends one connected app, one integration user, and one permission set per integration, so each system's requests can be audited and its secret rotated alone.[12]
How Cotool works with Salesforce
- Cotool added Salesforce in release 0.75.0 alongside Workday, Microsoft Intune, and Doppel, with agent tools, managed log ingestion, and built-in detections.[1]
- Ingested Salesforce events land in Cotool Logs, where they are searchable and feed scheduled detections. Log ingestion is enabled per stream, separately from connecting the integration.[3]
- Cotool detections are Python code that can run on logs stored in Cotool or call connected tools directly, so a Salesforce detection can join Login History with other identity data.[4]
FAQ
- Which Salesforce license do real-time events and Threat Detection need?
- Salesforce real-time events and Threat Detection events need the Salesforce Shield or Event Monitoring add-on, and the reading user needs the View Real-Time Event Monitoring Data permission. Both requirements appear in the access rules of each event object.[10][11]
- What does DelegateUser mean in the Salesforce Setup Audit Trail?
- DelegateUser in the Salesforce Setup Audit Trail is the Login-As user who performed the Setup action. It is blank when nobody used Login-As, so a filled value shows an admin acting as someone else.[7]
Sources
- Changelog (Cotool docs) · accessed November 22, 2026
- Integrations (Cotool) · accessed November 22, 2026
- Cotool Log Ingest (Cotool docs) · accessed November 22, 2026
- Detections are code (Cotool Detect) · accessed November 22, 2026
- Threat hunting (Cotool Hunt) · accessed November 22, 2026
- Respond to every signal (Cotool Respond) · accessed November 22, 2026
- SetupAuditTrail (Salesforce Object Reference) · accessed November 22, 2026
- LoginHistory (Salesforce Object Reference) · accessed November 22, 2026
- Real-Time Event Monitoring Objects (Salesforce Platform Events Developer Guide) · accessed November 22, 2026
- SessionHijackingEventStore (Salesforce Platform Events Developer Guide) · accessed November 22, 2026
- ApiAnomalyEvent (Salesforce Platform Events Developer Guide) · accessed November 22, 2026
- Invoke REST APIs with the Salesforce Integration User and OAuth Client Credentials (Salesforce Developers Blog) · accessed November 22, 2026

