# Security Center # Insights ## Retrieves Security Center Insights `client.securityCenter.insights.list(InsightListParamsparams?, RequestOptionsoptions?): V4PagePagination` **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. ### Parameters - `params: InsightListParams` - `account_id?: string` Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. - `zone_id?: string` Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - `dismissed?: boolean` Query param - `issue_class?: Array` Query param - `issueClassNeq?: Array` Query param - `issue_type?: Array` Query param - `"compliance_violation"` - `"email_security"` - `"exposed_infrastructure"` - `"insecure_configuration"` - `"weak_authentication"` - `"configuration_suggestion"` - `issueTypeNeq?: Array` Query param - `"compliance_violation"` - `"email_security"` - `"exposed_infrastructure"` - `"insecure_configuration"` - `"weak_authentication"` - `"configuration_suggestion"` - `page?: number` Query param: Specifies the current page within paginated list of results. - `per_page?: number` Query param: Sets the number of results per page of results. - `product?: Array` Query param - `productNeq?: Array` Query param - `severity?: Array` Query param - `"low"` - `"moderate"` - `"critical"` - `severityNeq?: Array` Query param - `"low"` - `"moderate"` - `"critical"` - `subject?: Array` Query param - `subjectNeq?: Array` Query param ### Returns - `InsightListResponse` - `count?: number` Indicates the total number of results. - `issues?: Array` - `id?: string` - `dismissed?: boolean` - `issue_class?: string` - `issue_type?: IssueType` - `"compliance_violation"` - `"email_security"` - `"exposed_infrastructure"` - `"insecure_configuration"` - `"weak_authentication"` - `"configuration_suggestion"` - `payload?: Payload` - `detection_method?: string` Describes the method used to detect insight. - `zone_tag?: string` - `resolve_link?: string` - `resolve_text?: string` - `severity?: "Low" | "Moderate" | "Critical"` - `"Low"` - `"Moderate"` - `"Critical"` - `since?: string` - `subject?: string` - `timestamp?: string` - `page?: number` Specifies the current page within paginated list of results. - `per_page?: number` Sets the number of results per page of results. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const insightListResponse of client.securityCenter.insights.list({ account_id: 'account_id', })) { console.log(insightListResponse.count); } ``` #### Response ```json { "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 } } ``` ## Archives Security Center Insight `client.securityCenter.insights.dismiss(stringissueId, InsightDismissParamsparams, RequestOptionsoptions?): InsightDismissResponse` **put** `/{accounts_or_zones}/{account_or_zone_id}/security-center/insights/{issue_id}/dismiss` Archives a Security Center insight for an account or zone, removing it from the active insights list while preserving historical data. ### Parameters - `issueId: string` - `params: InsightDismissParams` - `account_id?: string` Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. - `zone_id?: string` Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - `dismiss?: boolean` Body param ### Returns - `InsightDismissResponse` - `errors: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `messages: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `success: true` Whether the API call was successful. - `true` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.securityCenter.insights.dismiss('issue_id', { account_id: 'account_id', }); console.log(response.errors); ``` #### Response ```json { "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 } ``` ## Domain Types ### Insight List Response - `InsightListResponse` - `count?: number` Indicates the total number of results. - `issues?: Array` - `id?: string` - `dismissed?: boolean` - `issue_class?: string` - `issue_type?: IssueType` - `"compliance_violation"` - `"email_security"` - `"exposed_infrastructure"` - `"insecure_configuration"` - `"weak_authentication"` - `"configuration_suggestion"` - `payload?: Payload` - `detection_method?: string` Describes the method used to detect insight. - `zone_tag?: string` - `resolve_link?: string` - `resolve_text?: string` - `severity?: "Low" | "Moderate" | "Critical"` - `"Low"` - `"Moderate"` - `"Critical"` - `since?: string` - `subject?: string` - `timestamp?: string` - `page?: number` Specifies the current page within paginated list of results. - `per_page?: number` Sets the number of results per page of results. ### Insight Dismiss Response - `InsightDismissResponse` - `errors: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `messages: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `success: true` Whether the API call was successful. - `true` # Class ## Retrieves Security Center Insight Counts by Class `client.securityCenter.insights.class.get(ClassGetParamsparams?, RequestOptionsoptions?): ClassGetResponse` **get** `/{accounts_or_zones}/{account_or_zone_id}/security-center/insights/class` Retrieves Security Center insight counts aggregated by classification class. ### Parameters - `params: ClassGetParams` - `account_id?: string` Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. - `zone_id?: string` Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - `dismissed?: boolean` Query param - `issue_class?: Array` Query param - `issueClassNeq?: Array` Query param - `issue_type?: Array` Query param - `"compliance_violation"` - `"email_security"` - `"exposed_infrastructure"` - `"insecure_configuration"` - `"weak_authentication"` - `"configuration_suggestion"` - `issueTypeNeq?: Array` Query param - `"compliance_violation"` - `"email_security"` - `"exposed_infrastructure"` - `"insecure_configuration"` - `"weak_authentication"` - `"configuration_suggestion"` - `product?: Array` Query param - `productNeq?: Array` Query param - `severity?: Array` Query param - `"low"` - `"moderate"` - `"critical"` - `severityNeq?: Array` Query param - `"low"` - `"moderate"` - `"critical"` - `subject?: Array` Query param - `subjectNeq?: Array` Query param ### Returns - `ClassGetResponse = Array` - `count?: number` - `value?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const classes = await client.securityCenter.insights.class.get({ account_id: 'account_id' }); console.log(classes); ``` #### Response ```json { "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, "value": "value" } ] } ``` ## Domain Types ### Class Get Response - `ClassGetResponse = Array` - `count?: number` - `value?: string` # Severity ## Retrieves Security Center Insight Counts by Severity `client.securityCenter.insights.severity.get(SeverityGetParamsparams?, RequestOptionsoptions?): SeverityGetResponse` **get** `/{accounts_or_zones}/{account_or_zone_id}/security-center/insights/severity` Retrieves Security Center insight counts aggregated by severity level (critical, high, medium, low). ### Parameters - `params: SeverityGetParams` - `account_id?: string` Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. - `zone_id?: string` Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - `dismissed?: boolean` Query param - `issue_class?: Array` Query param - `issueClassNeq?: Array` Query param - `issue_type?: Array` Query param - `"compliance_violation"` - `"email_security"` - `"exposed_infrastructure"` - `"insecure_configuration"` - `"weak_authentication"` - `"configuration_suggestion"` - `issueTypeNeq?: Array` Query param - `"compliance_violation"` - `"email_security"` - `"exposed_infrastructure"` - `"insecure_configuration"` - `"weak_authentication"` - `"configuration_suggestion"` - `product?: Array` Query param - `productNeq?: Array` Query param - `severity?: Array` Query param - `"low"` - `"moderate"` - `"critical"` - `severityNeq?: Array` Query param - `"low"` - `"moderate"` - `"critical"` - `subject?: Array` Query param - `subjectNeq?: Array` Query param ### Returns - `SeverityGetResponse = Array` - `count?: number` - `value?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const severities = await client.securityCenter.insights.severity.get({ account_id: 'account_id' }); console.log(severities); ``` #### Response ```json { "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, "value": "value" } ] } ``` ## Domain Types ### Severity Get Response - `SeverityGetResponse = Array` - `count?: number` - `value?: string` # Type ## Retrieves Security Center Insight Counts by Type `client.securityCenter.insights.type.get(TypeGetParamsparams?, RequestOptionsoptions?): TypeGetResponse` **get** `/{accounts_or_zones}/{account_or_zone_id}/security-center/insights/type` Retrieves Security Center insight counts aggregated by insight type. ### Parameters - `params: TypeGetParams` - `account_id?: string` Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. - `zone_id?: string` Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - `dismissed?: boolean` Query param - `issue_class?: Array` Query param - `issueClassNeq?: Array` Query param - `issue_type?: Array` Query param - `"compliance_violation"` - `"email_security"` - `"exposed_infrastructure"` - `"insecure_configuration"` - `"weak_authentication"` - `"configuration_suggestion"` - `issueTypeNeq?: Array` Query param - `"compliance_violation"` - `"email_security"` - `"exposed_infrastructure"` - `"insecure_configuration"` - `"weak_authentication"` - `"configuration_suggestion"` - `product?: Array` Query param - `productNeq?: Array` Query param - `severity?: Array` Query param - `"low"` - `"moderate"` - `"critical"` - `severityNeq?: Array` Query param - `"low"` - `"moderate"` - `"critical"` - `subject?: Array` Query param - `subjectNeq?: Array` Query param ### Returns - `TypeGetResponse = Array` - `count?: number` - `value?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const types = await client.securityCenter.insights.type.get({ account_id: 'account_id' }); console.log(types); ``` #### Response ```json { "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, "value": "value" } ] } ``` ## Domain Types ### Type Get Response - `TypeGetResponse = Array` - `count?: number` - `value?: string`