TIPCommon.rest
TIPCommon.rest.auth.build_credentials_from_sa
TIPCommon.rest.auth.build_credentials_from_sa(user_service_account: MutableMapping[str, Any] | None = None, target_principal: str | None = None, source_credentials: Credentials | None = None, quota_project_id: str | None = None, scopes: list[str] | None = None, verify_ssl: bool | None = True, **service_account_attr: Any)→ Credentials
從服務帳戶、工作負載身分電子郵件或服務帳戶屬性建構憑證物件。
注意
必須提供 user_service_account、target_principal 或 service_account_attr (使用 **kwargs)。否則會引發 EmptyMandatoryValues 例外狀況。
參數
| 參數 | |
|---|---|
user_service_account | 
      SingleJson | None使用者服務帳戶 JSON。  | 
    
target_principal | 
      str | NoneWorkload Identity 電子郵件地址。  | 
    
source_credentials | 
      google.auth.Credentials | None用來取得模擬憑證的來源憑證。 如果提供   | 
    
quota_project_id | 
      str | None用於配額和帳單的專案 ID。  | 
    
scopes | 
      list[str] Google Cloud 憑證範圍。預設值為   | 
    
verify_ssl | 
      bool定義是否要驗證 SSL 憑證。 預設值為   | 
    
service_account_attr | 
      dict[str, Any]解構服務帳戶欄位的鍵/值組合。  | 
    
發出
EmptyMandatoryValues:沒有服務帳戶或工作負載身分電子郵件,或缺少服務帳戶的必要欄位。google.auth.exceptions.RefreshError:無法重新整理憑證。
傳回
憑證物件。
傳回類型
service_account.Credentials
TIPCommon.rest.auth.build_credentials_from_sa_attr
TIPCommon.rest.auth.build_credentials_from_sa_attr(account_type: str, project_id: str, private_key_id: str, private_key: str, client_email: str, client_id: str, auth_uri: str, token_uri: str, auth_provider_x509_url: str, client_x509_cert_url: str, scopes: list[str] | None = None, quota_project_id: str | None = None)→ Credentials
從服務帳戶屬性建構憑證物件。
參數
| 參數 | |
|---|---|
account_type | 
      str服務帳戶類型。  | 
    
project_id | 
      str服務帳戶專案 ID。  | 
    
private_key_id | 
      str服務帳戶私密金鑰 ID。  | 
    
private_key | 
      str服務帳戶私密金鑰。  | 
    
client_email | 
      str服務帳戶用戶端電子郵件地址。  | 
    
client_id | 
      str服務帳戶用戶端 ID。  | 
    
auth_uri | 
      str服務帳戶授權 URI。  | 
    
token_uri | 
      str服務帳戶權杖 URI。  | 
    
auth_provider_x509_url | 
      str服務帳戶驗證提供者 x509 憑證網址。  | 
    
client_x509_cert_url | 
      str服務帳戶用戶端 x509 憑證網址。  | 
    
scopes | 
      list[str], optional Google Cloud 憑證範圍。預設值為   | 
    
quota_project_id | 
      str | None用於配額和帳單的專案 ID。  | 
    
發出
EmptyMandatoryValues:服務帳戶缺少必填欄位。
傳回
憑證物件。
傳回類型
service_account.Credentials
TIPCommon.rest.auth.generate_jwt_from_credentials
TIPCommon.rest.auth.generate_jwt_from_credentials(credentials: Credentials, verify_ssl: bool = True)→ bytes
產生 JSON Web Token,透過 REST 存取 Google Cloud API 資源。
參數
| 參數 | |
|---|---|
credentials | 
      google.oauth2.credentials.Credentials
  | 
    
verify_ssl | 
      bool定義是否要透過 SSL 重新整理憑證權杖。 預設值為   | 
    
傳回
用於授權標頭的 JWT 權杖。
傳回類型
bytes
TIPCommon.rest.auth.generate_jwt_from_sa
TIPCommon.rest.auth.generate_jwt_from_sa(service_account, expiry_length=3600, audience=None)
產生 JSON Web Token,透過 REST 存取 Google Cloud API 資源。
| 參數 | |
|---|---|
service_account | 
      str | dictGoogle Cloud 專案服務帳戶,並具備必要的 Identity and Access Management 角色。  | 
    
expiry_length | 
      int權杖失效前的時間 (以秒為單位)。 預設值為 1 小時。  | 
    
