UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

259 lines • 9.47 kB
import { APIResource } from "../../../core/resource.js"; import { APIPromise } from "../../../core/api-promise.js"; import { RequestOptions } from "../../../internal/request-options.js"; export declare class BaseReports extends APIResource { static readonly _key: readonly ['managedDefense', 'vulnerabilityDiscovery', 'reports']; /** * Gets the repository projection of the active operator-reviewed scan report. * `scan_id` is the customer scan's stable request ID. * * @example * ```ts * const report = * await client.managedDefense.vulnerabilityDiscovery.reports.get( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * repo_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * }, * ); * ``` */ get(scanID: string, params: ReportGetParams, options?: RequestOptions): APIPromise<ReportGetResponse>; } export declare class Reports extends BaseReports { } export interface ReportGetResponse { publication: ReportGetResponse.Publication; report: ReportGetResponse.Report; repository_id: string; scan_id: string; } export declare namespace ReportGetResponse { interface Publication { published_at: string; revision_id: string; version: number; } interface Report { findings: Array<Report.Finding>; overall_severity: 'critical' | 'high' | 'medium' | 'low' | 'info'; repository_id: string; repository_name: string; summary: string; traffic_context: Report.TrafficContext; external_links?: Array<Report.ExternalLink>; limitations?: Array<string>; } namespace Report { interface Finding { id: string; conditions: Array<string>; cwe: string; impact: string; location: Finding.Location; reachability: Array<Finding.Reachability>; remediation: Finding.Remediation; root_cause: string; severity: 'critical' | 'high' | 'medium' | 'low' | 'info'; severity_basis: string; summary: string; telemetry: Finding.Telemetry; title: string; trace: Array<Finding.Trace>; waf_rules: Finding.WAFRules | null; /** * Least-privileged position required to trigger the finding. Optional on legacy * report revisions. */ attacker_position?: 'external' | 'authenticated' | 'internal' | 'post_compromise' | null; external_links?: Array<Finding.ExternalLink>; /** * One bounded unresolved proof question. Optional on legacy report revisions. */ open_question?: string | null; /** * Method used or needed to close the proof. Optional on legacy report revisions. */ proof_method?: 'structural' | 'experimental' | 'acquired_source' | 'public_knowledge' | 'team_question' | null; /** * Current proof lifecycle state. Optional on legacy report revisions. */ proof_state?: 'closed' | 'pending_source' | 'pending_public' | 'pending_experiment' | 'pending_team' | null; } namespace Finding { interface Location { file: string; line: number; route: string | null; } interface Reachability { consumer: string; reachable: boolean; via: string; } interface Remediation { code_changes: string | null; strategy: string; } interface Telemetry { references: Array<string>; state: 'no_route' | 'no_telemetry' | 'no_match' | 'matched'; } interface Trace { line: number; path: string; scope: string; why: string; } interface WAFRules { broad: WAFRules.Broad | null; targeted: WAFRules.Targeted | null; } namespace WAFRules { interface Broad { action: 'block' | 'managed_challenge' | 'js_challenge' | 'log'; confidence: 'low' | 'medium' | 'high'; description: string; expression: string; false_positive_risk: string; name: string; rationale: string; } interface Targeted { action: 'block' | 'managed_challenge' | 'js_challenge' | 'log'; confidence: 'low' | 'medium' | 'high'; description: string; expression: string; false_positive_risk: string; name: string; rationale: string; } } interface ExternalLink { title: string; url: string; } } interface TrafficContext { http: TrafficContext.HTTP | null; target: TrafficContext.Target | null; waf: TrafficContext.WAF | null; web_assets: TrafficContext.WebAssets | null; } namespace TrafficContext { interface HTTP { error_paths: Array<HTTP.ErrorPath>; hot_paths: Array<HTTP.HotPath>; request_volume: number; } namespace HTTP { interface ErrorPath { id: string; hits: number; host: string; path: string; status: number; } interface HotPath { id: string; hits: number; host: string; path: string; top_status: number; } } interface Target { hosts: Array<string>; kind: 'worker' | 'origin'; /** * UTC ISO-8601 interval. Start is inclusive, end is exclusive, and the interval * must be positive and at most seven days. */ telemetry_window?: Target.TelemetryWindow; } namespace Target { /** * UTC ISO-8601 interval. Start is inclusive, end is exclusive, and the interval * must be positive and at most seven days. */ interface TelemetryWindow { end: string; start: string; } } interface WAF { hit_volume: number; rules: Array<WAF.Rule>; } namespace WAF { interface Rule { id: string; hit_volume: number; paths: Array<Rule.Path>; rule_id: string; rule_version: number | null; } namespace Rule { interface Path { id: string; hit_volume: number; host: string; path: string; } } } interface WebAssets { operations: Array<WebAssets.Operation>; paths: Array<WebAssets.Path>; risk_types: Array<WebAssets.RiskType>; } namespace WebAssets { interface Operation { id: string; endpoint: string; host: string; method: string; risk_labels: Array<Operation.RiskLabel>; performance?: Operation.Performance; } namespace Operation { interface RiskLabel { description: string | null; name: string; } interface Performance { avg_origin_latency_ms: number | null; error_rate: number; estimated_requests: number; } } interface Path { id: string; avg_origin_latency_ms: number | null; error_rate: number; estimated_requests: number; host: string; path: string; } interface RiskType { description: string | null; name: string; operation_count: number; } } } interface ExternalLink { title: string; url: string; } } } export interface ReportGetParams { account_id: string; repo_id: string; } export declare namespace Reports { export { type ReportGetResponse as ReportGetResponse, type ReportGetParams as ReportGetParams }; } //# sourceMappingURL=reports.d.ts.map