Proofpoint TAP Threats 로그 수집

다음에서 지원:

이 문서에서는 Cloud Storage V2를 사용하여 Proofpoint TAP 위협 로그를 Google Security Operations로 수집하는 방법을 설명합니다. Proofpoint Targeted Attack Protection(TAP)은 악성 첨부파일 및 URL을 포함하여 이메일을 통해 전달되는 위협을 감지, 분석, 차단하는 고급 이메일 보안 플랫폼입니다. TAP Threat API는 TAP가 환경에서 식별한 각 위협의 요약(분류, 상태, 심각도, 감지 유형, 위협 행위자, 멀웨어 패밀리, 기법, 관련 브랜드)을 반환합니다. Cloud Run 함수는 TAP SIEM API를 통해 환경에서 관찰된 위협을 검색하고 Threat API 요약을 Cloud Storage 버킷에 기록하며, Google SecOps는 이 버킷에서 위협을 수집합니다.

시작하기 전에

다음 기본 요건이 충족되었는지 확인합니다.

  • Google SecOps 인스턴스
  • Cloud Storage API가 사용 설정된 Google Cloud 프로젝트
  • Cloud Storage 버킷을 만들고 관리할 수 있는 권한
  • Cloud Run 서비스, Pub/Sub 주제, Cloud Scheduler 작업을 만들 수 있는 권한
  • 위협 인사이트 대시보드에 액세스할 수 있는 Proofpoint TAP 구독
  • SIEM API에 액세스할 수 있는 권한이 있는 TAP API 서비스 사용자 인증 정보(서비스 주체 및 보안 비밀)

Proofpoint TAP API 서비스 사용자 인증 정보 생성

  1. Proofpoint TAP Threat Insight 대시보드에 로그인합니다.
  2. 설정 > 연결된 애플리케이션 > 서비스 사용자 인증 정보로 이동합니다.
  3. 새 사용자 인증 정보 만들기를 클릭합니다.
  4. 생성된 서비스 사용자 인증 정보 대화상자에서 다음을 복사하여 안전하게 저장합니다.

    • 서비스 주 구성원: API 인증에 사용되는 주 구성원 식별자입니다.
    • 보안 비밀: API 인증에 사용되는 보안 비밀 키입니다.

API 액세스 확인

  • 통합을 진행하기 전에 다음과 같이 사용자 인증 정보를 테스트합니다.

    PRINCIPAL="your-service-principal"
    SECRET="your-secret"
    
    # Test SIEM API access (fetch last hour of events)
    curl -s "https://tap-api-v2.proofpoint.com/v2/siem/all?format=json&sinceSeconds=3600" \
      --user "${PRINCIPAL}:${SECRET}"
    

    성공적인 응답은 messagesBlocked, messagesDelivered, clicksBlocked, clicksPermitted 배열이 포함된 JSON 객체를 반환합니다. 401 오류가 발생하면 서비스 주 구성원과 보안 비밀이 올바른지 확인합니다. 403 오류가 발생하면 계정에 TAP API 액세스가 사용 설정되어 있는지 확인하세요.

    그런 다음 해당 응답의 이벤트에서 threatID 값을 가져와 이 가이드에서 수집하는 레코드의 소스인 Threat API를 테스트합니다.

    THREAT_ID="<threatID from a SIEM event>"
    
    curl -s "https://tap-api-v2.proofpoint.com/v2/threat/summary/${THREAT_ID}" \
      --user "${PRINCIPAL}:${SECRET}"
    

    성공적인 응답은 id, identifiedAt, name, type, category, status, actors, families, malware, techniques, brands 배열이 있는 JSON 객체입니다. SIEM 응답에 이벤트가 없으면 지난 1시간 동안 환경에 TAP 식별 위협이 없었던 것입니다. 함수는 여전히 올바르게 실행되며 위협이 나타날 때까지 아무것도 작성하지 않습니다.

Cloud Storage 버킷 만들기

  1. Google Cloud 콘솔로 이동합니다.
  2. 프로젝트를 선택하거나 새 프로젝트를 만듭니다.
  3. 탐색 메뉴에서 Cloud Storage > 버킷으로 이동합니다.
  4. 버킷 만들기를 클릭합니다.
  5. 다음 구성 세부정보를 제공합니다.

    설정 값
    버킷 이름 지정 전역적으로 고유한 이름(예: proofpoint-tap-threats-logs)을 입력합니다.
    위치 유형 필요에 따라 선택(리전, 이중 리전, 멀티 리전)
    위치 위치를 선택합니다(예: us-central1).
    스토리지 클래스 표준(자주 액세스하는 로그에 권장)
    액세스 제어 균일(권장)
    보호 도구 선택사항: 객체 버전 관리 또는 보관 정책 사용 설정
  6. 만들기를 클릭합니다.