audience | 
      strGoogle Cloud 範圍。如未提供,則會改回使用   | 
    
傳回
授權標頭中使用的 JWT 權杖。
傳回類型
bytes
TIPCommon.rest.auth.get_adc
TIPCommon.rest.auth.get_adc(scopes: Sequence[str] | None = None, request: Request | None = None, quota_project_id: str | None = None)→ Tuple[Credentials, str | None]
取得執行階段環境的應用程式預設憑證 (ADC)。
這是 google.auth.default 的包裝函式。
參數
| 參數 | |
|---|---|
scopes | 
      Sequence[str] | None憑證的範圍清單。 如果指定,系統會在必要時自動設定憑證範圍。  | 
    
request | 
      google.auth.transport.Request | None
      用於提出 HTTP 要求的物件。這項資訊可用於偵測應用程式是否在 Compute Engine 上執行,或判斷工作負載身分集區資源 (外部帳戶憑證) 的相關聯專案 ID。 如未指定,系統會使用 Compute Engine 憑證的標準程式庫 HTTP 用戶端,或外部帳戶憑證的   | 
    
quota_project_id | 
      str | None用於配額和帳單的專案 ID。  | 
    
傳回
目前環境的憑證和專案 ID。專案 ID 可能為 None,表示系統無法從環境中判斷專案 ID。
傳回類型
Tuple[google.auth.credentials.Credentials, str]
發出
google.auth.exceptions.DefaultCredentialsError - 找不到憑證,或找到的憑證無效。
TIPCommon.rest.auth.get_auth_request
TIPCommon.rest.auth.get_auth_request(verify_ssl: bool = True)→ Request
建立對 Google Cloud 資源 API 的授權 HTTP 要求。
參數
| 參數 | |
|---|---|
verify_ssl | 
      bool, optional驗證 SSL 憑證。預設值為   | 
    
傳回
授權要求物件。
傳回類型
google.auth.transport.requests.Request
TIPCommon.rest.auth.get_impersonated_credentials
TIPCommon.rest.auth.get_impersonated_credentials(target_principal: str, source_credentials: google.auth.Credentials | None = None, target_scopes: Sequence[str] | None = None, delegates: Sequence[str] | None = None, quota_project_id: str | None = None)→ impersonated_credentials.Credentials
使用 Google Cloud 服務帳戶模擬取得短期 Credentials 物件。
參數
| 參數 | |
|---|---|
target_principal | 
      str要模擬的服務帳戶。  | 
    
source_credentials | 
      google.auth.Credentials | None用來取得模擬憑證的來源憑證。 如未提供,系統會嘗試使用應用程式預設憑證。  | 
    
target_scopes | 
      Sequence[str] | None授權授予期間要求使用的範圍。 如果提供   | 
    
delegates | 
      Sequence[str] | None授予最終存取權權杖時,必須使用的委派鏈結清單。 如果已設定,身分序列必須將  舉例來說,如果設為  如果未設定,  | 
    
quota_project_id | 
      str | None用於配額和帳單的專案 ID。 注意:這個專案可能與用來建立憑證的專案不同。  | 
    
傳回
目標主體的短期 Credentials 物件。
傳回類型
impersonated_credentials.Credentials
TIPCommon.rest.auth.get_secops_siem_tenant_credentials
TIPCommon.rest.auth.get_secops_siem_tenant_credentials(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, target_scopes: Sequence[str] | None = None, quota_project_id: str | None = None)→ Credentials
取得 Google SecOps 執行個體的 SIEM 租戶短期服務帳戶憑證。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      TIPCommon.types.ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
target_scopes | 
      Sequence[str] | None授權授予期間要求使用的範圍。  | 
    
quota_project_id | 
      str | None用於配額和帳單的專案 ID。 注意:這個專案可能與用來建立憑證的專案不同。  | 
    
傳回
SIEM 租戶的短期服務帳戶憑證。
傳回類型
impersonated_credentials.Credentials
class TIPCommon.rest.gcp.GcpErrorReason
class TIPCommon.rest.gcp.GcpErrorReason
基底:object
Google Cloud Error Reason 常數命名空間。
常數
IAM_PERMISSION_DENIED = 'IAM_PERMISSION_DENIED'
class TIPCommon.rest.gcp.GcpPermissions
class TIPCommon.rest.gcp.GcpPermissions
基底:object
Google Cloud Permissions 常數命名空間。
常數
IAM_SA_GET_ACCESS_TOKEN = 'iam.serviceAccounts.getAccessToken'
TIPCommon.rest.gcp.extract_project_id_from_sa_email
TIPCommon.rest.gcp.extract_project_id_from_sa_email(service_account_email: str)→ str
從服務帳戶電子郵件地址擷取專案 ID。
參數
| 參數 | |
|---|---|
service_account_email | 
      str服務帳戶電子郵件地址。  | 
    
