Skip to content
Start here

Retrieves Security Center Insights

client.SecurityCenter.Insights.List(ctx, params) (*V4PagePagination[InsightListResponse], error)
GET/{accounts_or_zones}/{account_or_zone_id}/security-center/insights

Lists all Security Center insights for the account or zone, showing security findings and recommendations.

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
ParametersExpand Collapse
params InsightListParams
AccountID param.Field[string]optional

Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.

ZoneID param.Field[string]optional

Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.

Dismissed param.Field[bool]optional

Query param

IssueClass param.Field[[]string]optional

Query param

IssueClassNeq param.Field[[]string]optional

Query param

IssueType param.Field[[]IssueType]optional

Query param

const IssueTypeComplianceViolation IssueType = "compliance_violation"
const IssueTypeEmailSecurity IssueType = "email_security"
const IssueTypeExposedInfrastructure IssueType = "exposed_infrastructure"
const IssueTypeInsecureConfiguration IssueType = "insecure_configuration"
const IssueTypeWeakAuthentication IssueType = "weak_authentication"
const IssueTypeConfigurationSuggestion IssueType = "configuration_suggestion"
IssueTypeNeq param.Field[[]IssueType]optional

Query param

const IssueTypeComplianceViolation IssueType = "compliance_violation"
const IssueTypeEmailSecurity IssueType = "email_security"
const IssueTypeExposedInfrastructure IssueType = "exposed_infrastructure"
const IssueTypeInsecureConfiguration IssueType = "insecure_configuration"
const IssueTypeWeakAuthentication IssueType = "weak_authentication"
const IssueTypeConfigurationSuggestion IssueType = "configuration_suggestion"
Page param.Field[int64]optional

Query param: Specifies the current page within paginated list of results.

PerPage param.Field[int64]optional

Query param: Sets the number of results per page of results.

maximum1000
minimum1
Product param.Field[[]string]optional

Query param

ProductNeq param.Field[[]string]optional

Query param

Severity param.Field[[]SeverityQueryParam]optional

Query param

const SeverityQueryParamLow SeverityQueryParam = "low"
const SeverityQueryParamModerate SeverityQueryParam = "moderate"
const SeverityQueryParamCritical SeverityQueryParam = "critical"
SeverityNeq param.Field[[]SeverityQueryParam]optional

Query param

const SeverityQueryParamLow SeverityQueryParam = "low"
const SeverityQueryParamModerate SeverityQueryParam = "moderate"
const SeverityQueryParamCritical SeverityQueryParam = "critical"
Subject param.Field[[]string]optional

Query param

SubjectNeq param.Field[[]string]optional

Query param

ReturnsExpand Collapse
type InsightListResponse struct{…}
Count int64optional

Indicates the total number of results.

Issues []InsightListResponseIssueoptional
ID stringoptional
Dismissed booloptional
IssueClass stringoptional
IssueType IssueTypeoptional
One of the following:
const IssueTypeComplianceViolation IssueType = "compliance_violation"
const IssueTypeEmailSecurity IssueType = "email_security"
const IssueTypeExposedInfrastructure IssueType = "exposed_infrastructure"
const IssueTypeInsecureConfiguration IssueType = "insecure_configuration"
const IssueTypeWeakAuthentication IssueType = "weak_authentication"
const IssueTypeConfigurationSuggestion IssueType = "configuration_suggestion"
Payload InsightListResponseIssuesPayloadoptional
DetectionMethod stringoptional

Describes the method used to detect insight.

ZoneTag stringoptional
ResolveText stringoptional
Severity InsightListResponseIssuesSeverityoptional
One of the following:
const InsightListResponseIssuesSeverityLow InsightListResponseIssuesSeverity = "Low"
const InsightListResponseIssuesSeverityModerate InsightListResponseIssuesSeverity = "Moderate"
const InsightListResponseIssuesSeverityCritical InsightListResponseIssuesSeverity = "Critical"
Since Timeoptional
formatdate-time
Subject stringoptional
Timestamp Timeoptional
formatdate-time
Page int64optional

Specifies the current page within paginated list of results.

PerPage int64optional

Sets the number of results per page of results.

maximum1000
minimum1

Retrieves Security Center Insights

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/security_center"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.SecurityCenter.Insights.List(context.TODO(), security_center.InsightListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "count": 1,
    "issues": [
      {
        "id": "id",
        "dismissed": false,
        "issue_class": "always_use_https_not_enabled",
        "issue_type": "compliance_violation",
        "payload": {
          "detection_method": "We detected security rules referencing multiple IP addresses directly in the rules.",
          "zone_tag": "zone_tag"
        },
        "resolve_link": "resolve_link",
        "resolve_text": "resolve_text",
        "severity": "Low",
        "since": "2019-12-27T18:11:19.117Z",
        "subject": "example.com",
        "timestamp": "2019-12-27T18:11:19.117Z"
      }
    ],
    "page": 1,
    "per_page": 25
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "count": 1,
    "issues": [
      {
        "id": "id",
        "dismissed": false,
        "issue_class": "always_use_https_not_enabled",
        "issue_type": "compliance_violation",
        "payload": {
          "detection_method": "We detected security rules referencing multiple IP addresses directly in the rules.",
          "zone_tag": "zone_tag"
        },
        "resolve_link": "resolve_link",
        "resolve_text": "resolve_text",
        "severity": "Low",
        "since": "2019-12-27T18:11:19.117Z",
        "subject": "example.com",
        "timestamp": "2019-12-27T18:11:19.117Z"
      }
    ],
    "page": 1,
    "per_page": 25
  }
}