Fastly 차세대 WAF(이전 명칭: Signal Sciences) 로그 수집

다음에서 지원:

이 문서에서는 Cloud Storage V2를 사용하여 Fastly 차세대 WAF(이전의 Signal Sciences) 로그를 Google Security Operations에 수집하는 방법을 설명합니다.

Fastly 차세대 WAF(이전 명칭: Signal Sciences)는 웹 애플리케이션, API, 마이크로서비스에 대한 실시간 위협 감지 및 차단 기능을 제공하는 클라우드 기반 웹 애플리케이션 방화벽입니다. 신호 기반 접근 방식을 사용하여 SQL 삽입, 교차 사이트 스크립팅, 계정 탈취, 애플리케이션 악용과 같은 공격을 식별하고 완화합니다. Signal Sciences REST API는 플래그가 지정되고 차단된 요청에 관한 자세한 정보가 포함된 요청 피드 데이터에 프로그래매틱 방식으로 액세스할 수 있도록 지원합니다.

시작하기 전에

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

  • Google SecOps 인스턴스
  • Cloud Storage API가 사용 설정된 Google Cloud 프로젝트
  • Cloud Storage 버킷을 만들고 관리할 수 있는 권한
  • Cloud Storage 버킷에서 Identity and Access Management(IAM) 정책을 관리할 수 있는 권한
  • Cloud Run 서비스, Pub/Sub 주제, Cloud Scheduler 작업을 만들 수 있는 권한
  • API 액세스 권한이 있는 Fastly 차세대 WAF 대시보드에 대한 권한 액세스
  • 회사 이름과 하나 이상의 사이트가 구성된 Fastly 차세대 WAF 계정

Cloud Storage 버킷 만들기

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

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

Fastly 차세대 WAF API 사용자 인증 정보 수집

API 액세스 토큰 가져오기

  1. Fastly 차세대 WAF 대시보드에 로그인합니다.
  2. 오른쪽 상단에서 사용자 이름을 클릭한 다음 내 프로필을 선택합니다.
  3. API 액세스 토큰으로 이동합니다.
  4. API 액세스 토큰 추가를 클릭합니다.
  5. 토큰을 설명하는 이름(예: Google SecOps Integration)을 입력합니다.
  6. API 액세스 토큰 만들기를 클릭합니다.
  7. 다음 세부정보를 복사하여 안전한 위치에 저장합니다.

    • API 토큰: 생성된 토큰 값(한 번만 표시됨)
    • 이메일 주소: 인증에 사용되는 계정 이메일 주소

기업 및 사이트 이름 가져오기

  1. Fastly 차세대 WAF 대시보드에 로그인합니다.
  2. 관리 > 회사 > 회사 개요를 클릭합니다.
  3. 페이지에 표시된 Corp 닉네임(예: my_corp)을 기록해 둡니다.
  4. 관리 > 사이트로 이동합니다.
  5. 로그를 수집할 사이트의 사이트 닉네임을 기록해 둡니다(예: my_site).

권한 확인

계정에 필요한 권한이 있는지 확인하려면 다음 안내를 따르세요.

  1. Fastly 차세대 WAF 대시보드에 로그인합니다.
  2. 관리 > 회사 > 회사 사용자로 이동합니다.
  3. 목록에서 사용자 계정을 찾습니다.
  4. 내 역할이 관리자, 소유자 또는 관찰자인지 확인합니다. 이러한 역할에는 요청 피드 데이터를 검색하는 데 필요한 API 액세스 권한이 있습니다.
  5. 역할에 API 액세스 권한이 없는 경우 Fastly 차세대 WAF 관리자에게 문의하여 적절한 역할을 부여하세요.

테스트 API 액세스

  • 수집기가 사용하는 요청 피드 엔드포인트에 대해 사용자 인증 정보를 테스트합니다. 요청 피드는 정각의 from 및 until 값만 허용하며, until은 최소 5분 전, from은 최대 24시간 전입니다. 테스트는 5분 전에 종료된 10분을 요청합니다.

    SIGSCI_EMAIL="your-email@example.com"
    SIGSCI_TOKEN="your-api-token"
    SIGSCI_CORP="your-corp-name"
    SIGSCI_SITE="your-site-name"
    
    UNTIL=$(( ($(date +%s) - 300) / 60 * 60 ))
    FROM=$(( UNTIL - 600 ))
    curl -sS -o feed-test.json -w "HTTP %{http_code}\n" \
        -H "x-api-user: ${SIGSCI_EMAIL}" \
        -H "x-api-token: ${SIGSCI_TOKEN}" \
        "https://dashboard.signalsciences.net/api/v0/corps/${SIGSCI_CORP}/sites/${SIGSCI_SITE}/feed/requests?from=${FROM}&until=${UNTIL}"
    head -c 500 feed-test.json; echo
    

