Add Netskope adapter (REST API v2 dataexport iterator)#298
Draft
maximelb wants to merge 1 commit into
Draft
Conversation
Pulls Netskope security telemetry into LimaCharlie via the REST API v2
dataexport iterator endpoints
(/api/v2/events/dataexport/{events|alerts}/{type}). Each event/alert stream
is modeled as a "feed" with its own server-side iterator cursor (the "index"
query parameter), so the adapter keeps no local state and a restart resumes
each stream without gaps or duplicates.
Out of the box it collects every alert stream (dlp, malware, malsite, ctep,
compromisedcredential, uba, policy, quarantine, remediation,
securityassessment, watchlist) plus the audit event stream; high-volume
event streams (page, application, network, ...) are opt-in via alert_types /
event_types or a custom feeds list. Records are shipped verbatim with the
event time taken from the record's epoch-seconds timestamp.
The transport authenticates with the Netskope-Api-Token header, honours the
server's wait_time pacing and the 4 req/s/endpoint rate limit (Retry-After /
RateLimit-Reset aware), and treats source-side errors (incl. 401/403) as
non-fatal warnings so one broken feed never tears down the whole adapter.
Registered in containers/conf/all.go and containers/general/tool.go as the
"netskope" adapter. Includes a faithful httptest mock of the iterator
(cursor/seed/resend semantics, auth, envelope) and end-to-end tests covering
shipping fidelity, pagination, multi-feed tagging, dedup, start_time seeding
and bad-token handling. Mock-tested; not yet live-verified against a tenant.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BRuMUp1CPdXd781USnMRy9
lcbill
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Netskope USP adapter that pulls Netskope security telemetry into LimaCharlie via the REST API v2 dataexport iterator endpoints (
/api/v2/events/dataexport/{events|alerts}/{type}).Modeled on the
threatlockeradapter. Each event/alert stream is a feed with its own server-side iterator cursor (theindexquery parameter): Netskope remembers the read position per index name, so the adapter keeps no local state and a restart resumes each stream with no gaps or duplicates.What it ingests
dlp,malware,malsite,ctep,compromisedcredential,uba,policy,quarantine,remediation,securityassessment,watchlist— plus theauditevent stream.page/application/network/incident/infrastructure/endpointevents, viaalert_types/event_typesor a customfeedslist.EventTypeis the feed name (e.g.alert_dlp,event_audit) and the event time is the record's epoch-secondstimestamp.Implementation notes
Netskope-Api-Tokenheader (REST API v2 token), verified against Netskope's official SDK source.wait_time, drains backlogs quickly, and respects the documented 4 req/s/endpoint rate limit (Retry-After/RateLimit-Resetaware).401/403for a missing endpoint scope) are non-fatal warnings, so one broken feed never tears down the whole adapter; only a failure delivering to LimaCharlie is fatal (mirrorsthreatlocker's rationale for the hosted cloud-adapter environment).start_timeoptionally seeds a brand-new stream for a bounded backfill (epoch / RFC3339 / relative duration); default isoperation=next(restart-safe).resend/start_timere-seed after restart).Registration
containers/conf/all.go— import +Netskopefield onGeneralConfigs(json:"netskope").containers/general/tool.go— import +method == "netskope"dispatch branch.README.md+netskope/README.md.Testing
go build ./containers/general✅,go vet ./netskope/...✅,gofmtclean ✅go test ./netskope/...✅ — a faithfulhttptestmock of the iterator (cursor / epoch-seed / resend semantics,Netskope-Api-Tokenauth,{"ok":1,"result":[...],"wait_time":N}envelope) drives end-to-end tests for shipping fidelity (verbatim payload + parsed timestamp), multi-page walking, multi-feed tagging, dedup,start_timeseeding, transient-error retry, and bad-token handling, plus unit tests for config validation, envelope parsing, base-URL/start-time/index helpers and transient-error classification.🤖 Generated with Claude Code