> 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) 가 가장 좋은 옵션입니다. 이 모델에서는 로컬 저장소 설정이 내부 콘텐츠에 대한 접근 권한을 제어합니다.

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

리포지토리의 공개 포크를 만드는 방법은 다음을 참조하세요 [공개 포크](/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가 풀 리퀘스트를 생성하고 승인하도록 허용**.
   3. 다음을 클릭합니다: **저장**.
4. 로컬에서 비공개 리포지토리를 복제하고, 새 브랜치를 만든 뒤, 기존의 **룰s/** 디렉터리:
   1. `git checkout -b feat/my_first_branch`
   2. `mkdir 룰s/my_local_룰s`
5. 샘플 룰 추가:
   1. 다음에서 **템플릿/**, 다음을 찾습니다 **example\_룰.py** 그리고 **example\_룰.yml.**
   2. 다음 위치에 복사하세요 **룰s/my\_local\_룰s/**.
      1. `cp templates/example_룰.* 룰s/my_local_룰s`
6. 다음을 실행하세요. `make venv` 그런 다음 실행하세요 `make test` 로컬 Python 환경을 설정하고 테스트 스위트를 실행하기 위해.
   * 파일을 변경하지 않았다면, 다음과 비슷한 오류가 표시됩니다: `키 'LogTypes' 오류: LOG_TYPE_REGEX가 '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: 새 예제 룰s"`
   3. `git push origin` \``` git rev-parse --abbrev-ref HEAD` ``
      * 이 명령은 출력에 링크를 제공합니다.
9. 이전 단계의 출력에 있는 링크를 사용하여 `git push` 브랜치에 대한 pull request를 생성하세요.
10. pull request를 병합하고 필요하면 브랜치를 삭제하세요.

## 업스트림 panther-analysis 업데이트와 개인 클론을 동기화 상태로 유지하기

업스트림 변경 사항과 동기화를 유지하려면 [업스트림에서 Panther Analysis 동기화](https://github.com/panther-labs/panther-analysis/blob/main/.github/workflows/sync-from-upstream.yml) 정기적으로 panther-analysis의 최신 변경 사항으로 저장소의 기본 브랜치를 대상으로 pull request를 여는 GitHub Action입니다.

이 Action을 구성하려면:

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

{% hint style="warning" %}
이 단계를 건너뛰면 업스트림 저장소에 다음 항목 내 변경 사항이 있을 때마다 `.github/workflows` 디렉터리에서 Action이 PR을 여는 데 실패합니다.
{% endhint %}

3. Action을 처음 실행하여 포크를 업스트림 저장소와 동기화하려면, GitHub의 저장소에서 **Actions** > **업스트림에서 Panther Analysis 동기화**.
4. 다음을 클릭합니다: **Run Workflow > Run workflow.**
   * 작업이 완료되면 워크플로 실행 옆에 초록색 원이 표시됩니다. 변경 사항이 있으면 GitHub Actions가 작성한 새 열린 pull request가 표시됩니다. 변경 사항이 없으면 “로컬 저장소가 이미 최신 릴리스와 동기화되었습니다.”와 비슷한 메시지가 표시됩니다.
   * 해당 **업스트림에서 Panther Analysis 동기화** 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.