사용자 인증 정보가 작동하면 출력이 HTTP 200로 시작되고 feed-test.json에는 data 배열이 포함됩니다. 이 배열은 사이트에 10분 동안 플래그가 지정된 요청이 없는 경우 비어 있을 수 있습니다. HTTP 401는 이메일 또는 토큰이 잘못되었음을 의미합니다. Invalid timestamp param가 포함된 HTTP 400는 from 또는 until 값이 위의 제한사항을 위반했음을 의미합니다.

Cloud Run Functions의 서비스 계정 만들기

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

서비스 계정 만들기

  1. Google Cloud 콘솔에서 IAM 및 관리자 > 서비스 계정으로 이동합니다.
  2. 서비스 계정 만들기를 클릭합니다.
  3. 다음 구성 세부정보를 제공합니다.
    • 서비스 계정 이름: sigsci-waf-collector-sa을 입력합니다.
    • 서비스 계정 설명: Service account for Cloud Run function to collect Fastly Next-Gen WAF 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 버킷에 대한 IAM 권한 부여

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

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

Pub/Sub 주제 만들기

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

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

로그를 수집하는 Cloud Run 함수 만들기

Cloud Run 함수는 Cloud Scheduler의 Pub/Sub 메시지에 의해 트리거되어 Fastly 차세대 WAF API에서 요청 피드 데이터를 가져오고 로그를 Cloud Storage에 기록합니다.

  1. Google Cloud 콘솔에서 Cloud Run으로 이동합니다.
  2. 서비스 만들기를 클릭합니다.
  3. 함수(인라인 편집기를 사용하여 함수 만들기)를 선택합니다.
  4. 구성 섹션에서 다음 구성 세부정보를 제공합니다.

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

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

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

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

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

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

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

    1. 변수 및 보안 비밀을 클릭합니다.
    2. 각 환경 변수에 대해 + 변수 추가를 클릭합니다.
    변수 이름 예시 값 설명
    GCS_BUCKET sigsci-waf-logs Cloud Storage 버킷 이름
    GCS_PREFIX sigsci-waf 로그 파일의 프리픽스
    STATE_KEY sigsci-waf/state.json 상태 파일 경로
    SIGSCI_EMAIL your-email@example.com Signal Sciences API 이메일
    SIGSCI_TOKEN your-api-token Signal Sciences API 토큰
    SIGSCI_CORP your-corp-name Signal Sciences corp 닉네임
    SIGSCI_SITE your-site-name Signal Sciences 사이트 닉네임
    MAX_RECORDS 10000 실행당 최대 레코드 수
    PAGE_SIZE 1000 페이지당 레코드(최대 1,000개)
    LOOKBACK_HOURS 24 초기 대상 기간
  12. 변수 및 보안 비밀 섹션에서 요청으로 아래로 스크롤합니다.

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

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

    • 최소 인스턴스 수: 0를 입력합니다.
    • 최대 인스턴스 수: 1을 입력합니다.
  15. 만들기를 클릭합니다.

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

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

