# REST API

## 개요

Panther는 Panther 인스턴스의 특정 부분과 상호작용하기 위한 REST API를 제공합니다. 현재 REST API를 통해 다음 엔터티와 상호작용할 수 있습니다:

* [알러트](/ko/panther/api/rest/alerts.md)
* [알러트 댓글](/ko/panther/api/rest/alert-comments.md)
* [알러트 컨텍스트 태그](/ko/panther/api/rest/alert-context-tags.md)
* [API 토큰](/ko/panther/api/rest/api-tokens.md)
* [클라우드 계정](/ko/panther/api/rest/cloud-accounts.md)
* [상관관계 규칙](/ko/panther/api/rest/correlation-rules.md)
* [데이터 모델](/ko/panther/api/rest/data-models.md)
* [전역 변수](/ko/panther/api/rest/globals.md)
* [로그 소스](/ko/panther/api/rest/log-sources.md)
* [로그 소스 알람](/ko/panther/api/rest/log-source-alarms.md)
* [쿼리](/ko/panther/api/rest/queries.md)
* [역할](/ko/panther/api/rest/roles.md)
* [규칙](/ko/panther/api/rest/rules.md)
* [예약된 규칙](/ko/panther/api/rest/scheduled-rules.md)
* [단순/YAML 규칙](/ko/panther/api/rest/simple-rules.md)
* [정책](/ko/panther/api/rest/policies.md)
* [사용자](/ko/panther/api/rest/users.md)

추가 작업은 [GraphQL API](/ko/panther/api/graphql.md).

### Panther REST API 스키마 알아보기

{% tabs %}
{% tab title="OpenAPI 사양" %}
OpenAPI 사양 파일을 다운로드하여 REST API 스키마를 알아보세요:

