> For the complete documentation index, see [llms.txt](https://docs.panther.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.panther.com/ko/enrichment/custom/examples.md).

# 사용자 지정 보강 예시

다음은 디택션에 커스텀 enrichment를 사용하는 예시입니다.

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

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

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

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

회사에서 허용한 CIDR 블록 목록이 들어 있는 `.csv` 파일(예: `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. 연결된 로그 유형 페이지에서 Log Type과 Selectors를 선택하세요.
   * 이 예시에서는 `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
       유형: 문자열
       validate:
         cidr: "ipv6" 
         
     # 유효한 ipv4 IP 주소를 허용합니다. 예: 100.100.100.100/00
     - name: address
       유형: 문자열
       validate:
         cidr: "ipv4"  
     ```
4. 파일을 끌어다 놓거나 클릭 **파일 선택** 하여 가져올 CIDR 블록 목록 파일을 선택하세요. 파일은 `.csv` 또는 `.json` 형식이어야 합니다. 지원되는 최대 파일 크기는 5MB입니다.
5. 파일 가져오기에 성공한 후 **데이터 탐색기에서 보기** 를 클릭해 해당 테이블 데이터를 조회하거나 **설정 완료** 를 클릭해 커스텀 Enrichment 목록으로 돌아가세요.

![](/files/1b8a1c46089be4cbe7520d20410b95a75ad62d13)

#### 디택션 작성하기

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

{% 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 %}

**참고**: CIDR [검증](#set-up-a-lookup-table-with-the-cidr-list) 이 예시의 Enrichment 스키마에 적용하면 시스템이 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 # 문자열
Enabled: true # bool
Description: Enrichment 설명 # 문자열(선택 사항)
FileName: ./relative/path/to/content.csv # 문자열(선택 사항)
Reference: 선택 가능한 참조 링크 # 문자열(선택 사항)
Schema: Custom.Simple.Cidr # 문자열(이미 존재해야 함)
LogTypeMap:
  PrimaryKey: network # 문자열
  AssociatedLogTypes: # [...]
    - LogType: Aws.CloudTrail # 문자열
      Selectors: # [문자열]
        - 'p_any_ip_addresses'
    - LogType: Aws.VPCFlow
      Selectors:
        - 'p_any_ip_addresses'
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
