# Panther API

## 개요

Panther는 [REST API](/ko/panther/api/rest.md) 와 [GraphQL-over-HTTP API](/ko/panther/api/graphql.md)를 제공합니다. 두 API를 모두 살펴보려면 Panther Console의 [API Playground](/ko/panther/api/api-playground.md) 를 사용할 수 있습니다. API 호출을 하기 전에 [API 토큰을 생성해야 합니다](#how-to-create-a-panther-api-token).

다음을 확인하세요 [REST API 스키마는 여기에서](/ko/panther/api/rest.md#discover-the-panther-rest-api-schema)를, 그리고 [GraphQL 스키마는 여기에서](/ko/panther/api/graphql.md#discover-the-panther-graphql-schema).

### 지원되는 작업

Panther API는 보안 워크플로를 구축할 수 있도록 해주는, 계속 확장되는 작업 집합을 지원합니다:

| <p><a href="/pages/190c139b49e54271b832cb151f3436cc65bf00dc">REST API</a></p><ul><li><a href="/pages/eac02575dde3bdcdc4f7aad128ae8ebe2b07984b">알러트</a></li><li><a href="/pages/3184d4c9a94bbc004040df496568fff73d215539">알러트 댓글</a></li><li><a href="/pages/d196290f5da605415597501eb7c8649d5638f602">API 토큰</a></li><li><a href="/pages/31068d75b7c605506a32b20d1c127518311e43fc">클라우드 계정</a></li><li><a href="/pages/77015945072824cb7bcab68a8c2d87c137a226c3">데이터 모델</a></li><li><a href="/pages/7d133d238307c7cd23bc28c3024545d0f5e7e64c">글로벌</a></li><li><a href="/pages/eba1a16e59baf5514a45f0e7603076d4d15a57f7">로그 소스</a></li><li><a href="/pages/d1fa74b6597a7130ea3b0b38dee4cb3e34624b9c">쿼리</a></li><li><a href="/pages/d7a63c26cb87930d882db76391dd1cf6ac669fb8">역할</a></li><li><a href="/pages/387fc4b40a02105b587a1d99412704ac717959df">규칙</a></li><li><a href="/pages/4d24cd09421da3a63622578bd25e569a85895319">예약 규칙</a></li><li><a href="/pages/1ff7dac64583794e258e78113a270c9aee041ad9">단순 규칙</a></li><li><a href="/pages/c7c6782fe88262aea7e254cb518c4df080b312b4">정책</a></li><li><a href="/pages/2684388e02d4369b7f9f817f4635180f1865d43b">사용자</a></li></ul> | <p><a href="/pages/1ead32d7147fdf0b5145f03ce2a585ec71597052">GraphQL API</a></p><ul><li><a href="/pages/1ce1941f48cf9fa5271c3d789f099b647ae06956">알러트 및 오류</a></li><li><a href="/pages/2623c01998c576e208071205b497a5f1a60aa952">클라우드 계정 관리</a></li><li><a href="/pages/f06dcfe0174773dbfcf84cae9c2104589c061bc6">데이터 레이크 쿼리</a></li><li><a href="/pages/40b4e0f73e59ed8f3d28714e6f91b705971106ae">로그 소스 관리</a></li><li><a href="/pages/7a8e320ca6b3cf93e59e00d66c0df822826b169d">메트릭</a></li><li><a href="/pages/398053b91812a7ccc6170097e0cf7729005a9535">토큰 회전</a></li><li><a href="/pages/dfd7df422eb1b0a2a687ba3dec1125becf2572b5">사용자 및 역할 관리</a></li></ul> |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

## Panther API 토큰을 만드는 방법

{% hint style="info" %}
API 토큰을 성공적으로 생성한 후에는 정기적으로 회전하는 것을 잊지 마세요. 아래의 [API 토큰 회전](#rotating-api-tokens)에서 토큰 회전 방법을 확인하세요.
{% endhint %}

1. Panther Console 오른쪽 상단에서 톱니바퀴 아이콘을 클릭한 다음, 드롭다운 메뉴에서 **API 토큰**.
2. 클릭하세요 **API 토큰 만들기**.\
   ![The image shows the API Tokens page in the Panther Console. The screen says "You haven't created any tokens yet" and there is a red circle around the "Create an API Token" button at the bottom.](/files/85af168f5f28902b0b187cccf092b9b2d407ff21)
   * 토큰이 이미 존재하면 **새 토큰 만들기**.
3. 다음을 제공하세요 **이름**을 입력한 다음 이 토큰에 부여할 권한을 선택하세요.
   * 각 [REST API](/ko/panther/api/rest.md) 엔터티의 페이지에서 각 작업에 필요한 권한을 찾을 수 있습니다. 자세한 내용은 [콘솔 및 API의 권한 이름](/ko/system-configuration/rbac.md#permission-names-in-the-console-and-api) 을 참조하세요.
   * 다음을 참조하세요 [여기에서 각 Panther Analysis Tool(PAT) 명령에 필요한 권한](/ko/panther/detections-repo/pat/pat-commands.md#permissions-required-per-command).
4. 다음에서 **IP 제한** 섹션의 **CIDR 블록** 필드에, 토큰 사용을 제한하려는 IP 주소를 하나 이상 입력하세요. 해당되는 경우에만 입력합니다.
   * IP 주소를 CIDR 표기법으로 입력하세요. 예: `10.0.0.0/8` 또는 `8.8.8.8/32`.
   * IP 주소를 지정하지 않으면 모든 IP 주소에서 토큰을 사용할 수 있습니다.
5. 클릭하세요 **API 토큰 만들기**.
   * 성공 화면이 표시되며 API 토큰 값이 나타납니다. 이 값은 다시 표시되지 않으므로 복사하여 안전한 위치에 저장하세요.
   * 선택 사항으로 [새 API 토큰이 작동하는지 확인](#validating-your-api-token).

<figure><img src="/files/10d7f85dd14f3759a1d79d54e68e19114c4935d1" alt="The image shows the success screen after you create an API Key. At the top, it says &#x22;API Key Created&#x22;. There is a drawing of two people holding up a green checkmark. The API Key in this screen shot is blurred out. Beneath the key there is a blue button labeled &#x22;Done.&#x22;" width="375"><figcaption></figcaption></figure>

### API 토큰 검증

{% hint style="info" %}
API 토큰을 추가한 후 30\~60초의 전파 지연이 있을 수 있습니다.
{% endhint %}

API 토큰을 생성한 후에는 API Playground 또는 PAT를 사용해 작동 여부를 확인할 수 있습니다:

{% tabs %}
{% tab title="API Playground" %}
Panther Console의 API Playground에서 API 토큰을 테스트하려면:

1. API 토큰 생성 성공 화면에서 **Playground에서 사용해 보기**.
2. Playground 화면 왼쪽 하단에서 **REQUEST HEADERS** 탭을 찾으세요. 이 탭 아래에서 `X-API-Key` 헤더의 기본값을 `<ENTER_YOUR_KEY_HERE>` 에서 API 토큰 값으로 변경하세요.
3. 왼쪽 상단의 "재생" 아이콘을 눌러 테스트를 실행하세요.

<figure><img src="/files/8a7c136e9a7cbbec28fb27e19abb27981cc2ac20" alt="The image shows the API Playground from the Panther Console. At the top, a play icon button is circled. On the left, a code box contains an example query. Beneath that, the header &#x22;Request Header&#x22; is circled. On the right, there is a section labeled &#x22;Documentation Explorer&#x22;." width="563"><figcaption></figcaption></figure>
{% endtab %}

{% tab title="PAT" %}
{% hint style="warning" %}
테스트를 수행하려면 [PAT가 설치되어 있어야 합니다](/ko/panther/detections-repo/pat/install-configure-and-authenticate-with-pat.md) .
{% endhint %}

CLI에서 [PAT](/ko/panther/detections-repo/pat.md) 를 사용하여 API 토큰을 테스트하려면:

* 다음을 실행하세요 `pipenv run pat check-connection --api-token <your-api-token> --api-host <your-api-host>`.
  {% endtab %}
  {% endtabs %}

### API 토큰 회전

API 토큰은 Panther의 공개 API에 대한 인증 및 접근 권한 부여에 사용됩니다. 사용자 이름과 비밀번호 자격 증명과 마찬가지로, 악의적인 행위자로부터 보호하기 위해 API 토큰은 안전하게 저장해야 합니다. 토큰을 주기적으로 회전하면 유출될 가능성을 줄일 수 있습니다. CIS( Center for Internet Security )와 NIST(National Institute of Standards and Technology)는 API 토큰을 90일마다 회전할 것을 권장합니다.

Panther Console에서 또는 Panther API 자체를 호출하여 API 토큰을 회전할 수 있습니다. 토큰을 회전하면 이전 토큰은 더 이상 유효하지 않습니다.

{% tabs %}
{% tab title="Panther Console" %}
**Panther Console에서 API 토큰 회전**

Panther Console에서 API 토큰을 회전하려면:

1. Panther Console 오른쪽 상단에서 톱니바퀴 아이콘을 클릭한 다음 **API 토큰**.
2. 회전할 토큰을 찾으세요. 해당 타일의 오른쪽 상단에서 점 3개 아이콘을 클릭한 다음 **회전**.

   <figure><img src="/files/c16cc927d5c61e2b558740401650b4dba95b4309" alt="The API Tokens page in the Console shows a token called &#x22;Example Key.&#x22; It has info about who created and modified the token, as well as when it expires. The three dot menu is open, and three options are displayed: Edit, Rotate, and Delete."><figcaption></figcaption></figure>
3. 표시되는 확인 모달에서 **계속**.\
   ![A modal titled "Rotate Example Key" asks the user if they're sure they want to refresh the key. There are Cancel and Continue buttons.](/files/67580f6bc0ac3ce5f7355031c932201c747ee4ac)
4. 모달에 새 API 토큰이 표시됩니다. 이 값은 한 번만 볼 수 있으므로 반드시 복사하여 안전한 위치에 저장하세요.\
   ![The key rotation modal displays the new API token. There is a note saying "Please copy it since we won't show it to you again."](/files/68743aa868f28ffe9dbd8fcd1a6a7a98d5d31203)
   {% endtab %}

{% tab title="REST API" %}
**Panther REST API를 사용하여 API 토큰 회전**

Panther REST API를 사용하여 API 토큰을 회전할 수 있습니다. API 토큰은 다음을 사용해 자체적으로 회전합니다. `POST api-tokens/self/rotate` 엔드포인트. 자세한 내용은 [API 토큰](/ko/panther/api/rest/api-tokens.md).
{% endtab %}

{% tab title="GraphQL API" %}
**Panther GraphQL API를 사용하여 API 토큰 회전**

다음 작업과 함께 Panther GraphQL API를 사용하여 API 토큰을 회전할 수 있습니다. `rotateAPIToken` 엔드포인트를 사용하는 방법에 대해 자세히 알아보세요. [토큰 회전](/ko/panther/api/graphql/token-rotation.md).
{% endtab %}
{% endtabs %}

## Panther API 문제 해결

Panther Knowledge Base를 방문하여 [Panther API 관련 문서를 확인하세요](https://help.panther.com/Panther_Developer_Workflows/Panther_API) 자주 묻는 질문에 답하고 일반적인 오류와 문제를 해결하는 데 도움이 됩니다.


---

# Agent Instructions: 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:

```
GET https://docs.panther.com/ko/panther/api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
