> 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/deprecated/private-cloned-repo.md).

# 비공개 클론

Panther가 관리하는 Python 디택션을 귀하의 [CI/CD 워크플로에서 활용하는 한 가지 방법은](/ko/panther/detections-repo/ci-cd.md) 다음의 비공개 클론 저장소를 만드는 것입니다 [panther-analysis](https://github.com/panther-labs/panther-analysis).

조직이 디택션 및 기타 관련 Panther 설정을 비공개로 유지하고자 한다면, 다음의 비공개 클론 저장소가 [panther-analysis](https://github.com/panther-labs/panther-analysis) 최선의 선택입니다. 이 모델에서는 로컬 저장소 설정이 내부 콘텐츠에 접근할 수 있는 사용자를 제어합니다.

아래에 설명된 대로 비공개 클론 저장소를 구성한 후에는 브랜치를 만들고 pull request를 활용하여 디택션 집합에 대한 사용자 지정을 반영할 수 있습니다.

저장소의 공개 fork를 만드는 방법은 다음을 참조하세요 [공개 Fork](/ko/panther/detections-repo/setup/deprecated/public-fork.md).

{% hint style="info" %}
새로운 [태그가 지정된 릴리스](https://github.com/panther-labs/panther-analysis/releases). 또한 다음에서 가져올 수도 있습니다 [main 브랜치](https://github.com/panther-labs/panther-analysis/tree/main). 다른 브랜치는 안정적이라고 간주해서는 안 됩니다.
{% endhint %}

## panther-analysis 저장소의 비공개 클론 구성

현재 지원되는 기능을 기반으로 권장하는 구성은 다음과 같습니다.

1. GitHub에서 비공개 저장소를 만드세요.
   * 방법은 다음을 참조하세요 [GitHub 문서: 저장소 만들기](https://docs.github.com/en/get-started/quickstart/create-a-repo). 저장소의 공개 범위를 설정할 때 다음을 선택하세요 **비공개**.
   * 기본 설정을 유지하세요. 저장소를 어떤 콘텐츠로도 초기화하지 마세요.
2. 클론 [panther-analysis](https://github.com/panther-labs/panther-analysis) 하고 다음을 사용하세요 `git push --mirror` upstream의 git 콘텐츠와 기록으로 비공개 클론 저장소를 초기화합니다.
   1. `gh repo clone panther-labs/panther-analysis`
   2. `cd panther-analysis`
   3. `git checkout main`
   4. `git push --mirror https://github.com/your_org/your_private_repo.git`\
      저장소 미러를 유지하는 방법에 대한 자세한 내용은 다음을 참조하세요 [GitHub 문서: 저장소 복제](https://docs.github.com/en/repositories/creating-and-managing-repositories/duplicating-a-repository).
3. GitHub에서 저장소의 올바른 워크플로 권한을 활성화하세요.
   1. 비공개 저장소에서 다음으로 이동하세요 **설정** > **Actions** > **일반**.
   2. 다음 선택을 **워크플로 권한** 섹션에서:
      * 토글 **읽기 및 쓰기 권한** 으로 설정하세요.
      * 선택하세요 **GitHub Actions가 pull request를 만들고 승인하도록 허용**.
   3. 다음을 클릭합니다 **저장**.
4. 로컬에서 비공개 저장소를 클론하고, 새 브랜치를 만든 다음, 기존 **룰s/** 디렉터리:
   1. `git checkout -b feat/my_first_branch`
   2. `mkdir 룰s/my_local_룰s`
5. 샘플 룰을 추가하세요:
   1. 아래에서 **templates/**&#xC5D0;서 **example\_룰.py** 및 **example\_룰.yml.**
   2. 이를 다음으로 복사하세요 **룰s/my\_local\_룰s/**.
      1. `cp templates/example_룰.* 룰s/my_local_룰s`
6. 실행하세요 `make venv` 그런 다음 `make test` 를 실행하여 로컬 Python 환경을 설정하고 테스트 스위트를 실행합니다.
   * 파일을 변경하지 않았다면 다음과 유사한 오류가 표시됩니다: `Key 'LogTypes' error: LOG_TYPE_REGEX does not match 'LogType.Name'`
7. 이전 단계 후에 나타난 오류를 해결하세요:
   1. 변경 `LogType` 를 Panther의 알려진 로그 소스로 바꾸세요. 예를 들어 **AWS.CloudTrail** 에 **example\_룰.yml**
   2. 변경 `파일명` 안에 **example\_룰.yml** 에서 **example\_룰.py**.
8. 현재 브랜치에서 변경 사항을 원격 저장소에 커밋하세요. (`git rev-parse –abbrev-ref HEAD` 는 현재 브랜치를 제공합니다. 이 값을 직접 제공해도 됩니다.)
   1. `git add 룰s/my_local_룰s`
   2. `git commit -m "feat: new example 룰s"`
   3. `git push origin` \``` git rev-parse --abbrev-ref HEAD` ``
      * 이 명령은 출력에 링크를 제공합니다.
9. 이전 단계의 `git push` 출력에 있는 링크를 사용하여 브랜치에 대한 pull request를 만드세요.
10. pull request를 병합하고 필요하면 브랜치를 삭제하세요.

## 비공개 클론을 upstream panther-analysis 업데이트와 동기화 상태로 유지하기

upstream 변경 사항과 동기화 상태를 유지하려면 다음을 사용하는 것이 좋습니다 [Sync Panther Analysis from Upstream](https://github.com/panther-labs/panther-analysis/blob/main/.github/workflows/sync-from-upstream.yml) 이 GitHub Action은 주기적으로 panther-analysis의 최신 변경 사항을 포함한 pull request를 저장소의 기본 브랜치에 대해 엽니다.

이 Action을 구성하려면:

1. 다음 권한이 있는 GitHub 토큰을 만드세요:
   * `관리 - 읽기`
   * `콘텐츠 - 읽기 및 쓰기`
   * `메타데이터 - 읽기`
   * `Pull Requests - 읽기 및 쓰기`
   * `Workflows - 읽기 및 쓰기`
2. 포크한 저장소에 다음 이름의 새 시크릿을 추가하세요 `PANTHER_SYNC_UPSTREAM` 그리고 값을 이전 단계에서 만든 토큰으로 설정하세요.

{% hint style="warning" %}
이 단계를 건너뛰면 upstream 저장소의 `.github/workflows` 디렉터리에 변경 사항이 생길 때마다 Action이 PR 열기에 실패합니다.
{% endhint %}

3. Action을 처음 실행하고 fork를 upstream 저장소와 동기화하려면, GitHub의 저장소에서 다음을 클릭하세요 **Actions** > **Sync Panther Analysis from Upstream**.
4. 다음을 클릭합니다 **Run Workflow > Run workflow.**
   * 작업이 완료되면 workflow run 옆에 초록색 원이 표시됩니다. 변경 사항이 있으면 GitHub Actions가 작성한 새 열린 pull request가 표시됩니다. 변경 사항이 없으면 “Local repo already synced to latest release.”와 유사한 메시지가 표시됩니다.
   * 다음 **Sync Panther Analysis from Upstream** Action은 매주 화요일 15:00Z에 실행되도록 cron 일정으로 구성되어 있습니다. 이 일정은 다음의 6번째 줄에서 수정할 수 있습니다 `.github/workflows/sync-from-upstream.yml`.
5. 일반 pull request처럼 pull request를 기본 브랜치에 병합하세요.

저장소에는 병합이 최신 변경 사항으로 반영되며, 비공개 저장소와 panther-analysis의 git 기록을 둘 다 볼 수 있습니다.

병합 충돌 문제가 발생하거나 "all jobs have failed," 오류가 표시되면 다음 문제 해결 문서를 참조하세요: [GitHub Action sync-panther-analysis-from-upstream를 사용할 때 병합 충돌과 실패한 동기화를 어떻게 해결하나요?](https://help.panther.com/Panther_Developer_Workflows/panther-analysis/How_do_I_resolve_merge_conflicts_and_failed_syncs_when_using_the_GitHub_Action_sync-panther-analysis-from-upstream%3F)

## 다음 단계

저장소를 클론한 후에는 Panther 디택션을 CI/CD 워크플로에 통합할 수 있습니다. 다음 문서를 참조하세요 [CircleCI](/ko/panther/detections-repo/ci-cd/deployment-workflows/circle-ci.md) 및 [GitHub Actions](/ko/panther/detections-repo/ci-cd/deployment-workflows/github-actions.md).

### GitHub Actions

자체 GitHub Action을 만들어 디택션 콘텐츠를 Panther 인스턴스로 업로드할 수 있으며, 저장소에 병합된 각 pull request마다 자동으로 실행되도록 구성할 수 있습니다.

참고 [GitHub Actions를 통한 콘텐츠 관리](/ko/panther/detections-repo/ci-cd/deployment-workflows/github-actions.md) 을 참조하세요.

### 고객 기여 콘텐츠

panther-analysis로 콘텐츠를 upstream에 다시 기여하는 것을 권장하지만,\
upstream으로 pull request를 보내는 것은 공개 저장소에서만 가능합니다. 비공개 저장소를 사용 중이며 콘텐츠를 기여하고 싶다면 Panther 지원팀에 문의하세요.


---

# 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/deprecated/private-cloned-repo.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.
