> 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/ci-cd/deployment-workflows/circle-ci.md).

# CircleCI를 통한 Panther 콘텐츠 관리

## 개요

CircleCI를 구성하여 소스 저장소의 디택션 파이프라인을 자동화된 테스트에 사용하고 Panther Console로 업로드할 수 있습니다.

이 가이드는 다음 방법을 설명합니다:

* 저장소를 CircleCI를 지원하도록 구성합니다.
* 저장소에 커밋한 디택션 콘텐츠를 Panther 인스턴스로 자동 업로드하도록 CircleCI를 구성합니다.

참조 [Panther 콘텐츠용 CI/CD](/ko/panther/detections-repo/ci-cd.md) Panther와 함께 CI/CD 워크플로를 시작하는 방법에 대한 정보를 확인하세요.

## CircleCI 설정

CircleCI를 사용해 디택션 콘텐츠를 Panther 인스턴스로 업로드하려면, 저장소에 CircleCI 작업을 만든 다음 Panther API 자격 증명을 위한 환경 변수를 구성해야 합니다.

### 사전 요구 사항

* Panther Console에서 API 토큰을 생성합니다.
  * 참조 [API 토큰 생성에 대한 이 지침](/ko/panther/api.md#how-to-create-a-panther-api-token).
* 아직 CircleCI 계정이 없다면, [무료로 생성하세요](https://circleci.com/signup).

### 1단계: 디택션 저장소 설정

* Panther 디택션 콘텐츠용 저장소가 아직 설정되어 있지 않다면, 하나 만드세요. 다음 중 하나를 권장합니다: [비공개로 클론](/ko/panther/detections-repo/setup/deprecated/private-cloned-repo.md) 또는 [공개적으로 포크](/ko/panther/detections-repo/setup/deprecated/public-fork.md) Panther의 [panther-analysis 저장소](https://github.com/panther-labs/panther-analysis).

### 2단계: 저장소에 CircleCI 작업 추가

CircleCI가 커밋한 디택션 콘텐츠를 테스트하고 업로드할 수 있도록 하려면 `main` 의 `panther-analysis` 저장소에 CircleCI 작업을 만들어야 합니다.

1. 명령줄에서 비공개 로컬 저장소의 루트로 이동합니다:\
   `cd path/to/your/repository`
2. CircleCI 구성을 위한 새 디렉터리와 새 구성 파일을 만듭니다:

   `mkdir .circleci && touch .circleci/config.yml`
3. 열고 `config.yml` 다음 내용을 붙여넣습니다:

   ```yaml
   version: 2.1
   jobs:
     upload:
       docker:
         - image: 'cimg/python:3.11'
       steps:
         - checkout
         - run:
             이름: 가상 환경 설정 및 종속성 설치
             command: make venv
         - run:
             이름: 단위 테스트 실행
             command: pipenv run panther_analysis_tool test
         - run:
             이름: 디택션 콘텐츠 업로드
             # (선택 사항) Enabled가 true인 디택션만 업로드하려면 아래 명령에 `--filter Enabled=true`를 추가하세요
             command:  |
               PANTHER_API_HOST=$INTERNAL_API_HOST \
               PANTHER_API_TOKEN=$INTERNAL_API_TOKEN \
               pipenv run -- panther_analysis_tool upload
   workflows:
     panther:
       jobs:
         - upload:
             filters:
               branches:
                 only:
                   - main
   ```
4. 변경 사항을 저장소에 추가, 커밋, 푸시합니다:

   `git add . && git commit -m 'adding initial circleci configuration' && git push`

### 3단계: Panther API 자격 증명을 환경 변수로 추가

환경 변수가 `PANTHER_API_TOKEN` 및 `PANTHER_API_HOST` 올바른 인증이 가능하도록 설정되어 있는지 확인합니다.

1. 로그인하세요 [CircleCI](https://circleci.com/vcs-authorize/) 그리고 프로젝트가 속한 조직을 선택합니다.
2. 왼쪽 탐색 메뉴에서 **프로젝트를 클릭합니다.**.
3. 프로젝트 목록에서 `panther-analysis` 저장소를 찾습니다. 프로젝트 오른쪽에서 **...** 그다음 **프로젝트 설정**.

   <figure><img src="/files/7afac01ee271dcb0cff53b06603638819758cc19" alt="In the CircleCI console, the Projects screen is shown. The three dots icon has been selected on the panther-analysis project."><figcaption></figcaption></figure>
4. 왼쪽 탐색 메뉴에서 **환경 변수**.
5. 다음을 클릭합니다: **환경 변수 추가**그리고 추가합니다 `INTERNAL_API_TOKEN` 및 `INTERNAL_API_HOST`.

   <figure><img src="/files/817e3892660d56648f59b358ef24f6fab505e0ec" alt="In the CircleCI console, the Project Settings screen is shown. There is a button to &#x22;Add Environment Variable&#x22;"><figcaption></figcaption></figure>

   * CircleCI 문서의 다음 항목을 참조하세요: [환경 변수 사용](https://circleci.com/docs/env-vars) 자세한 내용은

다음을 확인하세요: [Panther Analysis Tool 명령](https://docs.panther.com/panther-developer-workflows/ci-cd/deployment-workflows/pat/pat-commands) Panther Analysis 도구에 대한 자세한 정보를 확인하세요.


---

# 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/ci-cd/deployment-workflows/circle-ci.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.