Cloud Run 함수의 서비스 계정 만들기

Cloud Run 함수에는 Cloud Storage 버킷에 쓰고 Pub/Sub에서 호출할 수 있는 권한이 있는 서비스 계정이 필요합니다.

서비스 계정 만들기

  1. Google Cloud 콘솔에서 IAM 및 관리자 > 서비스 계정으로 이동합니다.
  2. 서비스 계정 만들기를 클릭합니다.
  3. 다음 구성 세부정보를 제공합니다.
    • 서비스 계정 이름: tap-threats-collector-sa을 입력합니다.
    • 서비스 계정 설명: Service account for Cloud Run function to collect Proofpoint TAP Threats logs을 입력합니다.
  4. 만들고 계속하기를 클릭합니다.
  5. 이 서비스 계정에 프로젝트에 대한 액세스 권한 부여 섹션에서 다음 역할을 추가합니다.
    1. 역할 선택을 클릭합니다.
    2. 스토리지 객체 관리자를 검색하고 선택합니다.
    3. + 다른 역할 추가를 클릭합니다.
    4. Cloud Run 호출자를 검색하여 선택합니다.
    5. + 다른 역할 추가를 클릭합니다.
    6. Cloud Functions 호출자를 검색하여 선택합니다.
  6. 계속을 클릭합니다.
  7. 완료를 클릭합니다.

이러한 역할은 다음 작업에 필요합니다.

  • 스토리지 객체 관리자: Cloud Storage 버킷에 위협 이벤트 데이터를 쓰고 상태 파일을 관리합니다.
  • Cloud Run 호출자: Pub/Sub가 함수를 호출하도록 허용
  • Cloud Functions 호출자: 함수 호출 허용

Cloud Storage 버킷에 Identity and Access Management(IAM) 권한 부여

서비스 계정에 Cloud Storage 버킷에 대한 쓰기 권한을 부여합니다.

  1. Cloud Storage > 버킷으로 이동합니다.
  2. 버킷 이름을 클릭합니다.
  3. 권한 탭으로 이동합니다.
  4. 액세스 권한 부여를 클릭합니다.
  5. 다음 구성 세부정보를 제공합니다.
    • 주 구성원 추가: 서비스 계정 이메일(예: tap-threats-collector-sa@PROJECT_ID.iam.gserviceaccount.com)을 입력합니다.
    • 역할 할당: 스토리지 객체 관리자를 선택합니다.
  6. 저장을 클릭합니다.

Pub/Sub 주제 만들기

Cloud Scheduler가 게시하고 Cloud Run 함수가 구독할 Pub/Sub 주제를 만듭니다.

  1. Google Cloud 콘솔에서 Pub/Sub > 주제로 이동합니다.
  2. 주제 만들기를 클릭합니다.
  3. 다음 구성 세부정보를 제공합니다.
    • 주제 ID: tap-threats-collector-trigger를 입력합니다.
    • 다른 설정은 기본값으로 둡니다.
  4. 만들기를 클릭합니다.

