> 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/panther/detections-repo/setup.md).

# Panther 콘텐츠 리포지토리 설정

## 새 Panther 콘텐츠 저장소 만들기

### 사전 요구 사항

* Panther Analysis Tool(PAT)을 설치했습니다.

### 1단계: Panther 저장소 준비

* 빈 디렉터리에서 다음을 실행합니다. `git init` 를 실행하여 Git 저장소를 초기화한 다음 다음을 실행합니다. `pat init`.

나중에 PAT 명령을 위해 저장소를 준비합니다.

다음 `init` 명령은 빈 저장소를 초기화하고 다음의 최신 콘텐츠를 가져와 `panther-analysis` 캐시로.

### 2단계(선택 사항): 다음의 콘텐츠 살펴보기 `panther-analysis`

* 실행하세요 `pat explore`.

### 3단계: panther-analysis의 콘텐츠 사용 설정

panther-analysis의 콘텐츠(예: 디택션)를 사용 설정하려면 다음을 실행합니다. `pat install`, 하나 이상의 콘텐츠 항목을 전달합니다. 예:

* `pat install <id>`
* `pat install --filter LogTypes=AWS.CloudTrail`

### 4단계: 새 콘텐츠가 테스트를 통과하는지 확인

* 실행하세요 `pat test`.

### 5단계: 콘텐츠를 Panther에 업로드

* 실행하세요 `pat upload`.

## 레거시 저장소에서 마이그레이션

{% hint style="info" %}
기존 Panther 콘텐츠 저장소가 [에서 포크되었거나 복제되었다면 `panther-analysis`](/ko/panther/detections-repo/setup/deprecated.md), 아래 단계에 따라 새 관리 워크플로로 마이그레이션하세요.
{% endhint %}

### 1단계: Panther 저장소 준비

* Panther 콘텐츠 디렉터리에서 다음을 실행합니다. `pat init`.

### 2단계: 기존 콘텐츠 서식 지정

YAML 파일에는 특정 서식 변경이 필요합니다(예: 디택션 단위 테스트와 같은 중첩 JSON 세그먼트에서 중괄호와 대괄호 제거). 변경하려면:

* 실행하세요 `pat fmt`.

{% hint style="warning" %}
이 단계에서 변경 사항을 커밋하는 것이 권장됩니다. 왜냐하면 `pat fmt` 대량의 서식 변경이 생성되어 검토하기가 번거로울 것이기 때문입니다.
{% endhint %}

### 3단계: 기존 콘텐츠 업데이트

panther-analysis 콘텐츠를 기반으로 하는 모든 분석 항목을 다음을 추가하여 마이그레이션합니다. `BaseVersion` 필드를 추가하고 최신 panther-analysis 버전과 병합합니다. 저장소가 아직 `panther-analysis` 마이그레이션 후에도 다른 PAT 명령은 깨지지 않지만, upstream에서 동기화하지 않는 것을 권장합니다. `panther-analysis` 마이그레이션 후. 그렇게 하는 자동화는 제거해야 합니다.

* 실행하세요 `pat migrate`.

{% hint style="info" %}
참고로 `pat migrate` 는 새로운 `panther-analysis` 콘텐츠를 가져오지 않습니다. 기존 콘텐츠만 마이그레이션합니다.
{% endhint %}

### 4단계: 검토 `migration_status.md` 및 개별 병합 충돌 해결

1. 실행하세요 `less migration_status.md`.
2. (선택 사항) 만약 `migration_status.md` 미해결 병합 충돌이 있음을 나타내면, 충돌이 있는 각 항목에 대해 다음을 실행합니다. `pat migrate <ID>` 해결합니다.
   * 선택적으로 다음을 사용할 수 있습니다 `--write-merge-conflicts` PAT가 대신 병합 충돌을 파일에 쓰도록 지시할 수 있으며, 충돌 해결에 AI를 사용하거나 다음을 사용할 때 유용할 수 있습니다 `--auto-accept` 를 사용하여 자동 해결합니다.

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>이 단계가 선택 사항인 이유는 다음 단계로 진행하기 전에(즉, 충돌을 발생시킨 콘텐츠를 테스트하고 업로드하기 전에) <em>이 아니라</em> 병합 충돌을 해결할 필요가 없기 때문입니다.</p></div>
   * YAML 파일의 충돌을 해결하려면 PAT CLI 편집기를 사용합니다.
     * Python 파일의 충돌을 해결하려면 PAT CLI 편집기 또는 원하는 코드 편집기를 사용할 수 있습니다. 선호하는 코드 편집기를 지정하려면(예: `code` (VS Code), `Cursor`, `폴란드`, `GoLand` (Go), `PyCharm`), 다음 중 하나를 사용합니다:
       * 다음을 사용합니다 `--editor` 와 `pat migrate`
       * 다음을 설정하세요 `EDITOR` 환경 변수

{% hint style="info" %}
새 콘텐츠를 사용 설정하기 전에 이 단계에서 커밋하는 것도 권장됩니다.
{% endhint %}

### 5단계(선택 사항): 다음의 최신 콘텐츠 살펴보기 `panther-analysis`

* 실행하세요 `pat explore`.

### 6단계(선택 사항): 다음의 새 콘텐츠 사용 설정 `panther-analysis`

panther-analysis의 콘텐츠(예: 디택션)를 사용 설정하려면 다음을 실행합니다. `pat install`, 하나 이상의 콘텐츠 항목을 전달합니다. 다음을 실행할 필요는 없습니다 `migrate` 명령을 실행해야 한 번도 가져온 적 없는 콘텐츠를 설치할 수 있는 것은 아닙니다. 예:

* `pat install <id>`
* `pat install --filter LogTypes=AWS.CloudTrail`

### 7단계: 콘텐츠가 테스트를 통과하는지 확인

* 실행하세요 `pat test`.

### 8단계: 콘텐츠를 Panther에 업로드

* 실행하세요 `pat upload`.

### 9단계: 사용하지 않는 항목 제거 `panther-analysis` 내용

사용 중단된 관리 워크플로에서는 사용 설정 여부와 관계없이 panther-analysis의 모든 콘텐츠를 가져왔습니다. 업데이트된 워크플로에서는 실제로 사용하는 콘텐츠만 유지하면 됩니다.

이 단계에서는 환경에서 사용되지 않는 콘텐츠를 제거할 수 있습니다. 콘텐츠를 제거할 때는 반드시 다음을 실행하세요 `pat test` 를 자주 실행하여 의존성이 제거되지 않았는지 검증하세요. 디택션 콘텐츠는 종종 전역 헬퍼 및 데이터 모델에 의존하기 때문입니다.


---

# 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/panther/detections-repo/setup.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.
