Mã mẫu cho Chrome Management Security Insights API

Hãy xem Chrome Management Security Insights API để biết thông tin về các tính năng của API.

Tất cả các yêu cầu dưới đây đều sử dụng các biến sau:

  • $TOKEN – Mã thông báo OAuth 2
  • $CUSTOMER – Mã nhận dạng của khách hàng hoặc giá trị cố định my_customer

Kiểm tra trạng thái bật thông tin chi tiết cho miền của bạn

Để kiểm tra trạng thái bật thông tin chi tiết cho miền của bạn, hãy sử dụng phương thức checkEnablementStatus.

Yêu cầu

  curl -X GET \
  -H "Authorization: Bearer $TOKEN" \
  "https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/enterprise/securityInsights:checkEnablementStatus"

Phản hồi

{
  "insightsState": "INSIGHTS_ENABLED"
}

Bật thông tin chi tiết cho miền của bạn

Để bật thông tin chi tiết cho miền của bạn, hãy sử dụng phương thức enable. Bạn có thể tuỳ ý định cấu hình Chrome Enterprise Connectors cho một nhóm đơn vị tổ chức cụ thể bằng cách cung cấp targetOus. Nếu bạn không đặt targetOus, thì các trình kết nối Chrome sẽ được định cấu hình tại OU gốc.

Yêu cầu

  curl -X POST \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "targetOus": [
      "/corp/sales",
      "/eng"
    ]
  }' \
  "https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/enterprise/securityInsights:enable"

Phản hồi

{
  "insightsState": "INSIGHTS_ENABLED"
}

Tắt thông tin chi tiết cho miền của bạn

Để tắt thông tin chi tiết cho miền của bạn, hãy sử dụng phương thức disable.

Yêu cầu

  curl -X POST \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}' \
  "https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/enterprise/securityInsights:disable"

Phản hồi

{
  "insightsState": "INSIGHTS_DISABLED"
}

Truy vấn thông tin tóm tắt cấp cao về việc chuyển nội dung cho miền của bạn

Để truy xuất thông tin tóm tắt tổng quan về các lượt chuyển nội dung, hãy sử dụng phương thức queryContentTransfers.

Yêu cầu

  curl -G \
  -H "Authorization: Bearer $TOKEN" \
  --data-urlencode "filter=event_time >= \"2026-05-01T00:00:00Z\" AND event_time <= \"2026-05-02T00:00:00Z\"" \
  "https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/enterprise/securityInsights:queryContentTransfers"

Phản hồi

{
  "summaries": [
    {
      "metric": "CONTENT_TRANSFERS_METRIC_TOTAL_SENSITIVE_TRANSFERS",
      "count": "918"
    },
    {
      "metric": "CONTENT_TRANSFERS_METRIC_TOTAL_DOWNLOADS",
      "count": "1537"
    },
    {
      "metric": "CONTENT_TRANSFERS_METRIC_TOTAL_UPLOADS",
      "count": "1532"
    },
    {
      "metric": "CONTENT_TRANSFERS_METRIC_SENSITIVE_UPLOADS",
      "count": "306"
    },
    {
      "metric": "CONTENT_TRANSFERS_METRIC_TOTAL_TRANSFERS",
      "count": "4596"
    },
    {
      "metric": "CONTENT_TRANSFERS_METRIC_SENSITIVE_PRINTS",
      "count": "305"
    },
    {
      "metric": "CONTENT_TRANSFERS_METRIC_SENSITIVE_DOWNLOADS",
      "count": "307"
    },
    {
      "metric": "CONTENT_TRANSFERS_METRIC_TOTAL_PRINTS",
      "count": "1527"
    }
  ]
}

Truy vấn thông tin tóm tắt về hoạt động chuyển nội dung kèm theo thông tin chi tiết

Để truy vấn các lượt chuyển nội dung có bảng chi tiết theo phương diện (ví dụ: bảng chi tiết theo USER), hãy sử dụng phương thức queryContentTransfersBreakdowns.

Yêu cầu

  curl -G \
  -H "Authorization: Bearer $TOKEN" \
  --data-urlencode "breakdown=USER" \
  --data-urlencode "metric=CONTENT_TRANSFERS_METRIC_TOTAL_TRANSFERS" \
  --data-urlencode "fixedTimeRange=FIXED_TIME_RANGE_FOUR_WEEKS" \
  --data-urlencode "filter=user = \"user1\" AND event_time <= \"2026-05-01T00:00:00Z\"" \
  --data-urlencode "pageSize=5" \
  "https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/enterprise/securityInsights:queryContentTransfersBreakdowns"

Phản hồi

{
  "contentTransfersBreakdowns": [
    {
      "user": "user1",
      "summary": {
        "metric": "CONTENT_TRANSFERS_METRIC_TOTAL_TRANSFERS",
        "count": "20"
      }
    }
  ]
}

Truy vấn thông tin tóm tắt về lượt truy cập URL cấp cao cho miền của bạn

Để truy xuất thông tin tóm tắt cấp cao về lượt truy cập URL đáng ngờ, hãy sử dụng phương thức queryUrlVisits.

Yêu cầu

  curl -G \
  -H "Authorization: Bearer $TOKEN" \
  --data-urlencode "filter=event_time >= \"2026-05-01T00:00:00Z\" AND event_time <= \"2026-05-02T00:00:00Z\"" \
  "https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/enterprise/securityInsights:queryUrlVisits"

Phản hồi

{
  "summaries": [
    {
      "metric": "URL_VISITS_METRIC_HIGH_RISK_URL_VISITS",
      "count": "286"
    },
    {
      "metric": "URL_VISITS_METRIC_LOW_RISK_URL_VISITS",
      "count": "287"
    },
    {
      "metric": "URL_VISITS_METRIC_TOTAL_SUSPICIOUS_URL_VISITS",
      "count": "859"
    },
    {
      "metric": "URL_VISITS_METRIC_MEDIUM_RISK_URL_VISITS",
      "count": "286"
    }
  ]
}

Truy vấn thông tin tóm tắt về lượt truy cập vào URL có thông tin chi tiết

Để truy vấn lượt truy cập URL có thông tin chi tiết theo phương diện (ví dụ: thông tin chi tiết theo EVENT_DOMAIN), hãy sử dụng phương thức queryUrlVisitsBreakdowns.

Yêu cầu

  curl -G \
  -H "Authorization: Bearer $TOKEN" \
  --data-urlencode "breakdown=EVENT_DOMAIN" \
  --data-urlencode "metric=URL_VISITS_METRIC_TOTAL_SUSPICIOUS_URL_VISITS" \
  --data-urlencode "fixedTimeRange=FIXED_TIME_RANGE_ONE_WEEK" \
  --data-urlencode "filter=event_domain = \"suspicious-domain.com\" AND event_time <= \"2026-05-01T00:00:00Z\"" \
  --data-urlencode "pageSize=5" \
  "https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/enterprise/securityInsights:queryUrlVisitsBreakdowns"

Phản hồi

{
  "urlVisitsBreakdowns": [
    {
      "eventDomain": "suspicious-domain.com",
      "summary": {
        "metric": "URL_VISITS_METRIC_TOTAL_SUSPICIOUS_URL_VISITS",
        "count": "132"
      }
    }
  ]
}