Skip to content
Start here

Get layer 3 attacks by protocol summary

client.Radar.Attacks.Layer3.Summary.Protocol(ctx, query) (*AttackLayer3SummaryProtocolResponse, error)
GET/radar/attacks/layer3/summary/protocol

Retrieves the distribution of layer 3 attacks by protocol.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
User Details WriteUser Details Read
ParametersExpand Collapse
query AttackLayer3SummaryProtocolParams
Continent param.Field[[]string]Optional

Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with - to exclude continents from results. For example, -EU,NA excludes results from EU, but includes results from NA.

DateEnd param.Field[[]Time]Optional

End of the date range (inclusive).

DateRange param.Field[[]string]Optional

Filters results by date range. For example, use 7d and 7dcontrol to compare this week with the previous week. Use this parameter or set specific start and end dates (dateStart and dateEnd parameters).

DateStart param.Field[[]Time]Optional

Start of the date range.

Direction param.Field[AttackLayer3SummaryProtocolParamsDirection]Optional

Specifies whether the location filter applies to the source or target location.

const AttackLayer3SummaryProtocolParamsDirectionOrigin AttackLayer3SummaryProtocolParamsDirection = "ORIGIN"
const AttackLayer3SummaryProtocolParamsDirectionTarget AttackLayer3SummaryProtocolParamsDirection = "TARGET"
Format param.Field[AttackLayer3SummaryProtocolParamsFormat]Optional

Format in which results will be returned.

const AttackLayer3SummaryProtocolParamsFormatJson AttackLayer3SummaryProtocolParamsFormat = "JSON"
const AttackLayer3SummaryProtocolParamsFormatCsv AttackLayer3SummaryProtocolParamsFormat = "CSV"
IPVersion param.Field[[]AttackLayer3SummaryProtocolParamsIPVersion]Optional

Filters results by IP version (Ipv4 vs. IPv6).

const AttackLayer3SummaryProtocolParamsIPVersionIPv4 AttackLayer3SummaryProtocolParamsIPVersion = "IPv4"
const AttackLayer3SummaryProtocolParamsIPVersionIPv6 AttackLayer3SummaryProtocolParamsIPVersion = "IPv6"
Location param.Field[[]string]Optional

Filters results by location. Specify a comma-separated list of alpha-2 codes. Prefix with - to exclude locations from results. For example, -US,PT excludes results from the US, but includes results from PT.

Name param.Field[[]string]Optional

Array of names used to label the series in the response.

ReturnsExpand Collapse
type AttackLayer3SummaryProtocolResponse struct{…}
Meta AttackLayer3SummaryProtocolResponseMeta

Metadata for the results.

ConfidenceInfo AttackLayer3SummaryProtocolResponseMetaConfidenceInfo
Annotations []AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotation
DataSource AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceAll AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceAIBots AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceBGP AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceBots AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceCT AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceDNS AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceDos AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceFw AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceFwPg AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceHTTP AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceIQI AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceNet AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceSpeed AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsEventTypeEvent AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsEventTypeGeneral AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsEventTypeOutage AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsEventTypePipeline AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly AttackLayer3SummaryProtocolResponseMetaConfidenceInfoAnnotationsEventType = "TRAFFIC_ANOMALY"
IsInstantaneous bool

Whether event is a single point in time or a time range.

LinkedURL string
formaturi
StartDate Time
formatdate-time
Tags []stringOptional
Level int64

Provides an indication of how much confidence Cloudflare has in the data.

DateRange []AttackLayer3SummaryProtocolResponseMetaDateRange
EndTime Time

Adjusted end of date range.

formatdate-time
StartTime Time

Adjusted start of date range.

formatdate-time
LastUpdated Time

Timestamp of the last dataset update.

formatdate-time
Normalization AttackLayer3SummaryProtocolResponseMetaNormalization

Normalization method applied to the results. Refer to Normalization methods.

