개요

Alert Center API를 사용하면 도메인에 영향을 주는 알림 을 관리할 수 있습니다. 알림은 Google에서 감지한 잠재적인 보안 문제에 대한 경고입니다. 알림에는 다음 정보가 포함됩니다.

  • 알림이 발생한 소스입니다.
  • 알림의 이름입니다.
  • 이 알림이 발생한 시간입니다.
  • 이 알림과 연결된 특정 데이터입니다.

도메인 관리자는 Google 관리 콘솔에서 수동으로 알림을 확인하고 관리할 수 있습니다. Alert Center API를 사용하면 빌드한 앱을 통해 알림 데이터 및 알림 피드백을 가져올 수 있습니다. Alert Center API는 또한 기존 알림에 대한 새 알림 피드백을 만들 수도 있습니다.

예를 들어 모니터링 앱에서 Alert Center API로 도메인의 최근 알림을 검색하여 우선순위를 지정하고 조직의 구성원에게 알릴 수 있습니다. 팀에서 알림을 확인한 후 결과에 따라 앱에서 의견을 알림에 첨부할 수 있습니다.

Alert Center API 사용

Alert Center API를 사용하기 전에 새 Google Cloud 프로젝트를 설정하고 Alert Center API를 사용 설정해야 합니다. 프로젝트에서 API에 액세스할 때는 서비스 계정을 사용해야 합니다.

앱에 사전 요구사항을 충족하고 적절하게 승인된 Google Cloud 프로젝트가 있으면 Alert Center API REST 요청을 할 수 있습니다. 사용 가능한 클라이언트 라이브러리를 사용하면 API 요청을 더 쉽게 할 수 있습니다.

다음 예에서는 API를 사용하여 사용 가능한 알림을 나열하는 방법을 보여줍니다.

자바

// First, authorize the API and create a client to make requests with.
URL serviceAccountUrl = AuthUtils.class.getResource("/client_secret.json");
GoogleCredentials credentials =  ServiceAccountCredentials
    .fromStream(serviceAccountUrl.openStream())
    .createDelegated("admin@xxxx.com")
    .createScoped(Collections.singleton("https://www.googleapis.com/auth/apps.alerts"));
ApacheHttpTransport transport = new ApacheHttpTransport();
HttpCredentialsAdapter adapter = new HttpCredentialsAdapter(credentials);
AlertCenter alertCenter = new AlertCenter.Builder(transport, new JacksonFactory(), adapter)
    .setApplicationName("Alert Center client")
    .build();

// List alerts in pages, printing each alert discovered.
String pageToken = null;
do {
  ListAlertsResponse listResponse = service.alerts().list().setPageToken(pageToken)
      .setPageSize(20).execute();
  if (listResponse.getAlerts() != null) {
    for (Alert alert : listResponse.getAlerts()) {
      System.out.println(alert);
    }
  }
  pageToken = listResponse.getNextPageToken();
} while (pageToken != null);