| SamurAI [Local] Collector | SamurAI [Cloud] Collector |
|---|---|
This guide describes the steps required to configure Cloudflare to stream its Zero Trust, Gateway, Magic Transit and Browser Isolation logs to public cloud storage (Microsoft Azure Blob Storage or Amazon S3) for ingestion to the SamurAI platform via a Cloud Collector.
The logs are delivered by:
- Creating a Logpush job in the Cloudflare dashboard for each dataset
- Cloudflare writing the log files to a customer owned cloud storage container / bucket
- The SamurAI Cloud Collector monitoring that storage for new files and pulling the data into the SamurAI platform
Prerequisites
Ensure that a Samurai Cloud Collector has been deployed via the SamurAI Portal for your chosen cloud provider (Microsoft Azure or Amazon Web Services).
Take note of the following as it will be required when configuring the Logpush destination:
- Microsoft Azure — the Storage account name
- Amazon Web Services — the S3 bucket name and the Region
If you are planning to reuse an already deployed Cloud Collector, this information can be found via:
- Navigate to the SamurAI Portal
- Click Telemetry and select Collectors from the main menu
- Click on the name of the desired Collector
- Note down the storage information presented
Supported datasets
| Dataset | Sourcetype | Product |
|---|---|---|
| Gateway HTTP | cloudflare_gateway_http | Gateway HTTP |
| Gateway DNS | cloudflare_gateway_dns | Gateway DNS |
| Gateway Network | cloudflare_gateway_network | Gateway Network |
| Zero Trust Network Session | cloudflare_zerotrust_network_session | Zero Trust Network Session |
| Network Analytics | cloudflare_network_analyze | Network Analytics |
| Device Posture Results | cloudflare_device_posture | Device Posture |
| Audit Logs v2 | cloudflare_audit_logs_v2 | Audit Logs v2 |
| Access Requests | cloudflare_access_request | Access Request |
| Browser Isolation User Actions | cloudflare_remote_browser_isolation | Remote Browser Isolation |
Storage naming requirement
This step is mandatory. The integration will not work if it is not followed.
The SamurAI platform identifies each Cloudflare dataset from the name of the storage location the data is written to. Every dataset must therefore be written to its own dedicated Azure Blob Storage container or Amazon S3 path, named with the matching suffix below.
| Dataset | Required name suffix |
|---|---|
| Gateway HTTP | cloudflare-gateway-http |
| Gateway DNS | cloudflare-gateway-dns |
| Gateway Network | cloudflare-gateway-network |
| Zero Trust Network Session | cloudflare-zerotrust-network-session |
| Network Analytics | cloudflare-network-analyze |
| Device Posture Results | cloudflare-device-posture |
| Audit Logs v2 | cloudflare-audit-logs-v2 |
| Access Requests | cloudflare-access-request |
| Browser Isolation User Actions | cloudflare-browser-isolation-useractions |
Any name is permitted as long as it ends with the suffix exactly as shown — for example contoso-cloudflare-gateway-http.
If the suffix does not match, the data will still be uploaded to your storage but the SamurAI platform will not be able to identify it as Cloudflare telemetry, and the events will not be analysed.
Configure Logpush in Cloudflare
Follow the vendor documentation to create one Logpush job per dataset, writing to the storage prepared above.
Logpush jobs for the SASE datasets are created at the account level.
Select the section below that matches your deployed Cloud Collector, complete the destination steps, then apply the Logpush job settings.
Amazon S3 (AWS Cloud Collector)
Confirm the bucket name and region. Use the S3 bucket name and Region noted in the Prerequisites. This is the bucket monitored by the Cloud Collector.
Start creating the Logpush job. In the Cloudflare dashboard, open the Logpush page, select Create a Logpush job and choose Amazon S3 as the destination.
Enter the bucket and copy the bucket policy. Enter the S3 bucket name in the Bucket field. Once entered, Cloudflare automatically generates the bucket policy JSON that allows Cloudflare to upload logs to the bucket. Copy it, but do not select Continue yet.
Add the Cloudflare statement to the existing bucket policy. In the AWS Management Console open the bucket, then Permissions > Bucket policy. Add the
Statementelement generated by Cloudflare as a new element in the existingStatementarray.Do not delete the existing SamurAI statement and do not overwrite the whole bucket policy with the JSON from Cloudflare. If the existing statement is removed, the Cloud Collector will no longer be able to read the bucket and no logs will be analysed.For example, the bucket policy initially contains only the read permission for the Cloud Collector:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowSamuraiXdrReader", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::600502389717:user/samurai-xdr-s3-reader-user" }, "Action": [ "s3:GetObject", "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::<bucket-name>", "arn:aws:s3:::<bucket-name>/*" ] } ] }After adding the Cloudflare statement, the policy will look similar to the following. Save the policy.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1506627150918", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::391854517948:user/cloudflare-logpush" }, "Action": "s3:PutObject", "Resource": "arn:aws:s3:::<bucket-name>/*" }, { "Sid": "AllowSamuraiXdrReader", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::600502389717:user/samurai-xdr-s3-reader-user" }, "Action": [ "s3:GetObject", "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::<bucket-name>", "arn:aws:s3:::<bucket-name>/*" ] } ] }Enter the Path and Bucket region. Return to the Cloudflare Logpush page and complete the following:
- Path: enter a value that ends with the required suffix for the dataset, as listed in Storage naming requirement — for example
contoso-cloudflare-gateway-http. The Path is what the SamurAI platform uses to identify the dataset, so each dataset needs its own Path. - Enable Organize logs into daily subfolders.
- Bucket region: select the region of the bucket confirmed in step 1.
- Select Continue.
- Path: enter a value that ends with the required suffix for the dataset, as listed in Storage naming requirement — for example
Complete ownership verification. Cloudflare places an ownership verification file at the specified bucket and Path. Open the file in the S3 bucket, copy the ownership token, enter it in Cloudflare and select Continue.
Microsoft Azure (Azure Cloud Collector)
Create a container for the dataset. In the Azure portal open the Storage account noted in the Prerequisites and create a Blob Storage container whose name ends with the required suffix for the dataset, as listed in Storage naming requirement — for example
contoso-cloudflare-gateway-http. Each dataset needs its own container.Generate a SAS URL. In the Storage account select Security + networking > Shared access signature and configure:
- Allowed services: Blob
- Allowed resource types: Object
- Allowed permissions: Write
- Allowed protocols: HTTPS only
- Expiry time: Cloudflare requires an expiration period of at least five years (see the note below)
Select Generate SAS and connection string and copy the Blob service SAS URL.
Create the Logpush job. In the Cloudflare dashboard, open the Logpush page, select Create a Logpush job and choose Microsoft Azure as the destination. Complete the following:
- SAS URL: enter the Blob service SAS URL generated in step 2.
- Path: enter the container name created in step 1 (ending with the required suffix). The Path is what the SamurAI platform uses to identify the dataset.
- Enable Organize logs into daily subfolders.
- Select Continue.
Logpush job settings
After the destination steps, on the dataset selection and job configuration screens:
- Select the dataset that matches the Path you entered.
- Set the Job name to the same string as the Path.
- Under If logs match…, select All logs.
- Under Send the following fields…, do not leave Select all checked. Select only the fields listed in Fields to send for that dataset.
- Set Timestamp format to RFC3339.
- Select Submit to create the job.
Repeat for each dataset
Repeat the steps above for each dataset you wish to onboard. The bucket policy (Amazon S3) and SAS URL (Microsoft Azure) can be reused, however the Path / container, ownership verification (Amazon S3), dataset selection and job settings must be completed for each dataset.
Finally, return to the Logpush page and confirm that all created jobs are listed and enabled.
Fields to send
The lists below are the minimum set of fields required for the SamurAI platform to analyse each dataset. Selecting Select all sends a large volume of data that the platform does not use, which increases storage and egress costs without improving detection coverage.
In the Send the following fields… section of each Logpush job, clear Select all and tick at least the fields listed for that dataset.
These lists are a minimum, not a maximum. You are free to send additional fields if you need them for your own auditing, compliance or investigation purposes — they are stored and remain searchable, and sending them does not affect the analysis. Just be aware that they increase the volume of data stored.
Omitting any field from the list, however, may reduce detection coverage for that dataset.
Cloudflare periodically adds new fields to its datasets. Any field not listed below is currently not used by the SamurAI platform.
Gateway HTTP
Action, ApplicationNames, BlockedFileHash, BlockedFileName, BlockedFileSize, BlockedFileType, CategoryNames, Datetime, DestinationIP, DestinationIPCountryCode, DestinationPort, DeviceID, DeviceName, DownloadMatchedDlpProfiles, Email, FileInfo, HTTPHost, HTTPMethod, HTTPStatusCode, HTTPVersion, PolicyName, Referer, RequestID, SessionID, SourceIP, SourceIPCountryCode, SourceInternalIP, SourcePort, URL, UploadMatchedDlpProfiles, UserAgent, UserID, VirtualNetworkName
Gateway DNS
ApplicationName, AuthoritativeNameServerIPs, CNAMECategoryNames, CNAMEs, Datetime, DeviceID, DeviceName, DstIP, DstPort, Email, MatchedIndicatorFeedNames, PolicyName, Protocol, QueryCategoryNames, QueryName, QuerySize, QueryTypeName, RCode, ResolvedIPs, ResolverDecision, ResponseTimeMs, SrcIP, SrcIPCountryCode, SrcPort, UpstreamRecordTTLs, UserID
Gateway Network
Action, ApplicationNames, CategoryNames, Datetime, DestinationIP, DestinationIPCountryCode, DestinationPort, DetectedProtocol, DeviceID, DeviceName, Email, OverrideIP, OverridePort, PolicyName, SNI, SessionID, SourceIP, SourceIPCountryCode, SourceInternalIP, SourcePort, TransportProtocol, UserID, VirtualNetworkName
Zero Trust Network Session
BytesReceived, BytesSent, ConnectionCloseReason, DestinationTunnelID, DetectedProtocol, DeviceID, DeviceName, EgressIP, EgressRuleName, Email, Offramp, OriginIP, OriginPort, OriginTLSCertificateIssuer, Protocol, ResolvedFQDN, SNI, SessionEndTime, SessionID, SessionStartTime, SourceIP, SourceInternalIP, SourcePort, UserID, VirtualNetworkID
Network Analytics
AttackID, AttackVector, DNSQueryName, DNSQueryType, Datetime, DestinationCountry, DestinationPort, Direction, ICMPCode, ICMPType, IPDestinationAddress, IPProtocol, IPProtocolName, IPSourceAddress, IPTTL, MitigationReason, MitigationSystem, Outcome, RuleID, RuleName, SourceCountry, SourcePort, TCPFlagsString, Verdict
Device Posture Results
DeviceID, DeviceManufacturer, DeviceModel, DeviceName, DeviceSerialNumber, DeviceType, Email, OSVersion, PolicyID, PostureCheckName, PostureCheckType, PostureEvaluatedResult, PostureExpectedJSON, PostureReceivedJSON, Timestamp, UserUID
Audit Logs v2
ActionDescription, ActionResult, ActionTimestamp, ActionType, ActorContext, ActorEmail, ActorID, ActorIPAddress, ActorType, AuditLogID, ResourceID, ResourceProduct, ResourceRequest, ResourceResponse, ResourceType, ZoneID, ZoneName
Access Requests
Action, Allowed, AppDomain, Connection, Country, CreatedAt, Email, IPAddress, PurposeJustificationResponse, RayID, UserUID
Browser Isolation User Actions
Decision, DomainName, Metadata, Timestamp, Type, URL, UserEmail, UserID
Our Integration guide was accurate at the time of writing but vendors change things frequently! If you find errors or anything is outdated, let us know by raising a request in the SamurAI MDR Portal and we shall get it updated.