傳回
專案 ID。
傳回類型
str
發出
NotFoundError - 無法從服務帳戶電子郵件剖析專案名稱時。
TIPCommon.rest.gcp.extract_project_id_from_sa_key
TIPCommon.rest.gcp.extract_project_id_from_sa_key(service_account_json: MutableMapping[str, Any])→ str
從服務帳戶 JSON 金鑰中擷取專案 ID。
參數
| 參數 | |
|---|---|
service_account_json | 
      SingleJson服務帳戶 JSON 金鑰。  | 
    
傳回
服務帳戶金鑰中的專案 ID 欄位。
傳回類型
str
發出
NotFoundError:當系統在服務帳戶金鑰中找不到「project_id」欄位時。
TIPCommon.rest.gcp.get_http_client
TIPCommon.rest.gcp.get_http_client(credentials: Credentials, verify_ssl: bool = True)→ Http | AuthorizedHttp
取得 Google Cloud 授權的 HTTP 用戶端。
參數
| 參數 | |
|---|---|
credentials | 
      service_account.CredentialsGoogle Cloud Credentials 物件。  | 
    
verify_ssl | 
      bool (選填)驗證 SSL 憑證。預設值為   | 
    
傳回
授權的 HTTP 用戶端。
傳回類型
Union[httplib2.Http, google_auth_httplib2.AuthorizedHttp]
TIPCommon.rest.gcp.get_workload_sa_email
TIPCommon.rest.gcp.get_workload_sa_email(default_sa_to_return: str | None = None)→ str
從 Google Cloud 中繼資料伺服器擷取 Workload 服務帳戶電子郵件地址。
參數
| 參數 | |
|---|---|
default_sa_to_return | 
      str | None如果找不到,則傳回預設服務帳戶。 預設值為   | 
    
傳回
Workload 服務帳戶電子郵件地址。
傳回類型
str
發出
GoogleCloudException - 無法取得 GCP Workload 服務帳戶電子郵件地址時。
TIPCommon.rest.gcp.retrieve_project_id
TIPCommon.rest.gcp.retrieve_project_id(user_service_account: MutableMapping[str, Any] | None = None, service_account_email: str | None = None, default_project_id: str | None = None)→ str | None
從服務帳戶或工作負載身分識別電子郵件取得專案 ID。
參數
| 參數 | |
|---|---|
user_service_account | 
      SingleJson | None使用者服務帳戶 JSON。  | 
    
service_account_email | 
      str | NoneWorkload Identity 電子郵件地址。  | 
    
default_project_id | 
      str | None如果找不到專案 ID,要傳回的預設專案 ID。 如果提供,這個函式就不會引發  預設值為   | 
    
傳回
服務帳戶或工作負載身分電子郵件的專案 ID。
如果找不到,則傳回 None。
傳回類型
str | None
發出
NotFoundError:無法從服務帳戶電子郵件剖析專案名稱。
TIPCommon.rest.gcp.validate_impersonation
TIPCommon.rest.gcp.validate_impersonation(content: dict, default_error_msg: str = 'Service Account Impersonation failed')→ None
從 HTTP 授權回應驗證服務帳戶模擬。
參數
| 參數 | |
|---|---|
content | 
      dictHTTP 授權回應內容。  | 
    
default_error_msg | 
      str, optional如果回應內容中找不到,要引發的錯誤訊息。 預設值為   | 
    
傳回
None (如果已授權服務帳戶模擬)。
傳回類型
None
發出
ImpersonationUnauthorizedError - 服務帳戶模擬未獲授權。
TIPCommon.rest.httplib.get_auth_session
TIPCommon.rest.httplib.get_auth_session(service_account, audience=None, verify_ssl=True)
建立資源 API 的授權 HTTP 工作階段。 Google Cloud
| 參數 | |
|---|---|
service_account | 
      str | dict具備必要 Identity and Access Management 角色的 Google Cloud 專案服務帳戶。  | 
    
audience | 
      str範圍 Google Cloud 。  | 
    
verify_ssl | 
      bool定義是否要使用 SSL 加密建立工作階段。  | 
    
