soar_ops モジュール
TIPCommon.soar_ops.create_slo_message
TIPCommon.soar_ops.create_slo_message(slo: int, interval_days: Iterable[int], existing_comments: Iterable[str])
時間間隔と既存のコメントに基づいて SLO 警告メッセージを取得します。
interval_days=[0, 1, 7, 14]
パラメータの場合、関数は次のスケジュールに従って SLO が違反されることを警告するメッセージを送信します。
- 有効期限まで 7 ~ 14 日。
- 有効期限までの残り日数が 1 ~ 7 日の場合。
- SLO が違反された日時。
現在の違反期間にコメントがすでに送信されている場合、新しいコメントは返されません(None
が返されます)。
パラメータ | |
---|---|
slo |
int SLO 違反日(Unix マイクロ秒単位)(例: 1_673_774_674_567) |
interval_days |
Iterable[int] 時間違反の警告を送信するまでの日数のイテラブル(例: [0, 1, 3, 7, 14]) |
existing_comments |
Iterable[int] コメントがすでに送信されているかどうかを確認するための既存のコメント。 |
発生
ValueError
- 時間間隔のいずれかが負の場合。
戻り値
コメントは、該当する場合に返されます。それ以外の場合は、None
が返されます。
TIPCommon.soar_ops.get_clean_comment_body
TIPCommon.soar_ops.get_clean_comment_body(comment: str | CaseComment, prefix: str)
コメント文字列またはコメント オブジェクトから接頭辞を削除します。
パラメータ | |
---|---|
comment |
str | CaseComment 接頭辞を削除するコメント文字列またはコメント オブジェクト。 |
prefix |
str 削除する接頭辞。 |
発生
TypeError
- コメントのタイプが str
または CaseComment
のいずれでもない場合。
戻り値
接頭辞のないコメント。
戻り値の型
str
TIPCommon.soar_ops.get_file
TIPCommon.soar_ops.get_file(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, identifier: str)→ bytes | None
ファイルの内容をバイト単位で返します。
パラメータ
パラメータ | |
---|---|
chronicle_soar |
ChronicleSOAR Google Security Operations SOAR SDK オブジェクト。 |
identifier |
str フルパスを含むファイル名識別子。 |
戻り値
指定された識別子のバイトデータ。
戻り値の型
bytes | None
TIPCommon.soar_ops.get_secops_mode
TIPCommon.soar_ops.get_secops_mode()→ str | None
SECOPS_MODE
環境変数を返します。
戻り値
SECOPS_MODE
環境変数。
戻り値の型
str | None
TIPCommon.soar_ops.get_soar_case_comments
TIPCommon.soar_ops.get_soar_case_comments(chronicle_soar: SiemplifyAction | SiemplifyJob, case_id: str | int)
ケースの ID を使用して、ケースからコメント オブジェクトのリストを返します。
パラメータ | |
---|---|
chronicle_soar |
SiemplifyAction | SiemplifyJob SDK オブジェクト。 |
case_id |
str | int コメントが取得されるケースの ID。 |
戻り値
コメント オブジェクトのリスト。
戻り値の型
list[base.action.CaseComment]
TIPCommon.soar_ops.get_user_by_id
TIPCommon.soar_ops.get_user_by_id(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, user_id: str)→ UserProfileCard | None
ユーザー ID から UserProfileCard オブジェクトを取得します。
パラメータ
パラメータ | |
---|---|
chronicle_soar |
ChronicleSOAR Google Security Operations SOAR SDK オブジェクト。 |
user_id |
str ユーザー ID(例: |
戻り値
ユーザー オブジェクトが見つかった場合はそのオブジェクト、見つからなかった場合は None
。
戻り値の型
UserProfileCard | None
TIPCommon.soar_ops.get_users_profile_cards_with_pagination
TIPCommon.soar_ops.get_users_profile_cards_with_pagination(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, search_term: str = '', 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 = None)→ list[UserProfileCard]
ページネーションを使用して、すべてのユーザー プロフィール カードを取得します。ページサイズは、各反復処理のユーザー数の上限として機能します。
パラメータ
パラメータ | |
---|---|
chronicle_soar |
ChronicleSOAR Google Security Operations SOAR SDK オブジェクト。 |
search_term |
str 検索キーワード。 デフォルトは |
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 フィルタ権限のタイプ( デフォルトは |
戻り値
すべてのユーザーのリスト。
戻り値の型
list[UserProfileCard]
TIPCommon.soar_ops.is_slo_comment
TIPCommon.soar_ops.is_slo_comment(comment: str)
コメントが SLO 警告コメントかどうかを確認します。
SLO コメントは、SLO 警告(「SLO は {int} 日以内に違反します」)または SLO 違反メッセージ(「SLO が違反しました」)のいずれかです。
パラメータ | |
---|---|
comment |
str チェックするコメント。 |
戻り値
コメントが SLO コメントの場合は True
。それ以外の場合は、False
が返されます。
戻り値の型
bool
TIPCommon.soar_ops.remove_prefix_from_comments
TIPCommon.soar_ops.remove_prefix_from_comments(comments: list[str], prefix: str)
コメントのリストからプレフィックス(存在する場合)を削除します。
パラメータ | |
---|---|
comments |
list[str] プレフィックスを削除するコメント。 |
prefix |
str 削除する接頭辞。 |
戻り値
プレフィックスが削除された後のすべてのコメントのリスト
戻り値の型
list[str]
TIPCommon.soar_ops.save_file
TIPCommon.soar_ops.save_file(chronicle_soar: SiemplifyAction | SiemplifyConnectorExecution | SiemplifyJob, path: str, name: str, content: bytes)→ bytes | None
ファイルを Google Cloud バケットまたはローカルパスに保存します。
パラメータ
パラメータ | |
---|---|
chronicle_soar |
ChronicleSOAR Google Security Operations SOAR SDK オブジェクト。 |
path |
str ファイルを保存するフォルダのパス。 |
name |
str 保存するファイル名。 |
content |
bytes バイト形式のファイル コンテンツ。 |
戻り値
ダウンロードしたファイルのパス。
戻り値の型
str | None
さらにサポートが必要な場合 コミュニティ メンバーや Google SecOps のプロフェッショナルから回答を得ることができます。