> 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를 지원하도록 저장소를 구성합니다.
* CircleCI가 저장소에 커밋하는 디택션 콘텐츠를 Panther 인스턴스에 자동으로 업로드하도록 구성합니다.

참고 [Panther Content용 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 브랜치에 커밋하는 디택션 콘텐츠를 테스트하고 업로드하려면 `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:
             이름: 디택션 콘텐츠 업로드
             # (선택 사항) 아래 명령에 `--filter Enabled=true`를 추가하면 Enabled 디택션만 업로드할 수 있습니다
             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` 가 올바른 인증을 허용하도록 설정되었는지 확인합니다.

{% hint style="info" %}
저장소에 [예약된 프롬프트](/ko/panther/detections-repo/pat/managing-scheduled-prompts.md), API 토큰에는 `ManageScheduledPrompts` 권한(그리고 `AIRunAsModify` 어떤 프롬프트의 `RunAsUser` 가 토큰과 다를 경우).
{% endhint %}

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

   <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. 왼쪽 탐색 메뉴에서 **Environment Variables**.
5. 클릭합니다 **Add Environment Variable**를 추가하고 `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.
