Chrome Management Security Insights API のコードサンプル

API 機能については、Chrome Management Security Insights API をご覧ください。

以下に示すリクエストでは、次の変数を使用します。

  • $TOKEN - OAuth 2 トークン
  • $CUSTOMER - 顧客の ID またはリテラル my_customer

ドメインのインサイトの有効化ステータスを確認する

ドメインの分析情報の有効化ステータスを確認するには、checkEnablementStatus メソッドを使用します。

リクエスト

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

レスポンス

{
  "insightsState": "INSIGHTS_ENABLED"
}

ドメインの分析情報を有効にする

ドメインの分析情報を有効にするには、enable メソッドを使用します。必要に応じて、targetOus を指定して、特定の組織部門のセットに対して Chrome コネクタを構成できます。targetOus が設定されていない場合、Chrome コネクタはルート組織部門で構成されます。

リクエスト

  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"

レスポンス

{
  "insightsState": "INSIGHTS_ENABLED"
}

ドメインの分析情報を無効にする

ドメインの分析情報を無効にするには、disable メソッドを使用します。

リクエスト

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

レスポンス

{
  "insightsState": "INSIGHTS_DISABLED"
}