APIを使用して、 Server & Workload Protection が保護しているコンピュータのセキュリティステータスに関する情報を収集します。たとえば、セキュリティステータスの月次レポートを作成するには、セキュリティモジュールの実行状態
(オンまたはオフ) や、最新のルールが割り当てられているかどうかなど、セキュリティモジュールに関する情報を収集します。
特定の脅威から保護されているかどうかを確認することもできます。たとえば、 a zの脆弱性に対するCVEがリリースされた場合、そのCVEの侵入防御ルールを見つけてコンピュータに適用できます。
保護されていないコンピュータの検出
エージェントまたはApplianceのリアルタイムステータス、または保護モジュールのステータスに基づいて、保護されていないコンピュータを検出します。
- コンピュータにエージェントまたはApplianceがインストールされていないか、 エージェントまたはApplianceがアクティブではありません。
- 保護モジュールがオンになっていないか、オンになっていてアクティブではありません。
仮想マシンの場合は、マシンの状態やその他の情報も取得できます。これらの情報は、トラブルシューティングに役立ちます。
コンピュータのステータスに関する背景情報については、コンピュータとエージェントのステータスを参照してください
エージェントのステータスに基づいたコンピュータの検索
エージェントがインストールされていないコンピュータは、 Server & Workload Protectionによって保護されません。 エージェントまたはApplianceに問題がある場合でも、コンピュータの保護が解除されることがあります。
エージェントまたはApplianceがインストールされているかどうかを確認するには、 エージェントとApplianceのフィンガープリントを確認します。フィンガープリントなしは、
エージェントまたはApplianceがインストールされていないため、コンピュータが保護されていないことを示します。 エージェントまたはApplianceがインストールされたら、それらのステータスも確認します。たとえば、
activeエージェントまたはApplianceが正常に実行されていることを示します。その他のステータスerrorまたはinactiveは、調査が必要な問題を示します。次のJSONの例は、Computerオブジェクトのデータ構造を表しています (例を簡潔にするために一部の項目を省略しています)。は
agentFingerPrint エージェントがインストールされており、computerStatusアクティブであることを示します。{
"hostName": "laptop_adaggs",
...
"policyID": 34,
"agentFingerPrint": "71:3E:81:64:65:EB:34:78:FC:72:C2:CB:37:6B:1D:F0:8C:D1:9B:1E",
"agentVersion": "11.3.2.883",
"computerStatus": {
"agentStatus": "active",
"agentStatusMessages": [
"Managed (Online)"
]
},
"computerSettings": {...},
"ID": 48,
"antiMalware": {...},
...
}
ヒントオフラインステータスは、Server & Workload Protectionがコンピュータと通信できないことを示す場合があります。このステータスでは、エージェントまたはアプライアンスは正常に動作し、保護を提供している可能性があります。しかし、Server & Workload Protectionはエージェントまたはアプライアンスにコンポーネントの更新を送信できません。 |
保護されていないコンピュータを検出するには、次の一般的な手順を実行します。
手順
- 使用する
ComputersApiComputerオブジェクトを取得します。 - を確認します。
AgentFingerPrintそしてApplianceFingerPrintコンピュータのプロパティ。 - を取得します。
ComputerStatusからのオブジェクトComputerオブジェクトを選択し、AgentStatusプロパティ。以外の値ACTIVEは、問題を示している可能性があります。 - 必要に応じて、
AgentStatusMessagesのComputerStatusオブジェクトとAgentTasksのプロパティComputer有用な情報のオブジェクトです。
次のステップ
ヒントの値が
computerStatusフィールドはオブジェクト (ComputerStatus)、このフィールドで検索することはできません。 |
すべてのコンピュータのステータスを確認するには、まず
ComputersApiすべてのコンピュータを一覧表示するクラス:computers_api = api.ComputersApi(api.ApiClient(configuration)) computers = computers_api.list_computers(api_version, expand=expand.list(), overrides=False)
コンピュータごとに、 エージェントとApplianceのフィンガープリントを確認します。フィンガープリントなしは、 エージェントまたはApplianceがインストールされておらず、コンピュータが保護されていないことを示します。コンピュータにはエージェントとApplianceの両方をインストールできます。両方のフィンガープリントの値を確認する必要があります。
if computer.agent_finger_print == None and computer.appliance_finger_print == None:
フィンガープリントが見つかった場合は、 エージェントまたはApplianceのステータスを取得して、それがアクティブかどうかを確認します。 [アクティブ] 以外のステータスは、
エージェントまたはApplianceに問題があることを示している可能性があります。
agent_status = computer.computer_status.agent_status
if computer.agent_finger_print != None and agent_status != "active":
...
appliance_status = computer.computer_status.appliance_status
if computer.appliance_finger_print != None and appliance_status != "active":
...
ステータスがアクティブでない場合は、 エージェントまたはApplianceのステータスメッセージとタスクを取得します。次の例は、エージェントの情報を取得する方法を示しています。
if computer.computer_status.agent_status_messages != None:
computer_info.append(str(computer.computer_status.agent_status_messages))
else:
computer_info.append("")
if computer.tasks != None:
computer_info.append(str(computer.tasks.agent_tasks))
else:
computer_info.append("")
次の例では、 エージェントまたはApplianceがインストールされていないコンピュータ、またはエージェントまたはApplianceのステータスが「非アクティブ」のコンピュータを検索します。完全なソースコードサンプルでは、結果がCSVファイルとして保存できる形式でコンパイルされ、スプレッドシートとして開きます。
# Include computer status information in the returned Computer objects
expand = api.Expand(api.Expand.computer_status)
# Get all computers
computers_api = api.ComputersApi(api.ApiClient(configuration))
computers = computers_api.list_computers(api_version, expand=expand.list(), overrides=False)
for computer in computers.computers:
computer_info = []
# Report on computers with no agent or appliance
if computer.agent_finger_print is None and computer.appliance_finger_print is None:
# Hostname and protection type
computer_info.append(computer.host_name)
computer_info.append("None")
# Agent/appliance status and status messages
computer_info.append("No agent/appliance")
status_messages = ""
if computer.computer_status is not None and computer.computer_status.agent_status is not None:
status_messages = str(computer.computer_status.agent_status_messages)
computer_info.append(status_messages)
else:
# Report on problem agents and appliances
agent_status = computer.computer_status.agent_status
appliance_status = computer.computer_status.appliance_status
# Agent is installed but is not active
if computer.agent_finger_print is not None and agent_status != "active":
# Hostname and protection type
computer_info.append(computer.host_name)
computer_info.append("Agent")
# Agent status, status messages, and tasks
if computer.computer_status.agent_status is not None:
computer_info.append(computer.computer_status.agent_status)
else:
computer_info.append("")
if computer.computer_status.agent_status_messages is not None:
computer_info.append(str(computer.computer_status.agent_status_messages))
else:
computer_info.append("")
if computer.tasks is not None:
computer_info.append(str(computer.tasks.agent_tasks))
else:
computer_info.append("")
# Appliance is installed but is not active
if computer.appliance_finger_print is not None and appliance_status != "active":
# Hostname and protection type
computer_info.append(computer.host_name)
computer_info.append("Appliance")
# Appliance status, status messages, and tasks
if computer.computer_status.appliance_status is not None:
computer_info.append(computer.computer_status.appliance_status)
else:
computer_info.append("")
if computer.computer_status.appliance_status_messages is not None:
computer_info.append(str(computer.computer_status.appliance_status_messages))
else:
computer_info.append("")
if computer.tasks is not None:
computer_info.append(str(computer.tasks.appliance_tasks))
else:
computer_info.append("")
モジュールのステータスに基づいたコンピュータの検索
保護モジュールがオフになっている場合や、 エージェントまたはApplianceがモジュールを正常に実行できない問題がある場合、コンピュータは脆弱になります。コンピュータが保護モジュールによって保護されているかどうかを確認するには、モジュールの状態
(オンまたはオフ) を確認します。状態がオンの場合は、 エージェントまたはApplianceがモジュールを実行できるかどうかを示すモジュールステータスも確認します。以外のステータス
activeは、注意が必要な問題を示している可能性があります。また、ステータスに関する洞察を提供するステータスメッセージを取得することもできます。次のJSONの例は、Computerオブジェクトのデータ構造を表しています (例を簡潔にするために一部の項目を省略しています)。不正プログラム対策モジュールは
onただし、モジュールのエージェントステータスに警告が表示されます。{
"hostName": "192.168.60.128",
...
"policyID": 9,
"agentFingerPrint": "76:C8:CE:B3:70:61:A3:BE:84:A2:2A:5D:1F:3A:29:8A:DC:7A:70:6C",
"agentVersion": "11.2.0.147",
"computerStatus": {...},
"computerSettings": {...},
...
"ID": 2,
"antiMalware": {
"state": "on",
"moduleStatus": {
"agentStatus": "warning",
"agentStatusMessage": "Software Update: Anti-Malware Module Installation Failed"
},
"realTimeScanConfigurationID": 1,
"realTimeScanScheduleID": 4,
"manualScanConfigurationID": 2,
"scheduledScanConfigurationID": 3
},
"webReputation": {...},
"firewall": {...},
"intrusionPrevention": {...},
"integrityMonitoring": {...},
"logInspection": {...},
"applicationControl": {...}
}
モジュールのステータスを使用して保護されていないコンピュータを検出するには、次の一般的な手順を実行します。
手順
- 使用する
ComputersApiを取得します。Computerオブジェクト。 - 対象の保護モジュールのコンピュータ拡張オブジェクトを取得します。
AntiMalwareComputerExtensionまたはIntrusonPreventionComputerExtension。 - コンピュータ拡張オブジェクトからモジュールの状態の値を取得して、モジュールがオンかオフかを確認します。
- また、コンピュータ拡張オブジェクトから、
ModuleStatusオブジェクトを作成し、 エージェントとApplianceのステータスとステータスメッセージを取得します。
次のステップ
ヒントの値が
moduleStatusコンピュータ拡張のフィールドはオブジェクト (ModuleStatus)、このフィールドで検索することはできません。 |
すべてのコンピュータのモジュールステータスを確認するには、まず
ComputersApiすべてのコンピュータを一覧表示するクラス:computers_api = api.ComputersApi(api.ApiClient(configuration)) computers = computers_api.list_computers(api_version, expand=expand.list(), overrides=False)
コンピュータごとに、対象の保護モジュールのエージェントステータスを取得します。モジュールのステータスを取得し、 エージェントまたはApplianceのステータスを確認します。
[アクティブ] 以外のステータスは、 エージェントまたはApplianceに問題があることを示している可能性があります。 エージェントがインストールされていない場合、
エージェントのステータスは表示されません。同様に、アプライアンスがインストールされていない場合、アプライアンスのステータスは表示されません。
if computer.anti_malware.module_status:
agent_status = computer.anti_malware.module_status.agent_status
appliance_status = computer.anti_malware.module_status.appliance_status
else:
agent_status = None
appliance_status = None
if agent_status and agent_status != "active":
...
if appliance_status and appliance_status != "active":
...
ステータスが非アクティブの場合は、モジュールのエージェントまたはApplianceステータスメッセージを取得します。
module_info.append(computer.anti_malware.module_status.agent_status_message)
module_info.append(computer.anti_malware.module_status.appliance_status_message)
次の使用例は、不正プログラム対策モジュールが無効になっているコンピュータ、または不正プログラム対策モジュールのステータスがアクティブでないコンピュータを検索します。完全なソースコードサンプルでは、結果がCSVファイルとして保存できる形式で返され、スプレッドシートとして開くことができます。
computers_api = api.ComputersApi(api.ApiClient(configuration))
computers = computers_api.list_computers(api_version, expand=expand.list(), overrides=False)
# Get the list of computers and iterate over it
for computer in computers.computers:
# Module information to add to the CSV string
module_info = []
# Check that the computer has a an agent or appliance status
if computer.anti_malware.module_status:
agent_status = computer.anti_malware.module_status.agent_status
appliance_status = computer.anti_malware.module_status.appliance_status
else:
agent_status = None
appliance_status = None
# Agents that are not active for the module
if agent_status and agent_status != "active":
# Host name
module_info.append(computer.host_name)
# Module state
module_info.append(computer.anti_malware.state)
# Agent status and status message
module_info.append("Agent")
module_info.append(agent_status)
module_info.append(computer.anti_malware.module_status.agent_status_message)
# Appliances that are not active for the module
if appliance_status and appliance_status != "active":
# Host name
module_info.append(computer.host_name)
# Module state
module_info.append(computer.anti_malware.state)
# Appliance status and status message
module_info.append("Appliance")
module_info.append(appliance_status)
module_info.append(computer.anti_malware.module_status.appliance_status_message)
仮想マシンの状態を表示する
コンピュータが仮想マシンである場合、仮想マシンの状態 (仮想マシンベンダーによって定義される) を含むいくつかのプロパティを取得できます。
Computerクラスは、azureARMVirtualMachineSummary、ec2VirtualMachineSummary、vmwareVMVirtualMachineSummaryなどのいくつかの仮想マシン要約オブジェクトへのアクセスを提供します。(完全なリストについては、APIレファレンスを参照してください。)コンピュータの仮想マシンの概要を取得し、状態などの仮想マシンのプロパティを確認するために使用できます。
コンピュータの設定を取得する
Computerオブジェクトには、コンピュータの設定情報が含まれます。取得するにはComputerオブジェクト、作成ComputersApiオブジェクトを取得してから、IDで特定のコンピュータを取得するか、他のプロパティで検索するか、すべてのコンピュータを一覧表示して処理を繰り返します。
ヒントコンピュータの取得時に、すべてのプロパティを含めるか、そのコンピュータに設定されているオーバーライドのみを含めるかを指定します。
|
コンピュータの現在の構成にアクセスするには、
Computerオブジェクトを使用して、保護モジュールのコンピュータ拡張オブジェクトを取得します。例えば、コンピュータの不正プログラム対策の構成や状態に関する情報を取得するには、AntiMalwareComputerExtensionオブジェクトを取得します。必要なコンピュータ情報のみを取得するには、expandパラメータを使用します。# Include Anti-Malware information in the returned Computer object
expand = api.Expand(api.Expand.anti_malware, api.Expand.computer_settings)
# Get the computer object from Server & Workload Protection
computers_api = api.ComputersApi(api.ApiClient(configuration))
computer = computers_api.describe_computer(computer_id, api_version, expand=expand.list(), overrides=False)
# Get the Anti-Malware scan configuration id for the computer
real_time_scan_configuration_id = computer.anti_malware.real_time_scan_configuration_id
# Get the Anti-Malware properties for the computer
am_configs_api = api.AntiMalwareConfigurationsApi(api.ApiClient(configuration))
return am_configs_api.describe_anti_malware(real_time_scan_configuration_id, api_version)
コンピュータの不正プログラム対策設定の検出
AntiMalwareComputerExtensionオブジェクトは、コンピュータの不正プログラム対策設定の次の項目へのアクセスを提供します。- 不正プログラム対策モジュールの実行状態 (オンまたはオフ)
- 不正プログラム検索設定
コンピュータの不正プログラム対策設定を取得するには、次の一般的な手順を実行します。
手順
- 使用する
ComputersApiを取得するオブジェクトComputerオブジェクト。 - を使用します。
Computerを取得するオブジェクトAntiMalwareComputerExtensionオブジェクト。 - 不正プログラム対策モジュールの状態を取得します。
- 検索設定を取得します。
次のステップ
次の例では、コンピュータの不正プログラム対策設定の特定のプロパティを取得します。
# Get the anti-malware scan configuration id for the computer real_time_scan_configuration_id = computer.anti_malware.real_time_scan_configuration_id # Get the anti-malware properties for the computer am_configs_api = api.AntiMalwareConfigurationsApi(api.ApiClient(configuration)) return am_configs_api.describe_anti_malware(real_time_scan_configuration_id, api_version)
適用された侵入防御ルールの取得
コンピュータに適用する侵入防御ルールを決定し、必要な保護が確実に適用されるようにします。
手順
- 使用する
ComputersApiを取得するオブジェクトComputerオブジェクト。 - 各
Computerオブジェクトを取得します。IntrusionPreventionComputerExtensionオブジェクト。 - 侵入防御ルールのリストを取得します。
次のステップ
次の例では、コンピュータに適用される侵入防御ルールを取得します。
# Extract intrusion prevention rules from the computers
im_rules = {}
for computer in computers_list.computers:
im_rules[computer.host_name] = computer.intrusion_prevention.rule_ids
return im_rules
また、APIレファレンスのコンピュータ一覧、コンピュータの説明、コンピュータ検索の操作も参照してください。API呼び出しの認証に関する情報は、Server & Workload Protectionで認証を参照してください。