위협 이벤트를 수집하는 Cloud Run 함수 만들기

  • Cloud Run 함수는 Cloud Scheduler의 Pub/Sub 메시지에 의해 트리거됩니다. TAP SIEM API를 읽어 환경에서 관찰된 위협 ID를 찾고, TAP Threat API에서 각 위협의 요약을 가져오고, 요약을 Cloud Storage에 기록합니다.
  1. Google Cloud 콘솔에서 Cloud Run으로 이동합니다.
  2. 함수 작성을 클릭합니다.
  3. 구성 섹션에서 다음 구성 세부정보를 제공합니다.

    설정 값
    서비스 이름 tap-threats-collector
    리전 Cloud Storage 버킷과 일치하는 리전(예: us-central1)을 선택합니다.
    런타임 Python 3.12 이상을 선택합니다.
  4. 트리거 섹션에서 트리거 추가를 클릭하고 Pub/Sub 트리거를 선택합니다.

  5. Eventarc 트리거 창에서 다음 구성 세부정보를 제공합니다.

    • 트리거 이름: 생성된 이름을 유지하거나 트리거 이름을 입력합니다.
    • 트리거 유형: Google 소스를 선택합니다.
    • 이벤트 제공자: Pub/Sub를 선택합니다.
    • 이벤트 유형: google.cloud.pubsub.topic.v1.messagePublished를 선택합니다.
    • Cloud Pub/Sub 주제 선택: tap-threats-collector-trigger 주제를 선택합니다.
    • 리전: 함수와 동일한 리전을 선택합니다.
    • 서비스 계정: 서비스 계정 tap-threats-collector-sa를 선택합니다.
  6. 트리거 저장을 클릭합니다.

  7. 인증 섹션에서 다음을 구성합니다.

    1. 인증 필요를 선택합니다.
    2. Identity and Access Management(IAM)를 선택합니다.
  8. 컨테이너, 네트워킹, 보안으로 이동하여 펼칩니다.

  9. 보안 탭으로 이동합니다.

    • 서비스 계정: 서비스 계정 tap-threats-collector-sa를 선택합니다.
  10. 컨테이너 탭으로 이동합니다.

    1. 변수 및 보안 비밀을 클릭합니다.
    2. 각 환경 변수에 대해 + 변수 추가를 클릭합니다.
    변수 이름 예시 값 설명
    GCS_BUCKET proofpoint-tap-threats-logs Cloud Storage 버킷 이름
    GCS_PREFIX tap-threats 로그 파일의 프리픽스
    STATE_KEY tap-threats-state.json 로그 프리픽스 외부의 상태 경로
    TAP_PRINCIPAL your-service-principal TAP API 서비스 주 구성원
    TAP_SECRET your-secret TAP API 비밀번호
    LOOKBACK_HOURS 24 첫 실행 시 초기 탐색 기간(시간)(최대 168, SIEM API 한도)
    OVERLAP_MINUTES 10 워터마크 전에 창을 다시 읽어 지연 색인 생성된 SIEM 이벤트 포착
    MAX_THREATS 500 실행당 가져온 최대 위협 요약 수입니다. 나머지는 상태 파일에서 큐에 추가된 상태로 유지됩니다.
    SEEN_RETENTION_DAYS 7 위협 ID가 마지막으로 확인된 후 기억되는 일수
  11. 변수 및 보안 비밀 섹션에서 요청으로 이동합니다.

    • 요청 제한 시간: 540초(9분)를 입력합니다.
  12. 설정 탭으로 이동합니다.

    • 리소스 섹션에서 다음을 수행합니다.
      • 메모리: 512MiB 이상을 선택합니다.
      • CPU: 1 선택
  13. 버전 확장 섹션에서 다음을 수행합니다.

    • 최소 인스턴스 수: 0를 입력합니다.
    • 최대 인스턴스 수: 100을 입력합니다(또는 예상 부하에 따라 조정).
  14. 만들기를 클릭합니다.

  15. 서비스가 생성될 때까지 기다립니다(1~2분).

  16. 서비스가 생성되면 인라인 코드 편집기가 자동으로 열립니다.

