# 사용자 지정 보강 예시

다음은 디택션에 사용자 지정 enrichment를 사용하는 예시입니다.

### 1Password UUID를 사람이 읽을 수 있는 이름으로 변환하는 예시

1Password의 범용 고유 식별자(UUID) 값을 사람이 읽을 수 있는 이름으로 변환하기 위해 사용자 지정 enrichment를 사용하는 방법에 대한 가이드를 참조하세요: [사용자 지정 Enrichment 사용: 1Password UUID](/ko/enrichment/custom/examples/1password-uuids.md).

### Panther Console을 통한 CIDR 매칭 사용 예시

**예시 시나리오:** 예를 들어, 회사 IP 공간(VPN 및 호스팅된 시스템 등)에서 발생한 트래픽 로그를 공용 IP 공간에서 발생한 다른 로그와 다르게 고려하는 디텍션을 작성하고 싶다고 해봅시다.

회사에서 허용한 CIDR 블록 목록이 들어 있는 `페이지에서 파일을 드래그 앤 드롭하거나` 파일(예: `4.5.0.0/16`):

<table><thead><tr><th width="333">cidr</th><th>description</th></tr></thead><tbody><tr><td>10.2.3.0/24</td><td>샌프란시스코 오피스</td></tr><tr><td>20.3.4.0/24</td><td>DC 오피스</td></tr><tr><td>30.4.5.0/24</td><td>보스턴 오피스</td></tr></tbody></table>

#### CIDR 목록으로 사용자 지정 enrichment 설정

1. 다음을 따르세요 [파일 업로드를 통해 사용자 지정 enrichment를 설정하는 지침](/ko/enrichment/custom.md#option-1-import-lookup-table-data-via-file-upload) 그리고 기본 정보를 구성합니다.
   * 이 예시에서 Enrichment의 이름은 `Company CIDR Blocks`.
2. 연결된 로그 유형 페이지에서 로그 유형과 선택자를 선택합니다.
   * 이 예시에서는 `AWS.VPCFlow` 로그를 사용하고 소스 IP(`srcAddr`) 및 대상(`dstAddr`) 키를 연결했습니다.\
     ![The image shows the "Associated Log Types" page while setting up Lookup Tables. There is a dropdown menu labeled Log Type, and AWS.VPCFlow is selected. In the field labeled "Selectors," it is filled in with "srcAddr" and "dstAddr."](/files/895a1f968a3fd2112b22b29fdf9075f4899cd2ee)
3. Enrichment에 대한 스키마를 연결합니다. 목록에서 기존 스키마를 선택하거나 [새 스키마를 생성](/ko/data-onboarding/custom-log-types.md#how-to-define-a-custom-schema).
   * **참고:** CIDR 블록을 보관할 기본 키 열에는 스키마에서 `CIDR` 검증이 적용되어 있어야 하며, 이는 이 enrichment가 IP 주소에 대해 CIDR 블록 매칭을 수행함을 나타냅니다. [로그 스키마 참조를 확인하세요](https://docs.runpanther.io/data-onboarding/custom-log-types/reference#validation-by-string-type).

     ```yaml
     # 유효한 ip6 CIDR 범위를 허용합니다
     # 예: 2001:0db8:85a3:0000:0000:0000:0000:0000/64
     - name: address
       type: string
       validate:
         cidr: "ipv6" 
         
     # 유효한 ipv4 IP 주소를 허용합니다. 예: 100.100.100.100/00
     - name: address
       type: string
       validate:
         cidr: "ipv4"  
     ```
4. 파일을 끌어다 놓거나 클릭하세요 **파일 선택** 하여 가져올 CIDR 블록 목록 파일을 선택합니다. 파일은 `페이지에서 파일을 드래그 앤 드롭하거나` 또는 `를 클릭하여 가져올 인리치먼트 데이터 파일을 선택하세요. 파일 형식은` 형식이어야 합니다. 지원되는 최대 파일 크기는 5MB입니다.
5. 파일을 성공적으로 가져온 후 **Data Explorer에서 보기** 를 클릭하여 해당 테이블 데이터를 쿼리하거나 **를 참조하세요.** 를 클릭하여 사용자 지정 Enrichments 목록으로 돌아갑니다.

![](/files/1b8a1c46089be4cbe7520d20410b95a75ad62d13)

#### 디텍션 작성

VPC 트래픽이 회사의 허용 CIDR 블록에 속하지 않는 소스 IP 주소에서 발생하면 알러트를 받고 싶을 수 있습니다. 다음은 이 경우 알러트를 보내는 룰의 예시입니다:

{% tabs %}
{% tab title="Python" %}

```python
def 룰(event):
  if event.get('flowDirection') == 'egress': # inbound만 중요합니다
        return False
  if event.get('action') == 'REJECT': # 이것들도 중요하지 않습니다
        return False
  if deep_get(event, 'p_enrichment','Company CIDR Blocks','srcAddr'): # 이들은 괜찮습니다
        return False 
  return True # 승인된 네트워크 범위가 아니면 알러트
```

{% endtab %}

{% tab title="간단한 디택션" %}

```yaml
디택션:
  - KeyPath: flowDirection
    Condition: DoesNotEqual
    Value: egress
  - KeyPath: action
    Condition: DoesNotEqual
    Value: REJECT
  - KeyPath: p_enrichment.'Company CIDR Blocks'.srcAddr
    Condition: DoesNotExist
```

{% endtab %}
{% endtabs %}

**참고**: 이 예시에서 Enrichment 스키마에 적용된 CIDR [검증](#set-up-a-lookup-table-with-the-cidr-list) 은 시스템이 VPC 흐름 로그의 IP 주소를 조회의 CIDR 블록과 일치시킬 수 있게 합니다.

### Panther Analysis Tool를 사용한 지리적 위치용 IP 사용 예시

직원이 어느 지리적 위치에서 접속하는지 알고 싶다고 해봅시다(예: geonames.org 같은 정보를 사용). 이 시나리오에서 회사는 CIDR을 GeoId에 매핑하는 정적 파일을 가지고 있으며, 다음 [example\_cidr\_lookup\_content.csv](https://github.com/panther-labs/panther-analysis/blob/master/templates/example_cidr_lookup_content.csv).

{% code overflow="wrap" %}

```
> curl https://raw.githubusercontent.com/panther-labs/panther-analysis/master/templates/example_cidr_lookup_content.csv

network,geoname_id
1.0.0.0/24,2077422
1.0.1.0/24,1814991
1.0.2.0/23,1814991
1.0.4.0/22,2077456
1.0.8.0/21,1814991
1.0.16.0/20,1814991
```

{% endcode %}

다음과 비슷한 YAML 스키마를 사용할 수 있습니다:

```yaml
AnalysisType: lookup_table # 항상 lookup_table
LookupName: simple_cidr_lookup # str
Enabled: true # bool
Description: Enrichment 설명 # str (선택 사항)
FileName: ./relative/path/to/content.csv # str (선택 사항)
Reference: 선택 사항인 참조 링크 # str (선택 사항)
Schema: Custom.Simple.Cidr # str (이미 존재해야 함)
Description: >
  PrimaryKey: network # str
  AssociatedLogTypes: # [...]
    - LogType: Aws.CloudTrail # str
      Selectors: # [str]
        - 'p_any_ip_addresses'
    - LogType: Aws.VPCFlow
      선택자:
        - 'p_any_ip_addresses'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.panther.com/ko/enrichment/custom/examples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