One of the following:
const AttackLayer3SummaryProtocolResponseMetaNormalizationPercentage AttackLayer3SummaryProtocolResponseMetaNormalization = "PERCENTAGE"
const AttackLayer3SummaryProtocolResponseMetaNormalizationMin0Max AttackLayer3SummaryProtocolResponseMetaNormalization = "MIN0_MAX"
const AttackLayer3SummaryProtocolResponseMetaNormalizationMinMax AttackLayer3SummaryProtocolResponseMetaNormalization = "MIN_MAX"
const AttackLayer3SummaryProtocolResponseMetaNormalizationRawValues AttackLayer3SummaryProtocolResponseMetaNormalization = "RAW_VALUES"
const AttackLayer3SummaryProtocolResponseMetaNormalizationPercentageChange AttackLayer3SummaryProtocolResponseMetaNormalization = "PERCENTAGE_CHANGE"
const AttackLayer3SummaryProtocolResponseMetaNormalizationRollingAverage AttackLayer3SummaryProtocolResponseMetaNormalization = "ROLLING_AVERAGE"
const AttackLayer3SummaryProtocolResponseMetaNormalizationOverlappedPercentage AttackLayer3SummaryProtocolResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const AttackLayer3SummaryProtocolResponseMetaNormalizationRatio AttackLayer3SummaryProtocolResponseMetaNormalization = "RATIO"
Units []AttackLayer3SummaryProtocolResponseMetaUnit

Measurement units for the results.

Name string
Value string
Summary0 AttackLayer3SummaryProtocolResponseSummary0
GRE string

A numeric string.

Icmp string

A numeric string.

TCP string

A numeric string.

Udp string

A numeric string.

Get layer 3 attacks by protocol summary

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/radar"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.Radar.Attacks.Layer3.Summary.Protocol(context.TODO(), radar.AttackLayer3SummaryProtocolParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Meta)
}
{
  "result": {
    "meta": {
      "confidenceInfo": {
        "annotations": [
          {
            "dataSource": "ALL",
            "description": "Cable cut in Tonga",
            "endDate": "2019-12-27T18:11:19.117Z",
            "eventType": "EVENT",
            "isInstantaneous": true,
            "linkedUrl": "https://example.com",
            "startDate": "2019-12-27T18:11:19.117Z",
            "tags": [
              "BOT_CLASS"
            ]
          }
        ],
        "level": 0
      },
      "dateRange": [
        {
          "endTime": "2022-09-17T10:22:57.555Z",
          "startTime": "2022-09-16T10:22:57.555Z"
        }
      ],
      "lastUpdated": "2019-12-27T18:11:19.117Z",
      "normalization": "PERCENTAGE",
      "units": [
        {
          "name": "*",
          "value": "requests"
        }
      ]
    },
    "summary_0": {
      "GRE": "10",
      "ICMP": "10",
      "TCP": "10",
      "UDP": "10"
    }
  },
  "success": true
}
Returns Examples
{
  "result": {
    "meta": {
      "confidenceInfo": {
        "annotations": [
          {
            "dataSource": "ALL",
            "description": "Cable cut in Tonga",
            "endDate": "2019-12-27T18:11:19.117Z",
            "eventType": "EVENT",
            "isInstantaneous": true,
            "linkedUrl": "https://example.com",
            "startDate": "2019-12-27T18:11:19.117Z",
            "tags": [
              "BOT_CLASS"
            ]
          }
        ],
        "level": 0
      },
      "dateRange": [
        {
          "endTime": "2022-09-17T10:22:57.555Z",
          "startTime": "2022-09-16T10:22:57.555Z"
        }
      ],
      "lastUpdated": "2019-12-27T18:11:19.117Z",
      "normalization": "PERCENTAGE",
      "units": [
        {
          "name": "*",
          "value": "requests"
        }
      ]
    },
    "summary_0": {
      "GRE": "10",
      "ICMP": "10",
      "TCP": "10",
      "UDP": "10"
    }
  },
  "success": true
}