Documentation
¶
Overview ¶
Package cloudflare provides the Cloudflare integration definition for integrations
Index ¶
- Constants
- Variables
- func Builder(runtime *RuntimeConfig) registry.Builder
- func DomainScanPollBackoff(attempt int) time.Duration
- type AssetCollect
- type AssetSync
- type Client
- type ClientConfig
- type CloudflareClient
- type CredentialSchema
- type DirectorySync
- type DomainScanBuildReport
- type DomainScanBuildReportResult
- type DomainScanGatherEnrichment
- type DomainScanGatherEnrichmentResult
- type DomainScanImport
- type DomainScanImportAsset
- type DomainScanImportFinding
- type DomainScanImportPlatform
- type DomainScanImportSystem
- type DomainScanImportVendor
- type DomainScanPoll
- type DomainScanPollEnvelope
- type DomainScanPollHandler
- type DomainScanPollResult
- type DomainScanRequest
- type DomainScanRequestResult
- type DomainScanSubmit
- type DomainScanSubmitResult
- type FindingsCollect
- type FindingsSync
- type HealthCheck
- type InstallationMetadata
- type RuntimeConfig
- type ScanTaskError
- type ScanTaskErrors
- type UserInput
Constants ¶
const ( // DomainScanPollIntervalMin is the wait before the first retry, and the starting point the backoff doubles from DomainScanPollIntervalMin = 10 * time.Second // DomainScanPollIntervalMax caps how long the backoff is allowed to grow to between poll cycles DomainScanPollIntervalMax = 60 * time.Second // DomainScanMaxAttempts bounds how many poll cycles are attempted before giving up on a scan DomainScanMaxAttempts = 30 )
const ( // DomainScanPerformedBy marks a Scan record as one the system should actually submit to the cloudflare domain scan job DomainScanPerformedBy = "openlane_domain_scan" // DomainScanGroupMetadataKey is the Scan.Metadata key carrying the shared group id for scans // created together (e.g. every domain from one organization settings update), so scans // submitted independently can still be recombined into a single notification once the whole // group reaches a terminal state DomainScanGroupMetadataKey = "scan_group_id" )
Variables ¶
var ( // DomainScanPollTopic is the Gala topic name for domain scan polling DomainScanPollTopic = gala.TopicName("domainscan.poll." + domainScanPollSchemaName) // DomainScanPollListenerName is the Gala listener name for the domain scan poll handler DomainScanPollListenerName = "domainscan.poll." + domainScanPollSchemaName + ".handler" )
var ( // ErrAPITokenMissing indicates the Cloudflare API token is missing from the credential ErrAPITokenMissing = errors.New("cloudflare: api token missing") // ErrCredentialInvalid indicates credential metadata could not be decoded ErrCredentialInvalid = errors.New("cloudflare: credential invalid") // ErrCredentialMetadataRequired indicates no credential metadata was provided ErrCredentialMetadataRequired = errors.New("cloudflare: credential metadata required") // ErrTokenVerificationFailed indicates the Cloudflare token verification failed ErrTokenVerificationFailed = errors.New("cloudflare: token verification failed") // ErrTokenNotActive indicates the Cloudflare token is not in an active state ErrTokenNotActive = errors.New("cloudflare: token is not active") // ErrClientType indicates the provided client is not a Cloudflare client ErrClientType = errors.New("cloudflare: unexpected client type") // ErrResultEncode indicates an operation result could not be serialized ErrResultEncode = errors.New("cloudflare: result encode failed") // ErrMembersFetchFailed indicates the account members list request failed ErrMembersFetchFailed = errors.New("cloudflare: members fetch failed") // ErrMembersFetchFailed indicates the account members list request failed ErrGroupsFetchFailed = errors.New("cloudflare: groups fetch failed") // ErrPayloadEncode indicates a collected Cloudflare payload could not be serialized for ingest ErrPayloadEncode = errors.New("cloudflare: ingest payload encode failed") // ErrAccountIDMissing indicates the account ID is missing from user input ErrAccountIDMissing = errors.New("cloudflare: account id missing") // ErrOperationConfigInvalid indicates operation configuration could not be decoded ErrOperationConfigInvalid = errors.New("cloudflare: operation config invalid") // ErrFindingsFetchFailed indicates the Security Center insights list request failed ErrFindingsFetchFailed = errors.New("cloudflare: findings fetch failed") // ErrAssetsFetchFailed indicates the Registrar registrations list request failed ErrAssetsFetchFailed = errors.New("cloudflare: assets fetch failed") // ErrRuntimeConfigDecode indicates the runtime Cloudflare config could not be decoded ErrRuntimeConfigDecode = errors.New("cloudflare: runtime config decode failed") // ErrRuntimeConfigInvalid indicates the runtime Cloudflare config is missing required fields ErrRuntimeConfigInvalid = errors.New("cloudflare: runtime config invalid") // ErrDomainScanSubmitFailed indicates the URL Scanner bulk submission request failed ErrDomainScanSubmitFailed = errors.New("cloudflare: domain scan submit failed") // ErrDomainScanResultFailed indicates the URL Scanner result retrieval request failed ErrDomainScanResultFailed = errors.New("cloudflare: domain scan result fetch failed") // ErrDomainScanTaskFailed indicates Cloudflare reported the scan task itself failed ErrDomainScanTaskFailed = errors.New("cloudflare: domain scan task failed") // ErrDomainScanMaxAttemptsReached indicates a scan never completed within the poll budget ErrDomainScanMaxAttemptsReached = errors.New("cloudflare: domain scan max poll attempts reached") // ErrInstallationRequired indicates the operation requires a resolved installation but none was provided ErrInstallationRequired = errors.New("cloudflare: installation required") )
var ( // DefinitionID is the stable identifier for the Cloudflare integration definition DefinitionID = types.NewDefinitionRef("def_01K0CFLARE00000000000000001") _,// domainScanSubmitSchema is the operation ref for submitting domains to the URL Scanner DomainScanSubmitOp = providerkit.OperationSchema[DomainScanSubmit]() _,//nolint:revive // domainScanPollSchema is the operation ref for polling a submitted URL Scanner result DomainScanPollOp = providerkit.OperationSchema[DomainScanPoll]() _,//nolint:revive // domainScanGatherEnrichmentSchema is the operation ref for gathering enrichment data for a domain DomainScanEnrichmentOp = providerkit.OperationSchema[DomainScanGatherEnrichment]() _,//nolint:revive // domainScanBuildReportSchema is the operation ref for building the scan report from a completed URL Scanner result and gathered enrichment DomainScanBuildReportOp = providerkit.OperationSchema[DomainScanBuildReport]() _,//nolint:revive // domainScanRequestSchema is the operation ref for requesting a domain scan; used both by // customer-facing calls (queues a pending Scan) and the system re-dispatch from the listener // on Scan creation (actually runs the saga for it) DomainScanRequestOp = providerkit.OperationSchema[DomainScanRequest]() _,//nolint:revive // domainScanImportSchema is the operation ref for importing an accepted domain scan review DomainScanImportOp = providerkit.OperationSchema[DomainScanImport]() //nolint:revive )
Functions ¶
func Builder ¶
func Builder(runtime *RuntimeConfig) registry.Builder
Builder returns the Cloudflare definition builder with the supplied runtime config applied. runtime.DomainScan configures vendor/technology classification for onboarding domain scan reports. When devMode is true or runtime.Provisioned() is true, a RuntimeIntegration is included so system-initiated calls (e.g. onboarding domain scans) can use the operator-owned account
func DomainScanPollBackoff ¶ added in v1.30.0
DomainScanPollBackoff returns the wait before the next poll cycle for a scan that's still processing. The interval doubles from DomainScanPollIntervalMin up to DomainScanPollIntervalMax as attempt grows, so slow scans are checked less often instead of exhausting the attempt budget at a flat cadence. Jitter is added on top to desynchronize scans that were submitted together and would otherwise poll Cloudflare in lockstep
Types ¶
type AssetCollect ¶ added in v1.23.0
type AssetCollect struct{}
AssetCollect collects Cloudflare domain registrations and stores them as assets
func (AssetCollect) IngestHandle ¶ added in v1.23.0
func (a AssetCollect) IngestHandle() types.IngestHandler
IngestHandle adapts asset collection to the ingest operation registration boundary
func (AssetCollect) Run ¶ added in v1.23.0
func (AssetCollect) Run(ctx context.Context, credentials types.CredentialBindings, client *CloudflareClient) ([]types.IngestPayloadSet, error)
Run collects Cloudflare domain registrations and emits asset ingest payloads
type AssetSync ¶ added in v1.23.0
type AssetSync struct {
// Disable is used to disable the asset sync operation from Cloudflare
Disable bool `json:"disable,omitempty" jsonschema:"title=Disable,description=Disable the syncing of domains from Cloudflare Registrar"`
// FilterExpr limits imported records to envelopes matching the CEL expression
FilterExpr string `` /* 181-byte string literal not displayed */
}
AssetSync holds installation-specific configuration for Cloudflare domain assets
type ClientConfig ¶ added in v1.27.12
type ClientConfig struct {
// AccountID is the Cloudflare account this client is scoped to
AccountID string
// APIToken is the raw Cloudflare API token, needed by calls made outside the SDK client
// (e.g. Browser Rendering requests issued directly by the domain scan enrichment operation)
APIToken string
// DomainScan configures vendor/technology classification for onboarding domain scan
// reports; runtime client only
DomainScan domainscan.ReportConfig
}
ClientConfig holds the account and domain scan settings a CloudflareClient is built from, sourced from either per-installation credentials or the operator-owned runtime config
type CloudflareClient ¶ added in v1.27.12
type CloudflareClient struct {
*cf.Client
// Config holds the account scope and domain scan settings this client was built with
Config ClientConfig
}
CloudflareClient wraps the Cloudflare SDK client with the account it's scoped to: the customer's own account for installation-bound operations, or the operator-owned account for system-initiated operations run through the runtime path. Config.DomainScan is only populated for the runtime (system) client, used by the domain scan enrichment operation
type CredentialSchema ¶
type CredentialSchema struct {
// APIToken is the Cloudflare API token with permissions to read account and zone metadata
APIToken string `json:"apiToken" jsonschema:"required,title=API Token"`
// AccountID is the Cloudflare account identifier used for account-scoped API calls
AccountID string `` /* 137-byte string literal not displayed */
}
CredentialSchema holds the Cloudflare API credentials for one installation
type DirectorySync ¶
type DirectorySync struct {
// Disable is used to disable the directory sync operation from Cloudflare
Disable bool `json:"disable,omitempty" jsonschema:"title=Disable,description=Disable the syncing of users and groups from Cloudflare"`
// FilterExpr limits imported records to envelopes matching the CEL expression
FilterExpr string `` /* 216-byte string literal not displayed */
}
DirectorySync holds installation-specific configuration collected from the user
func (DirectorySync) IngestHandle ¶
func (d DirectorySync) IngestHandle() types.IngestHandler
IngestHandle adapts directory sync to the ingest operation registration boundary
func (DirectorySync) Run ¶
func (DirectorySync) Run(ctx context.Context, credentials types.CredentialBindings, client *CloudflareClient) ([]types.IngestPayloadSet, error)
Run collects Cloudflare account members and emits directory account ingest payloads
type DomainScanBuildReport ¶ added in v1.27.12
type DomainScanBuildReport struct {
// InternalScanID is the openlane Scan record id the built report belongs to
InternalScanID string `json:"internalScanId"`
// Result is the completed URL Scanner task result to build the report from, allowed to be empty
// so if the url scanner failed the enrichment data can still be used for a partial report
Result json.RawMessage `json:"result,omitempty"`
// Enrichment is the company profile, compliance, and DNS vendor data gathered via
// DomainScanGatherEnrichment
Enrichment domainscan.Enrichment `json:"enrichment"`
}
DomainScanBuildReport combines a completed URL Scanner result with previously-gathered enrichment data (company profile, compliance, and DNS vendor data) and builds the structured onboarding domain scan report
func (DomainScanBuildReport) Handle ¶ added in v1.27.12
func (b DomainScanBuildReport) Handle() types.OperationHandler
Handle adapts domain scan report building to the generic operation registration boundary
func (DomainScanBuildReport) Run ¶ added in v1.27.12
func (DomainScanBuildReport) Run(ctx context.Context, client *CloudflareClient, cfg DomainScanBuildReport) (DomainScanBuildReportResult, error)
Run builds the structured scan report from the submitted URL Scanner result plus the already-gathered enrichment data
type DomainScanBuildReportResult ¶ added in v1.27.12
type DomainScanBuildReportResult struct {
// Data is the structured scan report, ready to persist on the Scan record
Data map[string]any `json:"data"`
}
DomainScanBuildReportResult carries the structured report built from the scan result and enrichment
type DomainScanGatherEnrichment ¶ added in v1.27.12
type DomainScanGatherEnrichment struct {
// Domain is the domain to gather enrichment for
Domain string `json:"domain"`
// ForceRefresh bypasses Cloudflare's Browser Rendering cache, forcing a fresh render
ForceRefresh bool `json:"forceRefresh,omitempty"`
}
DomainScanGatherEnrichment gathers company profile, compliance, and DNS vendor data for a domain
func (DomainScanGatherEnrichment) Handle ¶ added in v1.27.12
func (e DomainScanGatherEnrichment) Handle() types.OperationHandler
Handle adapts domain scan enrichment gathering to the generic operation registration boundary
func (DomainScanGatherEnrichment) Run ¶ added in v1.27.12
func (DomainScanGatherEnrichment) Run(ctx context.Context, client *CloudflareClient, cfg DomainScanGatherEnrichment) (DomainScanGatherEnrichmentResult, error)
Run gathers company profile, compliance, and DNS vendor data for the domain
type DomainScanGatherEnrichmentResult ¶ added in v1.27.12
type DomainScanGatherEnrichmentResult struct {
// Enrichment is the gathered company profile, compliance, and DNS vendor data
Enrichment domainscan.Enrichment `json:"enrichment"`
}
DomainScanGatherEnrichmentResult carries the gathered enrichment data
type DomainScanImport ¶ added in v1.30.0
type DomainScanImport struct {
// OrganizationID is the organization the created records belong to
OrganizationID string `json:"organizationId"`
// ScanIDs are the Scan records the created records should link back to
ScanIDs []string `json:"scanIds"`
// Platforms are the accepted platforms, if any
Platforms []DomainScanImportPlatform `json:"platforms,omitempty"`
// Systems are the accepted system details
Systems []DomainScanImportSystem `json:"systems,omitempty"`
// Vendors are the accepted vendors
Vendors []DomainScanImportVendor `json:"vendors"`
// Assets are the accepted assets
Assets []DomainScanImportAsset `json:"assets"`
// Findings are the accepted findings
Findings []DomainScanImportFinding `json:"findings,omitempty"`
}
DomainScanImport imports a reviewer-accepted domain scan report into real Platform/SystemDetail/Entity/Asset/Finding records
func (DomainScanImport) Handle ¶ added in v1.30.0
func (d DomainScanImport) Handle() types.OperationHandler
Handle adapts DomainScanImport to the generic operation registration boundary
type DomainScanImportAsset ¶ added in v1.30.0
type DomainScanImportAsset struct {
// Ref is a client-assigned identifier for this asset, referenced by AssetRefs elsewhere in the envelope
Ref string `json:"ref"`
// Name is the asset's display name
Name string `json:"name"`
// Identifier is the asset's domain, IP, or other unique identifier
Identifier string `json:"identifier,omitempty"`
// Website is the asset's URL, if known
Website string `json:"website,omitempty"`
// Categories are the asset's detected categories
Categories []string `json:"categories,omitempty"`
}
DomainScanImportAsset is one asset the reviewer accepted, keyed by a client-assigned Ref so DomainScanImportPlatform/DomainScanImportSystem can reference it before it has a real Asset ID
type DomainScanImportFinding ¶ added in v1.30.0
type DomainScanImportFinding struct {
// Category is the finding's category
Category string `json:"category,omitempty"`
// Description is the finding's description
Description string `json:"description,omitempty"`
// Severity is the finding's severity
Severity string `json:"severity,omitempty"`
// Domain is the domain this finding was raised against, if known
Domain string `json:"domain,omitempty"`
}
DomainScanImportFinding is one accepted finding
type DomainScanImportPlatform ¶ added in v1.30.0
type DomainScanImportPlatform struct {
// Ref is a client-assigned identifier for this platform, referenced by PlatformRefs elsewhere in the envelope
Ref string `json:"ref"`
// Name is the platform's name
Name string `json:"name"`
// Description is the platform's description
Description string `json:"description,omitempty"`
// EntityRefs are the Refs of accepted vendors linked to this platform
EntityRefs []string `json:"entityRefs,omitempty"`
// AssetRefs are the Refs of accepted assets linked to this platform
AssetRefs []string `json:"assetRefs,omitempty"`
}
DomainScanImportPlatform is one accepted platform, linked to a subset of the accepted vendors/assets, and keyed by a client-assigned Ref so DomainScanImportSystem can reference it before it has a real Platform ID
type DomainScanImportSystem ¶ added in v1.30.0
type DomainScanImportSystem struct {
// Name is the system's name
Name string `json:"name"`
// Description is the system's description
Description string `json:"description,omitempty"`
// EntityRefs are the Refs of accepted vendors linked to this system
EntityRefs []string `json:"entityRefs,omitempty"`
// AssetRefs are the Refs of accepted assets linked to this system
AssetRefs []string `json:"assetRefs,omitempty"`
// PlatformRefs are the Refs of accepted platforms this system belongs to
PlatformRefs []string `json:"platformRefs,omitempty"`
}
DomainScanImportSystem is one accepted system detail, linked to its own subset of the accepted vendors/assets/platforms
type DomainScanImportVendor ¶ added in v1.30.0
type DomainScanImportVendor struct {
// Ref is a client-assigned identifier for this vendor, referenced by EntityRefs elsewhere in the envelope
Ref string `json:"ref"`
// Name is the vendor's name
Name string `json:"name"`
// LegalName is the vendor's raw legal entity name, if known and different from Name
LegalName string `json:"legalName,omitempty"`
// Domain is the vendor's domain, if known
Domain string `json:"domain,omitempty"`
// Categories are the vendor's detected categories
Categories []string `json:"categories,omitempty"`
}
DomainScanImportVendor is one vendor the reviewer accepted, keyed by a client-assigned Ref so DomainScanImportPlatform/DomainScanImportSystem can reference it before it has a real Entity ID
type DomainScanPoll ¶ added in v1.27.12
type DomainScanPoll struct {
// ScanResultID is the scan ID returned by DomainScanSubmit
ScanResultID string `json:"scanResultId"`
}
DomainScanPoll retrieves a previously submitted URL Scanner result by scan ID
func (DomainScanPoll) Handle ¶ added in v1.27.12
func (p DomainScanPoll) Handle() types.OperationHandler
Handle adapts domain scan polling to the generic operation registration boundary
func (DomainScanPoll) Run ¶ added in v1.27.12
func (DomainScanPoll) Run(ctx context.Context, client *CloudflareClient, cfg DomainScanPoll) (DomainScanPollResult, error)
Run retrieves a URL Scanner result by scan ID. Cloudflare reports both "not yet indexed" and "still running" through a 400/404, so those are reported back as NotReady rather than an error - the caller's own poll backoff/retry schedule owns waiting for the scan to finish, not this operation
type DomainScanPollEnvelope ¶ added in v1.30.0
type DomainScanPollEnvelope struct {
// OrganizationID is the organization that owns the scan
OrganizationID string `json:"organizationId"`
// ScanResultID is the scan ID returned by Cloudflare's URL Scanner on submission
ScanResultID string `json:"scanResultId"`
// InternalScanID is the id of the Scan record created when the scan was submitted;
// the poll cycle updates this same record rather than creating a new one on completion
InternalScanID string `json:"internalScanId"`
// Attempt is the number of poll cycles already attempted for this scan
Attempt int `json:"attempt"`
// SiblingScanIDs lists every internal Scan ID submitted together with this one
// so the last one to finish can gather and combine every sibling's report into a single notification
SiblingScanIDs []string `json:"siblingScanIds"`
}
DomainScanPollEnvelope carries one submitted scan through poll cycles until it's ready or the attempt budget is exhausted. This stays on raw Gala pub/sub rather than a Dispatch-able Operation because the poll cycle self-reschedules via Gala's ScheduledAt header, which Dispatch has no equivalent for
type DomainScanPollHandler ¶ added in v1.30.0
type DomainScanPollHandler func(context.Context, DomainScanPollEnvelope) (done bool, err error)
DomainScanPollHandler processes one poll cycle for a submitted scan. It returns done=true once the scan has been fully processed (succeeded or given up), and done=false when the cycle re-emitted itself for another attempt
type DomainScanPollResult ¶ added in v1.27.12
type DomainScanPollResult struct {
// Result is the raw URL Scanner result payload
Result *url_scanner.ScanGetResponse `json:"result"`
// TaskErrors lists task-level errors reported alongside the result, if any
TaskErrors ScanTaskErrors `json:"taskErrors,omitempty"`
// NotReady is true when Cloudflare reported the scan isn't available yet (either not yet
// indexed, or still running) rather than a genuine fetch failure. The caller's own poll
// backoff/retry schedule is responsible for trying again, not this operation
NotReady bool `json:"notReady,omitempty"`
}
DomainScanPollResult carries the raw URL Scanner result plus any task-level errors
type DomainScanRequest ¶ added in v1.30.0
type DomainScanRequest struct {
// OrganizationID is the organization the scan belongs to, only used when dispatched without an Integration
// customer-facing calls always derive the organization from their resolved Integration instead, ignoring this field
OrganizationID string `json:"organizationId,omitempty"`
// Domain is the domain to scan
Domain string `json:"domain" jsonschema:"required,title=Domain,description=Domain to scan"`
// ForceRefresh bypasses Cloudflare's Browser Rendering cache, forcing a fresh render
// instead of reusing one from a previous scan of the same domain
ForceRefresh bool `json:"forceRefresh,omitempty" jsonschema:"title=Force Refresh,description=Bypass the render cache and force a fresh scan"`
// GroupID links this scan to sibling scans requested together so they can be recombined into a
// single notification once the whole group finishes
GroupID string `json:"groupId,omitempty"`
}
DomainScanRequest queues a domain scan for a single domain by creating a pending Scan record which is then picked up to do the domain scan
func (DomainScanRequest) Handle ¶ added in v1.30.0
func (d DomainScanRequest) Handle() types.OperationHandler
Handle adapts DomainScanRequest to the generic operation registration boundary
type DomainScanRequestResult ¶ added in v1.30.0
type DomainScanRequestResult struct {
// Message describes what happened
Message string `json:"message"`
// ScanID is the id of the Scan record for this request
ScanID string `json:"scanId"`
}
DomainScanRequestResult acknowledges that a domain scan was queued or run
type DomainScanSubmit ¶ added in v1.27.12
type DomainScanSubmit struct {
// Domains is the list of domains to submit for scanning
Domains []string `json:"domains"`
}
DomainScanSubmit submits domains to Cloudflare's URL Scanner for scanning
func (DomainScanSubmit) Handle ¶ added in v1.27.12
func (s DomainScanSubmit) Handle() types.OperationHandler
Handle adapts domain scan submission to the generic operation registration boundary
func (DomainScanSubmit) Run ¶ added in v1.27.12
func (DomainScanSubmit) Run(ctx context.Context, client *CloudflareClient, cfg DomainScanSubmit) (DomainScanSubmitResult, error)
Run submits the domains to Cloudflare's URL Scanner, with a max of 10 domains in any scan request Cloudflare bulk scan allows up to 100 in a single request, so we do not need to batch these request
type DomainScanSubmitResult ¶ added in v1.27.12
type DomainScanSubmitResult struct {
// Scans is the list of scan tasks created by Cloudflare's URL Scanner
Scans []url_scanner.ScanBulkNewResponse `json:"scans"`
}
DomainScanSubmitResult is the set of scan tasks created by a submission
type FindingsCollect ¶ added in v1.21.7
type FindingsCollect struct{}
FindingsCollect collects Cloudflare Security Center insights for ingest as findings
func (FindingsCollect) IngestHandle ¶ added in v1.21.7
func (f FindingsCollect) IngestHandle() types.IngestHandler
IngestHandle adapts findings collection to the ingest operation registration boundary
func (FindingsCollect) Run ¶ added in v1.21.7
func (FindingsCollect) Run(ctx context.Context, credentials types.CredentialBindings, client *CloudflareClient, lastRunAt *time.Time) ([]types.IngestPayloadSet, error)
Run collects Cloudflare Security Center insights and emits finding ingest payloads
type FindingsSync ¶ added in v1.21.7
type FindingsSync struct {
// Disable is used to disable the findings sync operation from Cloudflare
Disable bool `` /* 136-byte string literal not displayed */
// FilterExpr limits imported records to envelopes matching the CEL expression
FilterExpr string `` /* 185-byte string literal not displayed */
}
FindingsSync holds installation-specific configuration for Cloudflare Security Center insights
type HealthCheck ¶
type HealthCheck struct {
// Status is the token verification status returned by Cloudflare
Status string `json:"status,omitempty"`
// ExpiresOn is the token expiry time if set
ExpiresOn string `json:"expiresOn,omitempty"`
}
HealthCheck holds the result of a Cloudflare health check
func (HealthCheck) Handle ¶
func (h HealthCheck) Handle() types.OperationHandler
Handle adapts the health check to the generic operation registration boundary
func (HealthCheck) Run ¶
func (HealthCheck) Run(ctx context.Context, credentials types.CredentialBindings, c *CloudflareClient) (json.RawMessage, error)
Run executes the Cloudflare token verification
type InstallationMetadata ¶
type InstallationMetadata struct {
// AccountID is the Cloudflare account identifier used for account-scoped collection
AccountID string `json:"accountId,omitempty" jsonschema:"title=Account ID"`
}
InstallationMetadata holds the stable Cloudflare account identity for one installation
func (InstallationMetadata) InstallationIdentity ¶
func (m InstallationMetadata) InstallationIdentity() types.IntegrationInstallationIdentity
InstallationIdentity implements types.InstallationIdentifiable
type RuntimeConfig ¶ added in v1.27.12
type RuntimeConfig struct {
// APIToken is the Cloudflare API token for the operator-owned account
APIToken string `` /* 126-byte string literal not displayed */
// AccountID is the Cloudflare account identifier for the operator-owned account
AccountID string `json:"accountid" koanf:"accountid" jsonschema:"description=Cloudflare account ID for the operator-owned account"`
// DomainScan configures vendor/technology classification and enrichment behavior for
// onboarding domain scan reports
DomainScan domainscan.ReportConfig `` /* 153-byte string literal not displayed */
}
RuntimeConfig is the runtime-provisioned configuration for the operator-owned Cloudflare account. Sourced from koanf/environment at startup; used for system-initiated Cloudflare calls (e.g. onboarding domain scans) that are not tied to a customer installation
func (RuntimeConfig) Provisioned ¶ added in v1.27.12
func (c RuntimeConfig) Provisioned() bool
Provisioned reports whether the runtime config has the minimum required fields to make Cloudflare API calls
type ScanTaskError ¶ added in v1.27.12
type ScanTaskError struct {
Name string `json:"name"`
Message string `json:"message"`
Detail string `json:"detail"`
Code int `json:"code"`
}
ScanTaskError is a single error reported in a URL Scanner task's error list
func (ScanTaskError) Error ¶ added in v1.27.12
func (e ScanTaskError) Error() string
Error returns a human-readable representation of the scan task error
type ScanTaskErrors ¶ added in v1.27.12
type ScanTaskErrors []ScanTaskError
ScanTaskErrors is a list of ScanTaskError, satisfying the error interface when non-empty
func (ScanTaskErrors) Error ¶ added in v1.27.12
func (e ScanTaskErrors) Error() string
Error joins every task error's message with "; "
type UserInput ¶
type UserInput struct {
// DirectorySync includes the configuration for identity accounts from Cloudflare members
DirectorySync DirectorySync `json:"directorySync,omitempty" jsonschema:"title=Directory Account Sync"`
// AssetSync includes the configuration for Cloudflare domains as assets
AssetSync AssetSync `json:"assetSync,omitempty" jsonschema:"title=Cloudflare Asset Sync"`
// FindingsSync includes the configuration for findings from Cloudflare Security Center insights
FindingsSync FindingsSync `json:"findingSync,omitempty" jsonschema:"title=Security Insights Sync"`
}
UserInput holds installation-specific configuration collected from the user
Source Files
¶
- builder.go
- client.go
- doc.go
- domain_scan_import.go
- domain_scan_listeners.go
- domain_scan_poll.go
- errors.go
- installation.go
- mappings.go
- operation_asset_sync.go
- operation_directory_sync.go
- operation_domain_scan_enrich.go
- operation_domain_scan_gather_enrichment.go
- operation_domain_scan_import.go
- operation_domain_scan_poll.go
- operation_domain_scan_request.go
- operation_domain_scan_submit.go
- operation_findings.go
- operation_health.go
- types.go