함수 코드 추가

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

    • main.py:
    import functions_framework
    from google.api_core import exceptions as gcs_exceptions
    from google.cloud import storage
    import json
    import os
    import time
    from datetime import datetime, timedelta, timezone
    from urllib.parse import parse_qs, urlencode, urlsplit
    import urllib3
    
    http = urllib3.PoolManager(retries=False)
    storage_client = storage.Client()
    
    API_HOST = 'https://dashboard.signalsciences.net'
    # The request feed only serves full minutes that ended at least 5 minutes ago
    # and are no older than 24 hours and 5 minutes.
    FEED_DELAY = timedelta(minutes=5)
    FEED_MAX_AGE = timedelta(hours=24)
    RETRY_STATUSES = (429, 500, 502, 503, 504)
    
    class FeedApiError(Exception):
      """The request feed API returned an error that must stop the run."""
    
    class WindowTooLarge(Exception):
      """The records of one window do not fit in MAX_WINDOW_MB."""
    
    @functions_framework.cloud_event
    def main(cloud_event):
      """Fetch the Fastly Next-Gen WAF request feed and write it to GCS, one object per time window."""
      bucket_name = os.environ['GCS_BUCKET']
      prefix = os.environ.get('GCS_PREFIX', 'sigsci-waf').strip('/')
      state_key = os.environ.get('STATE_KEY', 'sigsci-waf-state.json')
      corp = os.environ['SIGSCI_CORP']
      site = os.environ['SIGSCI_SITE']
      headers = {
        'x-api-user': os.environ['SIGSCI_EMAIL'],
        'x-api-token': os.environ['SIGSCI_TOKEN'],
        'Accept': 'application/json',
        'User-Agent': 'GoogleSecOps-SignalSciencesWAFCollector/2.0',
      }
      lookback_hours = int(os.environ.get('LOOKBACK_HOURS', '1'))
      window = timedelta(minutes=int(os.environ.get('WINDOW_MINUTES', '10')))
      max_window_bytes = int(float(os.environ.get('MAX_WINDOW_MB', '200')) * 1024 * 1024)
      http_timeout = int(os.environ.get('HTTP_TIMEOUT', '60'))
      max_retries = int(os.environ.get('MAX_RETRIES', '5'))
      run_budget = int(os.environ.get('RUN_BUDGET_SECONDS', '480'))
    
      feed_path = f'/api/v0/corps/{corp}/sites/{site}/feed/requests'
      bucket = storage_client.bucket(bucket_name)
      state, generation = load_state(bucket, state_key)
      deadline = time.monotonic() + run_budget
    
      now = datetime.now(timezone.utc)
      latest_until = minute_floor(now - FEED_DELAY)
      oldest_from = minute_floor(now) - FEED_MAX_AGE
      start = resume_point(state) or minute_floor(now - timedelta(hours=lookback_hours))
      if start < oldest_from:
        print(f'WARNING: Records from {start.isoformat()} to {oldest_from.isoformat()} are older than '
            f'24 hours and can no longer be read from the request feed. Continuing from {oldest_from.isoformat()}.')
        start = oldest_from
    
      windows_done = 0
      while start < latest_until and time.monotonic() < deadline:
        end = min(start + window, latest_until)
        while True:
          try:
            written = write_window(bucket, prefix, feed_path, headers, start, end,
                        max_window_bytes, http_timeout, max_retries)
            break
          except WindowTooLarge:
            if end - start <= timedelta(minutes=1):
              raise RuntimeError(
                f'The records from {start.isoformat()} to {end.isoformat()} exceed MAX_WINDOW_MB. '
                'Increase MAX_WINDOW_MB and the function memory.')
            end = start + max(timedelta(minutes=1), minute_floor_delta((end - start) / 2))
            print(f'Window too large, retrying with {start.isoformat()} to {end.isoformat()}')
    
        # The window is stored, so the next run starts where this one ended.
        state = {'next_from': int(end.timestamp())}
        generation = save_state(bucket, state_key, state, generation)
        print(f'{start.isoformat()} to {end.isoformat()}: {written}')
        start = end
        windows_done += 1
    
      if start < latest_until:
        print(f'Run time budget reached after {windows_done} windows. The next run continues from {start.isoformat()}.')
      else:
        print(f'Request feed is up to date until {latest_until.isoformat()} ({windows_done} windows).')
    
    def minute_floor(dt):
      return dt.replace(second=0, microsecond=0)
    
    def minute_floor_delta(delta):
      return timedelta(minutes=int(delta.total_seconds() // 60))
    
    def resume_point(state):
      """Where the previous run stopped, or None for the first run."""
      if 'next_from' in state:
        return datetime.fromtimestamp(state['next_from'], tz=timezone.utc)
      if 'last_event_time' in state:
        # State written by the previous version of this function. It recorded the
        # run time, so start 5 minutes earlier to read records it could not see yet.
        return minute_floor(datetime.fromisoformat(state['last_event_time']) - FEED_DELAY)
      return None
    
    def write_window(bucket, prefix, feed_path, headers, start, end, max_window_bytes, timeout, max_retries):
      """Write all records from [start, end) to one GCS object and return a summary."""
      blob_name = (f'{prefix}/{start:%Y/%m/%d}/'
            f'{start:%Y%m%dT%H%M%SZ}_{end:%Y%m%dT%H%M%SZ}.ndjson')
      if bucket.get_blob(blob_name) is not None:
        # A previous run stored this window but did not save the state.
        return f'already stored in {blob_name}'
    
      lines = []
      size = 0
      for record in fetch_feed(feed_path, headers, start, end, timeout, max_retries):
        line = json.dumps(record, ensure_ascii=False).encode('utf-8') + b'\n'
        size += len(line)
        if size > max_window_bytes:
          raise WindowTooLarge()
        lines.append(line)
    
      if not lines:
        return 'no records'
      try:
        # if_generation_match=0 creates the object only if it does not exist.
        bucket.blob(blob_name).upload_from_string(
          b''.join(lines), content_type='application/x-ndjson', if_generation_match=0)
      except gcs_exceptions.PreconditionFailed:
        return f'already stored in {blob_name}'
      return f'wrote {len(lines)} records to gs://{bucket.name}/{blob_name}'
    
    def fetch_feed(feed_path, headers, start, end, timeout, max_retries):
      """Yield every record of the request feed between start and end."""
      query = urlencode({'from': int(start.timestamp()), 'until': int(end.timestamp())})
      page = call_api('GET', f'{API_HOST}{feed_path}?{query}', headers, None, timeout, max_retries)
      while True:
        yield from page.get('data') or []
        next_uri = (page.get('next') or {}).get('uri') or ''
        if not next_uri:
          return
    
        parsed = urlsplit(next_uri)
        cursors = parse_qs(parsed.query).get('next')
        if parsed.scheme or parsed.netloc or parsed.path != feed_path or not cursors:
          raise FeedApiError(f'Unexpected next.uri: {next_uri}')
    
        # Later pages are requested with POST and the decoded next cursor as a form field.
        # The cursor is valid for one minute.
        page = call_api('POST', f'{API_HOST}{parsed.path}', headers,
                {'next': cursors[0]}, timeout, max_retries)
    
    def call_api(method, url, headers, form, timeout, max_retries):
      """Return the decoded JSON response, retrying throttling and server errors."""
      failures = 0
      while True:
        try:
          if form is None:
            response = http.request(method, url, headers=headers,
                        timeout=urllib3.Timeout(connect=10.0, read=timeout))
          else:
            response = http.request(method, url, headers=headers, fields=form, encode_multipart=False,
                        timeout=urllib3.Timeout(connect=10.0, read=timeout))
        except urllib3.exceptions.HTTPError as e:
          response, error = None, str(e)
    
        if response is not None and response.status == 200:
          return json.loads(response.data)
        if response is not None:
          error = f'HTTP {response.status}: {response.data[:500].decode("utf-8", errors="replace")}'
          if response.status not in RETRY_STATUSES:
            raise FeedApiError(error)
    
        failures += 1
        if failures > max_retries:
          raise FeedApiError(f'{error} (after {max_retries} retries)')
        wait = min(30, 2 ** failures)
        retry_after = response.headers.get('Retry-After', '') if response is not None else ''
        if retry_after.isdigit():
          wait = int(retry_after)
        print(f'{error}. Retry {failures}/{max_retries} in {wait}s')
        time.sleep(wait)
    
    def load_state(bucket, key):
      """Return the saved state and its object generation (0 if there is no state yet)."""
      blob = bucket.get_blob(key)
      if blob is None:
        return {}, 0
      return json.loads(blob.download_as_text()), blob.generation
    
    def save_state(bucket, key, state, generation):
      """Save the state only if no other run changed it since it was loaded."""
      blob = bucket.blob(key)
      try:
        blob.upload_from_string(json.dumps(state), content_type='application/json',
                    if_generation_match=generation)
      except gcs_exceptions.PreconditionFailed:
        raise RuntimeError(f'{key} was changed by another run; stopping to avoid duplicate collection.')
      return blob.generation
    
    • requirements.txt:
    functions-framework==3.*
    google-cloud-storage==2.*
    urllib3>=2.0.0
    
  3. 배포를 클릭하여 함수를 저장하고 배포합니다.

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

Cloud Scheduler 작업 만들기

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

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

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

일정 빈도 옵션

요청 피드는 종료 후 5분부터 24시간 후까지 매분마다 제공됩니다. 각 실행은 이전 실행이 중지된 시점부터 5분 전까지의 모든 데이터를 수집하므로 간격이 짧을수록 지연 시간이 줄어듭니다. 최소 1시간마다 작업을 실행합니다. 함수가 24시간 넘게 중지되면 24시간이 지난 레코드는 더 이상 수집할 수 없습니다.

빈도 크론 표현식 사용 사례
5분마다 */5 * * * * 대용량, 짧은 지연 시간
15분마다 */15 * * * * 검색량 보통
1시간마다 5 * * * * 표준(권장)

통합 테스트

  1. Cloud Scheduler 콘솔에서 작업을 찾습니다.
  2. 강제 실행을 클릭하여 작업을 수동으로 트리거합니다.
  3. 몇 초 동안 기다립니다.
  4. Cloud Run > 서비스로 이동합니다.
  5. sigsci-waf-collector을 클릭합니다.
  6. 로그 탭을 클릭합니다.
  7. 함수가 성공적으로 실행되었는지 확인합니다. 다음과 같은 줄을 찾습니다(10분 기간당 하나).

    2026-01-15T09:00:00+00:00 to 2026-01-15T09:10:00+00:00: wrote 42 records to gs://sigsci-waf-logs/sigsci-waf/2026/01/15/20260115T090000Z_20260115T091000Z.ndjson
    2026-01-15T09:10:00+00:00 to 2026-01-15T09:20:00+00:00: no records
    Request feed is up to date until 2026-01-15T10:00:00+00:00 (6 windows).
    
  8. Cloud Storage > 버킷으로 이동합니다.

  9. 버킷 이름(sigsci-waf-logs)을 클릭합니다.

  10. sigsci-waf/ 폴더로 이동합니다.

  11. .ndjson 파일이 YYYY/MM/DD/ 폴더 아래에 생성되었는지 확인합니다. 각 파일 이름에는 기간의 시작과 끝이 포함됩니다.

함수가 실패하면 상태를 저장하지 않고 실행이 중지되고 다음 실행에서 동일한 기간을 다시 수집합니다. 로그에서 다음을 찾습니다.

  • HTTP 401: 환경 변수에서 API 이메일과 토큰을 확인합니다.
  • HTTP 403: 계정에 Fastly Next-Gen WAF 대시보드의 관리자, 소유자 또는 관찰자 역할이 있는지 확인합니다.
  • HTTP 400 Invalid timestamp param: from 또는 until 값이 요청 피드 제한사항을 위반했습니다. 함수 코드가 이 페이지와 일치하는지 확인합니다.
  • HTTP 429, 500, 502, 503 또는 504: 함수가 최대 MAX_RETRIES회 재시도한 후 중지됩니다. 다음 실행에서 기간을 다시 시도합니다.
  • can no longer be read from the request feed: 함수가 24시간 넘게 실행되지 않았습니다. 24시간이 지난 레코드는 더 이상 요청 피드에서 사용할 수 없습니다.
  • exceed MAX_WINDOW_MB: 1분 분량의 레코드가 MAX_WINDOW_MB보다 큽니다. MAX_WINDOW_MB 및 함수 메모리를 늘립니다.
  • was changed by another run: 두 실행이 겹쳤습니다. 최대 인스턴스 수가 1인지 확인합니다.
  • KeyError: 필수 환경 변수가 누락되었습니다.

Fastly 차세대 WAF 로그를 수집하도록 Google SecOps에서 피드 구성

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

    chronicle-12345678@chronicle-gcp-prod.iam.gserviceaccount.com
    
  8. 이 이메일 주소를 복사합니다.

  9. 다음을 클릭합니다.

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

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

      gs://sigsci-waf-logs/sigsci-waf/
      
      • 다음과 같이 바꿉니다.
        • sigsci-waf-logs: Cloud Storage 버킷 이름입니다.
        • sigsci-waf: 로그가 저장되는 선택적 프리픽스/폴더 경로입니다(루트의 경우 비워 둠).
    • 소스 삭제 옵션: 환경설정에 따라 삭제 옵션을 선택합니다.

      • 삭제 안함: 전송 후 파일을 삭제하지 않습니다(테스트에 권장).
      • 전송된 파일 삭제: 전송이 완료된 후 파일을 삭제합니다.
      • 전송된 파일 및 빈 디렉터리 삭제: 전송이 완료된 후 파일과 빈 디렉터리를 삭제합니다.

    • 최대 파일 기간: 지난 며칠 동안 수정된 파일을 포함합니다(기본값은 180일).

    • 애셋 네임스페이스: 애셋 네임스페이스

    • 수집 라벨: 이 피드의 이벤트에 적용할 라벨입니다.

  11. 다음을 클릭합니다.

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

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

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

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

UDM 매핑 테이블

로그 필드 UDM 매핑 로직
message_data metadata.description 직접 매핑됨
created metadata.event_timestamp ISO8601(으)로 파싱됨
timestamp metadata.event_timestamp RFC 3339(으)로 파싱됨
event_type metadata.event_type 직접 매핑됨
has_target metadata.event_type 매핑됨: true → NETWORK_HTTP, false → STATUS_UPDATE
label metadata.ingestion_labels 병합됨
eventType metadata.product_event_type 직접 매핑됨
proto network.application_protocol 매핑됨: HTTP/1.1 → HTTP
protocol network.application_protocol 매핑됨: HTTP/1.1 → HTTP
details.method network.http.method 직접 매핑됨
method network.http.method 직접 매핑됨
details.uri network.http.referral_url 직접 매핑됨
msgData.detailLink network.http.referral_url 직접 매핑됨
uri network.http.referral_url 직접 매핑됨
respcode network.http.response_code 이름 변경/매핑됨
responseCode network.http.response_code 이름 변경/매핑됨
details.userAgent network.http.user_agent 직접 매핑됨
msgData.sites network.http.user_agent 직접 매핑됨
userAgent network.http.user_agent 직접 매핑됨
resSize network.received_bytes 이름 변경/매핑됨
responseSize network.received_bytes 이름 변경/매핑됨
details.tlsCipher network.tls.cipher 직접 매핑됨
tlsCipher network.tls.cipher 직접 매핑됨
O network.tls.client.certificate.issuer 이름 변경/매핑됨
details.tlsProtocol network.tls.version 직접 매핑됨
tlsProtocol network.tls.version 직접 매핑됨
details.serverHostname principal.asset.hostname 직접 매핑됨
serverHostname principal.asset.hostname 직접 매핑됨
details.serverName principal.asset.network_domain 직접 매핑됨
serverName principal.asset.network_domain 직접 매핑됨
details.serverHostname principal.hostname 직접 매핑됨
serverHostname principal.hostname 직접 매핑됨
details.id principal.process.pid 직접 매핑됨
id principal.process.pid 직접 매핑됨
security_result_headin security_result 병합됨
security_result_headout security_result 병합됨
security_result_tag security_result 병합됨
sec_res_headOut security_result.about.resource.attribute.labels 병합됨
sec_res_headin security_result.about.resource.attribute.labels 병합됨
security_result_action security_result.action 병합됨
msgData.conditions security_result.description 직접 매핑됨
detector_field security_result.detection_fields 병합됨
link_field security_result.detection_fields 병합됨
location_field security_result.detection_fields 병합됨
redaction_field security_result.detection_fields 병합됨
type_field security_result.detection_fields 병합됨
value_field security_result.detection_fields 병합됨
msgData.reason security_result.summary 직접 매핑됨
details.remoteHostname target.asset.hostname 직접 매핑됨
remoteHostname target.asset.hostname 직접 매핑됨
remoteIP target.asset.ip 병합됨
target_ip target.asset.ip 병합됨
details.remoteHostname target.hostname 직접 매핑됨
remoteHostname target.hostname 직접 매핑됨
remoteIP target.ip 병합됨
target_ip target.ip 병합됨
client_port target.port 직접 매핑됨
changes_label target.resource.attribute.labels 병합됨
msgData.name target.resource.name 직접 매핑됨
URI target.url 직접 매핑됨
username target.user.user_display_name 직접 매핑됨
userid target.user.userid 직접 매핑됨
해당 사항 없음 metadata.event_type 상수: NETWORK_HTTP
해당 사항 없음 metadata.product_name 상수: Signal Sciences WAF
해당 사항 없음 metadata.vendor_name 상수: Signal Sciences
해당 사항 없음 network.application_protocol 상수: HTTP

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