[**다운로드 `panther-labs-api.yaml`**](https://openapi.gitbook.com/o/-LgddDaIOc7MA4mxoaPa/spec/panther-labs-api.yaml)
{% endtab %}

{% tab title="API 플레이그라운드 " %}
Panther Console의 API 플레이그라운드를 탐색하여 API 스키마를 알아볼 수 있습니다. 자세한 내용은 [API 플레이그라운드](/ko/panther/api/api-playground.md).
{% endtab %}
{% endtabs %}

## Panther REST API 사용 방법

### 1단계: Panther REST API URL 식별

REST API URL을 찾으려면:

* Panther Console의 오른쪽 상단에서 톱니바퀴 아이콘을 클릭한 다음 **API 토큰**. 페이지 상단에서 다음 항목을 확인하세요. **API URL**.

  * 다음과 같은 [SaaS](/ko/system-configuration/panther-deployment-types.md#saas) 배포 형태의 Panther를 사용하는 경우 REST URL은 아래에 표시된 부분이 됩니다:

  <figure><img src="/files/5c967cd85a35ac284feabf865e257511e23e3399" alt="An &#x22;API Tokens&#x22; section shows a blurred-out API URL"><figcaption></figcaption></figure>

  * 다음과 같은 [Cloud Connected](/ko/system-configuration/panther-deployment-types.md#cloud-connected) 또는 [자가 호스팅](/ko/system-configuration/panther-deployment-types.md#self-hosted-legacy) 배포 형태의 Panther를 사용하는 경우 URL은 아래에 표시된 부분이 됩니다(다음을 포함하여 `/v1`):

  <figure><img src="/files/41fdc70394b9ef66c36db901112463b7bb4af499" alt="An &#x22;API Tokens&#x22; section shows a blurred-out API URL"><figcaption></figcaption></figure>

{% hint style="warning" %}
모든 REST URL은 끝의 `/public/graphql` 를 제외한다는 점에 유의하세요.
{% endhint %}

### 2단계: API 토큰 생성

* 참조하십시오 [API 토큰을 만드는 방법에 대한 다음 지침](/ko/panther/api.md#how-to-create-a-panther-api-token). 각 엔터티의 페이지(이 페이지 아래에 중첩됨)에서 각 REST API 작업에 필요한 권한을 찾을 수 있습니다. 추가 정보는 [콘솔 및 API의 권한 이름](/ko/system-configuration/rbac.md#permission-names-in-the-console-and-api) 을 참조하세요.

### 3단계: Panther REST API 호출

다음 항목으로 테스트하는 것 외에도 [API 플레이그라운드](/ko/panther/api/api-playground.md) 콘솔에서 REST API를 Swagger, Postman 또는 이 문서를 사용하여 호출할 수 있습니다:

{% tabs %}
{% tab title="Swagger" %}
**Swagger를 사용하여 REST API에 액세스하기**

1. 웹 브라우저에서 [Swagger Editor](https://editor.swagger.io/).
2. 왼쪽의 코드 편집기에 위에서 찾은 Panther REST OpenAPI 사양 파일을 붙여넣습니다. [Panther REST API 스키마 알아보기](#discover-the-panther-rest-api-schema).
3. 오른쪽의 **서버 변수**아래에서 **api\_host**에 프로토콜 없이 Panther REST API URL을 입력합니다(즉, 다음을 제외하고 `https://`).\
   ![A "Server variables" section shows an api\_host](/files/1e233cfca656775365e6e684608aaad2e3601a5a)
4. 클릭 **Authorize**.\
   ![An Authorize button](/files/42021aece63812b3985233b0bfcd593be30e065f)
5. 의 **사용 가능한 인증** 모달에서:
   1. 다음 아래 **Value**에 API 토큰 값을 입력합니다.
   2. 클릭 **Authorize**.
   3. 클릭 **닫기**.\
      ![An "Available authorizations" section shows "ApiKeyAuth" section, with a "Value" field. There are "Authorize" and "Close" buttons.](/files/f189a8b13fec4fd110ee151aa4c5b85ef313d0a3)
6. 이제 API 호출을 시도할 수 있습니다:
   1. 엔드포인트를 선택한 다음 아래쪽을 가리키는 화살표를 클릭하여 확장합니다.
   2. 클릭 **Try it out**.\
      ![A  "GET /globals" section has a "Try it out" button](/files/3739e61b50eb2b3eedd73dfa0981d3864a644eed)
   3. 클릭 **실행**.
      {% endtab %}

{% tab title="Postman" %}
**Postman을 사용하여 REST API에 액세스하기**

Panther Postman 컬렉션을 가져온 다음, URL 및 API 변수로 새 환경을 만들고 요청을 시도합니다.

1. 다음을 다운로드하세요. `Panther_REST_API_postman_collection.json` 파일은 이 탭의 하단에 있습니다.
2. Postman 애플리케이션에서 **File** > **Import**.
3. 다음 `Panther_REST_API_postman_collection.json` 파일을 선택하세요.
   * 다음 아래 **Collections**에 이제 **Panther Rest API** 컬렉션이 생깁니다.
4. 클릭 **Environments**를 클릭한 다음 플러스 기호(**+**).\
   ![A "My Workspace" section has a plus button with the tooltip "Create new environment"](/files/e4d965e65b6c4c887515d9adcf12a34b6be729ca)
5. 환경 이름을 입력하세요. 예: "Panther."
6. 오른쪽 표에 다음 두 변수를 입력하세요:
   * `restHost`: **Current value**에 전체 Panther REST API URL을 입력합니다.
     * 이 값은 다음의 지침을 따라 찾을 수 있습니다. [1단계: Panther REST API URL 식별](#step-1-identify-your-panther-rest-api-url).
   * `restApiToken`: **Current value**에 Panther API 토큰을 입력합니다. 다음의 **유형** 열에서 **secret**.

     <figure><img src="/files/b43c8b0c22d93c411460b8aadfefa692384dba8d" alt="A table is shown with two rows filled in: one for restHost and one for restApiToken. There is a Type and Current value for each."><figcaption></figcaption></figure>
7. 을 선택합니다. 오른쪽 상단에서 **Save**.
8. 를 클릭합니다.
   1. 이제 요청을 시도할 수 있습니다:\ <img src="/files/583e90b0778642264c19bb57a188c20966b94154" alt="A drop-down field shows two options: &#x22;No Environment&#x22; and &#x22;Panther&#x22;" data-size="original">
   2. 클릭 **Collections**.
   3. 오른쪽 상단에서 환경 드롭다운을 클릭하고 이전 단계에서 만든 환경을 선택합니다. **Panther Rest API** 컬렉션을 확장한 다음 요청을 선택합니다.
   4. 클릭 **Send**.

{% file src="/files/b956fef919733fc37f443b9560806b41d872acc2" %}
{% endtab %}

{% tab title="이 문서" %}
**Panther 문서를 사용하여 REST API에 액세스하기**

1. REST API 엔터티 페이지(이 페이지 아래에 중첩됨) 중 하나로 이동하여 수행하려는 작업을 찾습니다.
2. 작업의 오른쪽 하단에 있는 **Request** 타일에서 **▶Test it**.

   <figure><img src="/files/cefb8e3ae6d6a29a2c07194dc2c8f863d62503b4" alt="A &#x22;Get an alert&#x22; section includes cards for &#x22;Path parameters,&#x22; &#x22;Responses,&#x22; and &#x22;Authorizations.&#x22; The &#x22;Test it&#x22; button is circled."><figcaption></figcaption></figure>
3. 를 클릭합니다. 팝업되는 모달에서 상단에 표시된 엔드포인트의 `{api_host}`.\
   ![In a URL value, the {api\_host} section is circled.](/files/c57238e33ccf3d9d169628d3fc9ffab4b89ffd0e)
4. 의 **api\_host** 필드에 1단계에서 식별한 REST API URL을 프로토콜 없이 입력합니다(즉, 다음을 제외하고 [1단계](#step-1-identify-your-panther-rest-api-url)). `https://`).\
   ![There is a circle around "api\_host: my-REST-API-URL."](/files/630356de5a6d4478bc3aedf2a428fe1b1786b547)
5. 의 **Authentication** 섹션에서 **Auth Type** 드롭다운을 클릭합니다.
   1. 다음 아래 **필수 인증**에서 **ApiKeyAuth**.\
      ![Under an "Authentication" header, an arrow is drawn from an "ApiKeyAuth" button to a value labeled "ApiKeyAuth."](/files/569bb87ba6b5f125d3ea46466000452e27c3af45)
   2. 다음 아래 **Authentication**, **이름** 및 **Value** 필드가 채워집니다. 다음에서 **Value**API 토큰을 입력합니다. [단계 2](#step-2-generate-an-api-token).
6. 의 **Variables** 섹션에서 작업에 필수 경로 변수가 있는 경우, 예를 들어 `{id}`의 값을 `VALUE` 열에 제공합니다.\
   ![Under a "Get an alert" title, there are sub-sections titled Authentication, Variables, and Cookies. The value of "id" within Variables is circled.](/files/9ea532a507eea949e2ee37962897779edbac6c68)
7. 다음에 값이 있는 경우 **Query Parameters** 섹션에서 이 호출에 적용하려면 오른쪽 열의 체크박스를 선택합니다.\
   ![A "Query Parameters" header is over a table with columns for "KEY," "VALUE," and a three-lines icon. There are two rows filled in, and the third column is circled.](/files/b6c78c6a12c613c13c4a04889a751cee9722fe9d)
8. 요청 본문이 필요한 경우 다음에 내용을 추가합니다. **Body**.
9. 클릭 **Send Request**.
   {% endtab %}
   {% endtabs %}


---

# 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/rest.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.