함수 코드 추가

  1. 진입점 필드에 main을 입력합니다.
  2. 인라인 코드 편집기에서 다음 두 파일을 만듭니다.

    • 첫 번째 파일 - main.py:
    import functions_framework
    from google.cloud import storage
    from google.cloud.exceptions import NotFound
    import base64
    import hashlib
    import json
    import os
    import urllib3
    from urllib.parse import quote
    from datetime import datetime, timezone, timedelta
    import time
    
    # Initialize HTTP client with timeouts
    http = urllib3.PoolManager(
        timeout=urllib3.Timeout(connect=5.0, read=60.0),
        retries=False,
    )
    
    # Initialize Storage client
    storage_client = storage.Client()
    
    # Environment variables
    GCS_BUCKET = os.environ.get('GCS_BUCKET')
    GCS_PREFIX = os.environ.get('GCS_PREFIX', 'tap-threats')
    # STATE_KEY must stay OUTSIDE GCS_PREFIX. The feed ingests every object under
    # its bucket URI and, with a deletion option selected, deletes what it
    # transferred. A state file inside the prefix would be ingested as log data and
    # then deleted, resetting collection and re-ingesting duplicates.
    STATE_KEY = os.environ.get('STATE_KEY', 'tap-threats-state.json')
    API_BASE = os.environ.get('TAP_API_BASE', 'https://tap-api-v2.proofpoint.com')
    TAP_PRINCIPAL = os.environ.get('TAP_PRINCIPAL')
    TAP_SECRET = os.environ.get('TAP_SECRET')
    # The SIEM API accepts at most 7 days of lookback.
    LOOKBACK_HOURS = min(int(os.environ.get('LOOKBACK_HOURS', '24')), 168)
    # The discovery query re-reads this many minutes before the watermark so that
    # events the SIEM API indexes late still surface their threat IDs.
    OVERLAP_MINUTES = int(os.environ.get('OVERLAP_MINUTES', '10'))
    # Maximum threat summaries fetched per run. The rest stay queued in the state.
    MAX_THREATS = int(os.environ.get('MAX_THREATS', '500'))
    # Days a threat ID stays in the state after it was last seen in SIEM events.
    SEEN_RETENTION_DAYS = int(os.environ.get('SEEN_RETENTION_DAYS', '7'))
    
    class FetchError(Exception):
        """Raised when a Proofpoint API call fails.
    
        The watermark must never advance on a failed fetch, otherwise the threats
        referenced in the failed window are never looked up.
        """
    
    def parse_datetime(value: str) -> datetime:
        """Parse an ISO 8601 datetime string into an aware datetime."""
        if value.endswith('Z'):
            value = value[:-1] + '+00:00'
        dt = datetime.fromisoformat(value)
        if dt.tzinfo is None:
            dt = dt.replace(tzinfo=timezone.utc)
        return dt
    
    def tap_time(dt: datetime) -> str:
        """Render a datetime in the YYYY-MM-DDThh:mm:ssZ form the SIEM API accepts."""
        return dt.astimezone(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')
    
    def auth_header() -> str:
        """Build the HTTP Basic header from the service principal and secret."""
        token = base64.b64encode(f'{TAP_PRINCIPAL}:{TAP_SECRET}'.encode('utf-8')).decode('utf-8')
        return f'Basic {token}'
    
    def content_hash(record: dict) -> str:
        """Hash a threat summary so an unchanged summary is not written twice."""
        return hashlib.sha256(
            json.dumps(record, sort_keys=True, ensure_ascii=False).encode('utf-8')
        ).hexdigest()
    
    @functions_framework.cloud_event
    def main(cloud_event):
        """Discover threat IDs in TAP SIEM events and write their Threat API summaries.
    
        The PROOFPOINT_TAP_THREATS parser reads the Threat API summary schema, not the
        SIEM API events. The SIEM API is used only to find which threat IDs were
        observed; every message and click event for those threats is what the
        Proofpoint TAP (PROOFPOINT_MAIL) feed carries.
    
        Args:
            cloud_event: CloudEvent object containing the Pub/Sub message.
        """
        if not all([GCS_BUCKET, TAP_PRINCIPAL, TAP_SECRET]):
            # Raise rather than return: a bare return acks the Pub/Sub message and
            # reports the run as successful, silently discarding the schedule tick.
            raise RuntimeError('Missing required environment variables')
    
        bucket = storage_client.bucket(GCS_BUCKET)
        state = load_state(bucket, STATE_KEY)
    
        now = datetime.now(timezone.utc)
        watermark = None
        if state.get('last_event_time'):
            watermark = parse_datetime(state['last_event_time'])
        # threat_id -> {'hash': sha256 of the last written summary, 'seen': ISO time}
        seen = state.get('seen_threats', {})
        pending = list(state.get('pending_threat_ids', []))
    
        if watermark is None:
            start_time = now - timedelta(hours=LOOKBACK_HOURS)
        else:
            start_time = max(watermark - timedelta(minutes=OVERLAP_MINUTES), now - timedelta(days=7))
    
        headers = {
            'Authorization': auth_header(),
            'Accept': 'application/json',
            'User-Agent': 'GoogleSecOps-TAPThreatsCollector/2.0',
        }
    
        print(f"Discovering threats in SIEM events from {start_time.isoformat()} to {now.isoformat()}")
    
        # A FetchError here propagates: the run fails, the watermark is untouched,
        # and the next invocation retries the same window.
        discovered, newest_event_time = discover_threat_ids(headers, start_time, now)
    
        for threat_id in discovered:
            seen.setdefault(threat_id, {})['seen'] = now.isoformat()
            if threat_id not in pending:
                pending.append(threat_id)
        print(f"Discovered {len(discovered)} threat IDs, {len(pending)} queued for lookup")
    
        batch = pending[:MAX_THREATS]
        fresh = []
        for threat_id in batch:
            summary = fetch_threat_summary(headers, threat_id)
            if summary is None:
                # The Threat API has no summary for this ID; drop it from the queue.
                seen.setdefault(threat_id, {})['seen'] = now.isoformat()
                continue
            digest = content_hash(summary)
            if seen.get(threat_id, {}).get('hash') == digest:
                # Unchanged since it was last written; nothing new to ingest.
                continue
            fresh.append((threat_id, digest, summary))
        remaining = pending[len(batch):]
        if remaining:
            print(f"Reached max_threats limit ({MAX_THREATS}); {len(remaining)} threat IDs stay queued")
    
        # Forget threat IDs not seen for SEEN_RETENTION_DAYS so the state stays small.
        cutoff = now - timedelta(days=SEEN_RETENTION_DAYS)
        seen = {
            tid: info for tid, info in seen.items()
            if info.get('seen') and parse_datetime(info['seen']) >= cutoff
        }
    
        if fresh:
            timestamp = now.strftime('%Y%m%dT%H%M%SZ')
            object_key = f"{GCS_PREFIX}/threats_{timestamp}.ndjson"
            blob = bucket.blob(object_key)
            ndjson = '\n'.join(json.dumps(summary, ensure_ascii=False) for _, _, summary in fresh) + '\n'
            blob.upload_from_string(ndjson, content_type='application/x-ndjson')
            print(f"Wrote {len(fresh)} threat summaries to gs://{GCS_BUCKET}/{object_key}")
            for threat_id, digest, _ in fresh:
                seen.setdefault(threat_id, {})['hash'] = digest
        else:
            print("No new or changed threat summaries.")
    
        # Advance the watermark only after the data is durably written. When the
        # window held no events at all, keep the old watermark so a late-indexed
        # event is still picked up by the next overlap.
        new_watermark = watermark
        if newest_event_time:
            candidate = parse_datetime(newest_event_time)
            if new_watermark is None or candidate > new_watermark:
                new_watermark = candidate
    
        save_state(bucket, STATE_KEY, {
            'last_event_time': new_watermark.isoformat() if new_watermark else None,
            'seen_threats': seen,
            'pending_threat_ids': remaining,
        })
    
        print(f"Successfully processed {len(fresh)} threat summaries")
    
    def load_state(bucket, key):
        """Read the collector state from Cloud Storage.
    
        Only a missing object is treated as a cold start. Any other error is raised:
        swallowing it would silently reset collection to the full lookback window
        and re-ingest that entire period.
        """
        blob = bucket.blob(key)
        try:
            return json.loads(blob.download_as_text())
        except NotFound:
            print('No state file found. Starting from the lookback window.')
            return {}
    
    def save_state(bucket, key, state: dict):
        """Write the collector state to Cloud Storage.
    
        Failures are raised, not logged. If the state write fails after the data was
        uploaded, the next run repeats the same window and duplicates it.
        """
        blob = bucket.blob(key)
        blob.upload_from_string(
            json.dumps(state, indent=2),
            content_type='application/json',
        )
        print(f"Saved state: last_event_time={state.get('last_event_time')}, "
              f"{len(state.get('seen_threats', {}))} known threats, "
              f"{len(state.get('pending_threat_ids', []))} pending")
    
    def request_json(url: str, headers: dict):
        """Call a TAP API endpoint and return the decoded JSON body.
    
        Returns None on HTTP 404, which the Threat API uses for an unknown ID.
        Raises FetchError on any other transport or HTTP failure, so that the
        caller does not mistake a failed call for an empty result.
        """
        backoff = 1.0
        for attempt in range(5):
            try:
                response = http.request('GET', url, headers=headers)
            except Exception as e:
                raise FetchError(f'Request to {url} failed: {e}') from e
    
            if response.status == 429:
                raw_retry_after = response.headers.get('Retry-After')
                try:
                    # Retry-After may also be an HTTP date, which int() cannot parse.
                    wait = int(raw_retry_after) if raw_retry_after else int(backoff)
                except (TypeError, ValueError):
                    wait = int(backoff)
                print(f"Rate limited (429). Retrying after {wait}s...")
                time.sleep(wait)
                backoff = min(backoff * 2, 60.0)
                continue
    
            if response.status == 404:
                return None
    
            if response.status != 200:
                raise FetchError(f'HTTP {response.status} from {url}: {response.data.decode("utf-8", "replace")[:500]}')
    
            try:
                return json.loads(response.data.decode('utf-8'))
            except json.JSONDecodeError as e:
                raise FetchError(f'Malformed JSON response from {url}: {e}') from e
    
        raise FetchError('Rate limited repeatedly; giving up without advancing the watermark')
    
    def discover_threat_ids(headers: dict, start_time: datetime, end_time: datetime):
        """Read TAP SIEM events in one-hour windows and collect the threat IDs they reference.
    
        Returns:
            Tuple of (ordered list of unique threat IDs, newest event time ISO string).
        """
        threat_ids = []
        newest_time = None
        current_start = start_time
    
        while current_start < end_time:
            # The SIEM API allows at most one hour per request.
            current_end = min(current_start + timedelta(hours=1), end_time)
            interval = f'{tap_time(current_start)}/{tap_time(current_end)}'
            url = f'{API_BASE}/v2/siem/all?format=json&interval={quote(interval, safe="/:")}'
    
            data = request_json(url, headers)
            if data is None:
                raise FetchError(f'SIEM API returned 404 for interval {interval}')
    
            window_count = 0
            for key in ('messagesBlocked', 'messagesDelivered'):
                for message in data.get(key) or []:
                    window_count += 1
                    stamp = message.get('messageTime')
                    for info in message.get('threatsInfoMap') or []:
                        tid = info.get('threatID')
                        if tid and tid not in threat_ids:
                            threat_ids.append(tid)
                        stamp = stamp or info.get('threatTime')
                    if stamp and (newest_time is None or parse_datetime(stamp) > parse_datetime(newest_time)):
                        newest_time = stamp
            for key in ('clicksBlocked', 'clicksPermitted'):
                for click in data.get(key) or []:
                    window_count += 1
                    tid = click.get('threatID')
                    if tid and tid not in threat_ids:
                        threat_ids.append(tid)
                    stamp = click.get('clickTime') or click.get('threatTime')
                    if stamp and (newest_time is None or parse_datetime(stamp) > parse_datetime(newest_time)):
                        newest_time = stamp
    
            print(f"Interval {interval}: {window_count} events, {len(threat_ids)} unique threats so far")
            current_start = current_end
    
        return threat_ids, newest_time
    
    def fetch_threat_summary(headers: dict, threat_id: str):
        """Fetch one threat summary from the Threat API, or None if TAP has no summary for it."""
        url = f'{API_BASE}/v2/threat/summary/{quote(threat_id, safe="")}'
        summary = request_json(url, headers)
        if summary is None:
            print(f"Threat {threat_id}: no summary available (404)")
            return None
        if 'id' not in summary:
            summary['id'] = threat_id
        return summary
    

    • 두 번째 파일 - requirements.txt:
    functions-framework==3.*
    google-cloud-storage==2.*
    urllib3>=2.0.0
    
  3. 배포를 클릭하여 함수를 저장하고 배포합니다.

  4. 배포가 완료될 때까지 기다립니다(2~3분).

함수가 위협을 수집하는 방법

  • 이 함수는 워터마크에서 1시간 간격으로 TAP SIEM API /v2/siem/all 엔드포인트를 읽고 차단 및 전송된 메시지와 차단 및 허용된 클릭에서 참조하는 threatID 값을 수집합니다. SIEM 이벤트 자체는 기록되지 않으며 위협 ID만 사용됩니다.
  • 발견된 각 위협 ID에 대해 /v2/threat/summary/{threatId}를 호출하고 요약을 하나의 NDJSON 레코드로 작성합니다. 요약은 마지막으로 작성된 이후 콘텐츠가 변경된 경우에만 다시 작성됩니다(예: 위협 상태가 active에서 cleared로 변경되는 경우).
  • 상태 파일은 최신 SIEM 이벤트 시간을 워터마크로, 위협별로 마지막으로 작성된 요약의 해시를, 실행이 MAX_THREATS에 도달할 때 여전히 큐에 추가된 위협 ID를 유지합니다. 실행할 때마다 워터마크 전에 OVERLAP_MINUTES를 다시 읽고 큐를 먼저 처리하므로 실행이 제한되거나 이벤트가 늦게 색인 생성될 때 손실되는 항목이 없습니다.
  • API 또는 스토리지 오류가 발생하면 실행이 실패하고 워터마크가 변경되지 않으므로 다음 실행에서 동일한 기간을 다시 시도합니다.

Cloud Scheduler 작업 만들기

Cloud Scheduler는 정기적으로 Pub/Sub 주제에 메시지를 게시하여 Cloud Run 함수를 트리거합니다.

  1. Google Cloud 콘솔에서 Cloud Scheduler로 이동합니다.
  2. 작업 만들기를 클릭합니다.
  3. 다음 구성 세부정보를 제공합니다.

    설정 값
    이름 tap-threats-collector-hourly
    리전 Cloud Run 함수와 동일한 리전 선택
    주파수 0 * * * *(매시간 정각)
    시간대 시간대 선택(UTC 권장)
    타겟 유형 Pub/Sub
    주제 tap-threats-collector-trigger 주제를 선택합니다.
    메일 본문 {}(빈 JSON 객체)
  4. 만들기를 클릭합니다.

일정 빈도 옵션

로그 볼륨 및 지연 시간 요구사항에 따라 빈도를 선택합니다.

빈도 크론 표현식 사용 사례
15분마다 */15 * * * * 위협이 많은 대규모 환경
1시간마다 0 * * * * 표준(권장)
6시간마다 0 */6 * * * 볼륨이 적은 환경

통합 테스트

  1. Cloud Scheduler 콘솔에서 작업을 찾습니다.
  2. 강제 실행을 클릭하여 작업을 수동으로 트리거합니다.
  3. 몇 초 동안 기다립니다.
  4. Cloud Run > 서비스로 이동합니다.
  5. 함수 이름 tap-threats-collector를 클릭합니다.
  6. 로그 탭을 클릭합니다.
  7. 함수가 성공적으로 실행되었는지 확인합니다. 다음 항목을 찾습니다.

    Discovering threats in SIEM events from YYYY-MM-DDTHH:MM:SS+00:00 to YYYY-MM-DDTHH:MM:SS+00:00
    Interval .../...: X events, Y unique threats so far
    Discovered Y threat IDs, Y queued for lookup
    Wrote Z threat summaries to gs://proofpoint-tap-threats-logs/tap-threats/threats_YYYYMMDDTHHMMSSZ.ndjson
    Successfully processed Z threat summaries
    
  8. Cloud Storage > 버킷으로 이동합니다.

  9. 버킷 이름을 클릭합니다.

  10. 접두사 폴더 tap-threats/로 이동합니다.

  11. 현재 타임스탬프로 새 .ndjson 파일이 생성되었는지 확인합니다.

로그에 오류가 표시되는 경우:

  • HTTP 401: 환경 변수에서 TAP_PRINCIPAL 및 TAP_SECRET을 확인합니다. 서비스 주 구성원과 보안 비밀이 올바른지 확인합니다.
  • HTTP 403: TAP 계정에 API 액세스가 사용 설정되어 있는지 확인합니다.
  • HTTP 429: 비율 제한 - 함수가 백오프를 사용하여 자동으로 재시도합니다. 일정 빈도를 줄이는 것이 좋습니다.
  • 새로운 위협 요약 또는 변경된 위협 요약 없음: 기간 내에 위협이 관찰되지 않았거나 관찰된 모든 위협이 이미 동일한 콘텐츠로 작성된 경우 정상입니다. TAP는 URL Defense 또는 Attachment Defense에서 식별한 위협만 보고합니다.
  • 환경 변수 누락: 필요한 모든 변수가 설정되어 있는지 확인합니다.

Proofpoint TAP 위협 로그를 수집하도록 Google SecOps에서 피드 구성

  1. 설정 > 데이터 관리 > 피드로 이동합니다. SIEM 전용 플랫폼을 사용하는 경우 설정 > 피드로 이동합니다.
  2. 새 피드 추가를 클릭합니다.
  3. 단일 피드 구성을 클릭합니다.
  4. 피드 이름 필드에 피드 이름을 입력합니다(예: Proofpoint TAP Threats).
  5. 소스 유형으로 Google Cloud Storage V2를 선택합니다.
  6. 로그 유형으로 Proofpoint Tap Threats를 선택합니다.
  7. 서비스 계정 가져오기를 클릭합니다. 고유한 서비스 계정 이메일이 표시됩니다. 예를 들면 다음과 같습니다.

    chronicle-12345678@chronicle-gcp-prod.iam.gserviceaccount.com
    
  8. 다음 단계에서 사용할 수 있도록 이 이메일 주소를 복사합니다.

  9. 다음을 클릭합니다.

  10. 다음 입력 파라미터의 값을 지정합니다.

    • 스토리지 버킷 URL: 프리픽스 경로가 있는 Cloud Storage 버킷 URI를 입력합니다.

      gs://proofpoint-tap-threats-logs/tap-threats/
      
      • 다음과 같이 바꿉니다.
        • proofpoint-tap-threats-logs: Cloud Storage 버킷 이름입니다.
        • tap-threats: 로그가 저장되는 선택적 프리픽스 또는 폴더 경로입니다(루트의 경우 비워 둠).
    • 소스 삭제 옵션: 환경설정에 따라 삭제 옵션을 선택합니다.
      • 파일 삭제 안함: 소스에서 파일을 삭제하지 않습니다(테스트에 권장).
      • 전송된 파일 및 빈 디렉터리 삭제: 가져오기가 완료된 후 소스에서 파일과 빈 디렉터리를 삭제합니다.
    • 최대 파일 기간: 지난 며칠 동안 수정된 파일을 포함합니다(기본값은 180일).
    • 애셋 네임스페이스: 애셋 네임스페이스
    • 수집 라벨: 이 피드의 이벤트에 적용할 라벨입니다.
  11. 다음을 클릭합니다.

  12. 확정 화면에서 새 피드 구성을 검토한 다음 제출을 클릭합니다.

Google SecOps 서비스 계정에 IAM 권한 부여

Google SecOps 서비스 계정에는 Cloud Storage 버킷에 대한 두 가지 역할이 필요합니다. 로그 객체를 읽기 위한 스토리지 객체 뷰어와 버킷 메타데이터를 읽기 위한 버킷 수준 역할입니다.

  1. Cloud Storage > 버킷으로 이동합니다.
  2. 버킷 이름을 클릭합니다.
  3. 권한 탭으로 이동합니다.
  4. 액세스 권한 부여를 클릭합니다.
  5. 다음 구성 세부정보를 제공합니다.
    • 주 구성원 추가: Google SecOps 서비스 계정 이메일을 붙여넣습니다.
    • 역할 할당: 다음을 모두 선택합니다.
      • 스토리지 객체 뷰어: 로그 객체를 읽습니다.
      • 스토리지 기존 버킷 리더: 버킷 메타데이터를 읽습니다. 전송된 파일 및 빈 디렉터리 삭제 삭제 옵션을 선택한 경우 대신 스토리지 기존 버킷 작성자를 선택합니다. 이 역할은 삭제 권한도 부여합니다.
  6. 저장을 클릭합니다.

UDM 매핑 테이블

로그 필드 UDM 매핑 로직
detectionType_label additional.fields 병합됨
geoTargeted_label additional.fields 병합됨
notable_label additional.fields 병합됨
verticallyTargeted_label additional.fields 병합됨
identifiedAt metadata.event_timestamp ISO8601(으)로 파싱됨
has_principal metadata.event_type 매핑됨: true → NETWORK_CONNECTION, true → STATUS_UPDATE
type metadata.product_event_type 직접 매핑됨
id metadata.product_log_id 직접 매핑됨
_associations security_result.associations 병합됨
_techniques security_result.attack_details.techniques 병합됨
_category security_result.category 병합됨
_category_details security_result.category_details 병합됨
notable security_result.priority 매핑됨: true → HIGH_PRIORITY
name security_result.threat_name 직접 매핑됨
status security_result.threat_status 매핑됨: active → ACTIVE, cleared → CLEARED
_verdict_info security_result.verdict_info 병합됨
해당 사항 없음 metadata.event_type 상수: NETWORK_CONNECTION
해당 사항 없음 metadata.product_event_type 상수: Proofpoint_Threats_Feed
해당 사항 없음 metadata.product_name 상수: TAP Threats
해당 사항 없음 metadata.vendor_name 상수: Proofpoint
해당 사항 없음 security_result.priority 상수: HIGH_PRIORITY
해당 사항 없음 security_result.threat_status 상수: ACTIVE

변경 로그

이 파서의 변경 로그 보기

도움이 더 필요하신가요? 커뮤니티 회원 및 Google SecOps 전문가에게 문의하여 답변을 받으세요.