傳回
已獲授權的工作階段物件。
傳回類型
requests.Session
發出
ValueError - 未提供憑證和服務帳戶。
exception TIPCommon.rest.soar_api.SoarApiServerError
基底:例外狀況
Google Security Operations SOAR 的 API 呼叫伺服器時發生錯誤。
TIPCommon.rest.soar_api.batch_set_custom_field_values
TIPCommon.rest.soar_api.batch_set_custom_field_values(chronicle_soar, identifier: int, parent: str, custom_fields_values_mapping: dict[int, list[str]])→ list[CustomFieldValue]
批次設定自訂欄位值。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      Google Security Operations SOAR SDK 物件。 | 
identifier | 
      int父項 ID。  | 
    
parent | 
      str自訂欄位值的父項路徑 (例如   | 
    
custom_fields_values_mapping | 
      dict[int, list[str]]自訂欄位 ID 對應值。  | 
    
傳回
CustomFieldValue 物件清單。
傳回類型
list[CustomFieldValue]
TIPCommon.rest.soar_api.get_alert_events
TIPCommon.rest.soar_api.get_alert_events(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, case_id: str | int, alert_identifier: str)→ list[AlertEvent]
取得特定快訊的事件。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
case_id | 
      str | int案件 ID。例如:  | 
    
alert_identifier | 
      str
      快訊的 ID (例如  範例:  | 
    
傳回
要求的 JSON 回應。事件的 JSON 清單。
傳回類型
list[SingleJson]
發出
requests.HTTPError:伺服器傳回非成功狀態碼時。json.JSONDecodeError - 傳回的值不是有效的 JSON。
TIPCommon.rest.soar_api.get_case_attachments
TIPCommon.rest.soar_api.get_case_attachments(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, case_id: int)→ MutableMapping[str, Any]
取得案件附件。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
case_id | 
      intGoogle Security Operations SOAR 案件 ID。  | 
    
傳回
代表案件附件的可變動對應。
傳回類型
MutableMapping[str, Any]
TIPCommon.rest.soar_api.get_case_overview_details
TIPCommon.rest.soar_api.get_case_overview_details(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, case_id: int | str) → CaseDetails
依案件 ID 取得案件總覽詳細資料。
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SDK 物件。  | 
    
case_id | 
      int | strGoogle Security Operations SOAR 案件 ID。  | 
    
傳回
案件詳細資料物件。
傳回類型
發出
requests.HTTPError:要求失敗或要求狀態不是 200 時。
json.JSONDecoderError - 剖析回應失敗時。
TIPCommon.rest.soar_api.get_connector_cards
TIPCommon.rest.soar_api.get_connector_cards(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, integration_name: str | None = None, connector_identifier: str | None = None)→ list[ConnectorCard]
取得所有連結器卡片。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
integration_name | 
      str | None整合名稱。  | 
    
connector_identifier | 
      str | None連接器 ID。  | 
    
傳回
所有連接器資訊卡的清單。
傳回類型
list[ConnectorCard]
TIPCommon.rest.soar_api.get_entity_data
TIPCommon.rest.soar_api.get_entity_data(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, entity_identifier: str, entity_environment: str, entity_type: str | None = None, last_case_type: int = 0, case_distribution_type: int = 0)→ MutableMapping[str, Any]
擷取實體資料。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
entity_identifier | 
      int實體 ID。  | 
    
entity_environment | 
      str實體環境。  | 
    
entity_type | 
      str實體類型。  | 
    
last_case_type | 
      int最後一個案件類型。  | 
    
case_distribution_type | 
      int案件分配類型。  | 
    
傳回
代表實體資料的可變動對應。
傳回類型
dict
發出
requests.HTTPError:伺服器傳回非成功狀態碼時。
TIPCommon.rest.soar_api.get_env_action_def_files
TIPCommon.rest.soar_api.get_env_action_def_files(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob)→ list[Dict[str, Any]]
擷取環境動作定義檔案清單。
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle SecOps SDK 物件。  | 
    
傳回
代表動作定義檔案的 SingleJson 物件清單。
傳回類型
(list[SingleJson])
發出
requests.HTTPError - 伺服器傳回非成功狀態碼時。
json.JSONDecodeError - 傳回的值不是有效的 JSON。
TIPCommon.rest.soar_api.get_federation_cases
TIPCommon.rest.soar_api.get_federation_cases(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob)→ MutableMapping[str, Any]
取得聯盟案件。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
傳回
回覆 JSON。
傳回類型
SingleJson
TIPCommon.rest.soar_api.get_full_case_details
TIPCommon.rest.soar_api.get_full_case_details(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, case_id: int)→ MutableMapping[str, Any]
取得完整案件詳細資料。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
case_id | 
      intGoogle Security Operations SOAR 案件 ID。  | 
    
傳回
代表完整案件詳細資料的可變動對應。
傳回類型
MutableMapping[str, Any]
TIPCommon.rest.soar_api.get_installed_integrations_of_environment
TIPCommon.rest.soar_api.get_installed_integrations_of_environment(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, environment: str, integration_identifier: str | None = None)→ list[InstalledIntegrationInstance]
擷取為所提供環境安裝的所有整合。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
environment | 
      str執行個體環境清單。  | 
    
integration_identifier | 
      str | None整合 ID。  | 
    
傳回
代表整合執行個體的字典物件清單。
傳回類型
list[InstalledIntegrationInstance]
TIPCommon.rest.soar_api.get_installed_jobs
TIPCommon.rest.soar_api.get_installed_jobs(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob)→ list[Dict[str, Any]]
擷取環境動作定義檔案清單。
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle SecOps SDK 物件。  | 
    
傳回
代表動作定義檔案的 SingleJson 物件清單。
傳回類型
(list[SingleJson])
發出
requests.HTTPError - 伺服器傳回非成功狀態碼時。
json.JSONDecodeError - 傳回的值不是有效的 JSON。
TIPCommon.rest.soar_api.get_integration_full_details
TIPCommon.rest.soar_api.get_integration_full_details(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, integration_identifier: str)→ Dict[str, Any]
擷取整合項目的完整詳細資料檔案。
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle SecOps SDK 物件。  | 
    
integration_identifier | 
      str整合 ID。  | 
    
傳回
JSON 回應,內含整合的完整詳細資料。
傳回類型
(SingleJSON)
發出
requests.HTTPError - 伺服器傳回非成功狀態碼時。
json.JSONDecodeError - 傳回的值不是有效的 JSON。
TIPCommon.rest.soar_api.get_user_profile_cards
TIPCommon.rest.soar_api.get_user_profile_cards(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, search_term: str = '', requested_page: int = 0, page_size: int = 20, filter_by_role: bool = False, filter_disabled_users: bool = False, filter_support_users: bool = False, fetch_only_support_users: bool = False, filter_permission_types: list[int] = None)→ MutableMapping[str, Any]
依網頁和篩選條件擷取使用者設定檔資訊卡。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
search_term | 
      str搜尋字詞。  | 
    
requested_page | 
      int傳回使用者頁面的起始偏移。  | 
    
page_size | 
      int要傳回的使用者人數。  | 
    
filter_by_role | 
      bool定義是否要依角色篩除。  | 
    
filter_disabled_users | 
      bool定義是否要篩除已停用的使用者。  | 
    
filter_support_users | 
      bool定義是否要篩除支援使用者。  | 
    
fetch_only_support_users | 
      bool定義是否只傳回支援使用者。  | 
    
filter_permission_types | 
      list[int] | None篩選器權限類型清單 (例如   | 
    
傳回
SOAR 伺服器的回應 - 使用者設定檔資訊卡。
傳回類型
SingleJson
發出
requests.HTTPError:伺服器傳回非成功狀態碼時。json.JSONDecodeError - 傳回的值不是有效的 JSON。
範例
以下是回應 JSON 的範例:
{
  "objectsList": [
    { "firstName": "string", "lastName": "string", "userName": "string", "accountState": 0 }
  ],
  "metadata": {
    "totalNumberOfPages": 0,
    "totalRecordsCount": 0,
    "pageSize": 0
  }
}
TIPCommon.rest.soar_api.get_workflow_instance_card
TIPCommon.rest.soar_api.get_workflow_instance_card(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, case_id: int, alert_identifier: str)→ MutableMapping[str, Any]
取得工作流程執行個體資訊卡。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
case_id | 
      intGoogle Security Operations SOAR 案件 ID。  | 
    
alert_identifier | 
      strGoogle Security Operations SOAR 警報 ID。  | 
    
傳回
代表工作流程執行個體資訊卡的可變動對應。
傳回類型
MutableMapping[str, Any]
TIPCommon.rest.soar_api.list_custom_field_values
TIPCommon.rest.soar_api.list_custom_field_values(chronicle_soar, parent: str)→ list[CustomFieldValue]
取得案件或快訊的自訂欄位值。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
parent | 
      str自訂欄位值的父項路徑 (例如:  | 
    
傳回
案件詳細資料物件。
傳回類型
list[CustomFieldValue]
發出
requests.HTTPError:要求失敗或要求狀態不是 200 時。json.JSONDecoderError - 剖析回應失敗時。
TIPCommon.rest.soar_api.list_custom_fields
TIPCommon.rest.soar_api.list_custom_fields(chronicle_soar, filter_: str | None = None)→ list[CustomField]
列出自訂欄位。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
filter_ | 
      str | None搜尋的篩選值。  | 
    
傳回
案件詳細資料物件。
傳回類型
list[CustomField]
發出
requests.HTTPError:要求失敗或要求狀態不是 200 時。json.JSONDecoderError - 剖析回應失敗時。
TIPCommon.rest.soar_api.remove_case_tag
TIPCommon.rest.soar_api.remove_case_tag(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, case_id: int, tag: str, alert_identifier: str | None = None)→ None
移除案件標記。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
case_id | 
      intGoogle Security Operations SOAR 案件 ID。  | 
    
tag | 
      str要移除的標記。  | 
    
alert_identifier | 
      str | None{The {google_secops_soar_name}} 快訊 ID。  | 
    
傳回
無
傳回類型
None
發出
requests.HTTPError:伺服器傳回非成功狀態碼時。
TIPCommon.rest.soar_api.save_attachment_to_case_wall
TIPCommon.rest.soar_api.save_attachment_to_case_wall(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, attachment_data: CaseWallAttachment)→ MutableMapping[str, Any]
直接將檔案儲存至案件牆。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
attachment_data | 
      CaseWallAttachment
  | 
    
傳回
代表 API 回應的可變動對應。
傳回類型
MutableMapping[str, Any]
TIPCommon.rest.soar_api.set_alert_priority
TIPCommon.rest.soar_api.set_alert_priority(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, case_id: int, alert_identifier: str, alert_name: str, priority: int)→ None
設定快訊優先順序。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
case_id | 
      intGoogle Security Operations SOAR 案件 ID。  | 
    
alert_identifier | 
      strGoogle Security Operations SOAR 警報 ID。  | 
    
alert_name | 
      strGoogle Security Operations SOAR 快訊名稱。  | 
    
priority | 
      intGoogle Security Operations SOAR 優先順序列舉值。  | 
    
傳回
無
傳回類型
None
發出
requests.HTTPError:伺服器傳回非成功狀態碼時。
TIPCommon.rest.soar_api.set_case_score_bulk
TIPCommon.rest.soar_api.set_case_score_bulk(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, case_score_mapping: list[dict[str, int | float]])→ MutableMapping[str, Any]
大量設定案件分數。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
case_score_mapping | 
      list[dict[str, int | float]]Google Security Operations SOAR 案件 ID 對應分數。  | 
    
傳回
包含成功狀態的 JSON 回應,以及 (如適用) 失敗案例清單。
傳回類型
MutableMapping[str, Any]
發出
requests.HTTPError:伺服器傳回非成功狀態碼時。
範例
{
  case_score_mapping = [
  {
    "caseId": 1, "score": 1.0
  }
]
}
TIPCommon.rest.soar_api.set_custom_field_values
TIPCommon.rest.soar_api.set_custom_field_values(chronicle_soar: ChronicleSOAR, parent: str, custom_field_id: int, values: list[str])→ CustomFieldValue
設定自訂欄位值。
參數
| 參數 | |
|---|---|
chronicle_soar | 
      ChronicleSOARGoogle Security Operations SOAR SDK 物件。  | 
    
parent | 
      str自訂欄位值的父項路徑,例如:  | 
    
custom_field_id | 
      int自訂欄位 ID。  | 
    
values | 
      list[str]要設定的自訂欄位值清單。  | 
    
傳回
CustomFieldValue 物件。
傳回類型
CustomFieldValue
TIPCommon.rest.soar_api.validate_response
TIPCommon.rest.soar_api.validate_response(response: Response, validate_json: bool = False) → None
驗證回應並以 JSON 格式傳回。
| 參數 | |
|---|---|
response | 
      requests.Response要驗證的回覆。  | 
    
發出
HTTPError - 回應狀態碼表示失敗時。
還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求答案。