簡介
本文檔介紹可用於Linux和MacOS上的安全終端聯結器的命令列介面(CLI)命令。
背景資訊
CLI命令可供系統上的所有使用者使用;但是,某些命令取決於策略配置和/或根許可權。依賴於此的命令將在本文中介紹。
Cisco安全終端Mac/Linux CLI
導覽至CLI
在系統上安裝並運行安全終端聯結器時,安全終端CLI可用:
- 開啟Mac/Linux上的Terminal視窗。
- 使用以下路徑運行CLI:
- 在Linux上
:/opt/cisco/amp/bin/ampcli
- 在Mac上
:/opt/cisco/amp/ampcli
- CLI啟動時,系統會顯示以下消息:
ampcli - Cisco Secure Endpoint Connector Command Line Interface
Interactive mode
Enter 'q' or Ctrl+c to Exit
[logger] Set minimum reported log level to notice
Trying to connect...
Connected.
ampcli>
可用的CLI命令
注意:所有可用的CLI命令也可直接從命令列運行,例如/opt/cisco/amp/bin/ampcli
helpor/opt/cisco/amp/ampcli
helpworks與啟動CLI和runhelp的相同。
- 如需完整的CLI命令清單,使用者可以執行
help
:
ampcli> help
about About Cisco Secure Endpoint connector
bp Show and sync behavioral protection signatures
* See 'bp help' for more.
clamav Show and sync ClamAV definitions
* See 'clamav help' for more.
definitions Show virus definitions
defupdate Update virus definitions
exclusions List custom exclusions
history Show event history
* See 'history help' for more.
notify Toggle notifications
policy Show policy
quarantine List/restore quarantined file(s)
* See 'quarantine help' for more.
quit (or q) Quit ampcli interactive mode
scan Initiate/pause/stop a scan
* See 'scan help' for more.
status Get ampdaemon status
* See 'status help' for more.
sync Sync policy
verbose Toggle verbose mode
- 指令
掃描
中, 歷史
中, 隔離
、clamav
和bptake附加引數,這些引數在使用者運行命令時進行了說明 說明
:
ampcli> scan help
Supported scan parameters:
flash Perform a flash scan
full Perform a full scan
custom Perform a custom scan on a file or directory (recursive)
e.g. '...> scan custom file_or_directory_to_scan'
pause Pause a running scan
resume Resume a paused scan
cancel Cancel a running scan
list List scheduled scans
ampcli> history help
Supported history parameters:
list List history
* Listing starts at page 1. Each time 'list' is run we move to
the next page. Specify a page number to jump directly to
that page.
pagesize Set history page size (max: 12)
* e.g. 'ampcli> history pagesize 10'
ampcli> quarantine help
Supported quarantine parameters:
list List currently quarantined files
* Listing starts at page 1. Each time 'list' is run we move to
the next page. Specify a page number to jump directly to
that page.
restore Restore file by quarantine id
e.g. '...> quarantine restore
' run 'quarantine list' first to find
in listing
ampcli> clamav help
Supported clamav parameters:
status Display engine and definition information
sync Synchronizes ClamAV definitions
ampcli> bp help
Supported bp parameters:
status Display engine and definition information
sync Synchronizes BP signatures
附註:使用幫助
引數為給定命令提供支援的輸入引數,狀態幫助除外除外
.當獲得幫助
是使用status CLI命令發出的,它顯示所有支援的聯結器狀態的清單,以及每種狀態的簡短說明和可能原因。表中當前聯結器的狀態由**指示。
CLI命令用法
about
— 提供聯結器的版本和GUID等資訊。
ampcli> about
Cisco Secure Endpoint Connector v1.16.0.123
Copyright (c) 2013-2021 Cisco Systems, Inc. All rights reserved.
This product incorporates open source software; refer to
/opt/cisco/amp/doc/acknowledgement.txt for details.
[ 22b608b3-b20e-4bd3-8b53-def824acce8a ]
bp
(此選項僅適用於Linux聯結器版本1.22.0及更高版本(不適用於Mac))
ampcli> bp status
Behavioral Protection is not enabled
ampcli> bp status
APDE Engine Version: 3.1.0.0
BP Mode: Protect
BP Signature Serial Number: 8071
BP Signature Last Loaded: 2023-05-02 05:44:09 PM
ampcli> clamav status
Definition Version: ClamAV(bytecode.cvd: 334, daily.cvd: 26893, main.cvd: 62)
Definitions Published: bytecode.cvd: 22 Feb 2023 16-33 -0500
daily.cvd: 01 May 2023 03-22 -0400
main.cvd: 16 Sep 2021 08-32 -0400
Definitions Last Updated: 2023-05-01 04:01:55 PM
defupdate
— 向雲傳送更新病毒定義的請求。
ampcli> exclusions
Exclusions:
Path /home
Path /mnt/hgfs
Regular Expression /var/log/.*\.log
歷史
history list
— 列出聯結器活動的歷史記錄(掃描、隔離區等)
history pagesize <numeric_value>
— 設定歷史記錄檢視的pagesize(最多12個)
ampcli> history pagesize 12
Page size set to 12
孤立
(此選項僅適用於Mac聯結器版本1.21.0及更高版本(不適用於Linux))
isolate stop <token>
— 使用用於啟動隔離會話的令牌停止終端隔離會話
notify
— 在CLI中開啟/關閉聯結器通知。
- 必須在聯結器策略中啟用此設定。
- 在Mac上,這不會影響UI中的通知。
ampcli> notify
Notifications set to on
ampcli> notify
Notifications set to off
ampcli> policy
Quarantine Behavior:
Quarantine malicious files.
Protection:
Monitor program install.
Monitor program start.
Passive on-execute mode.
Proxy: NONE
Notifications: Do not display cloud notifications.
Policy: Audit Policy for Cisco Secure Endpoint (#5755)
Last Updated: 2020-01-08 04:49 PM
Definition Version: ClamAV(bytecode.cvd: 331, daily.cvd: 25721, main.cvd: 59)
Definitions Last Updated: 2020-01-08 05:09 PM
對於Mac聯結器版本1.16.0和更高版本,對於Linux聯結器版本1.17.0和更高版本,策略包括Orbital的策略狀態:
Orbital: Enabled
軌道政策設定有兩個值:
- 已啟用:通過策略啟用軌道。
- 已禁用:通過策略禁用軌道。
對於Mac聯結器版本1.21.0及更高版本(不在Linux上),策略包括端點隔離的策略狀態:
Isolation: Enabled
隔離策略設定有兩個值:
- 已啟用:通過策略啟用終端隔離。
- 已禁用:通過策略禁用終端隔離。
狀態
— 以JSON格式顯示聯結器狀態
posture prettyprint
- 列印帶有漂亮列印JSON格式的posture
ampcli> posture
{"running": true, "connected": true, "connector_version": "1.19.1.1419", "agent_uuid": "e03ecde8-1aee-4d15-8bca-100e952ee4b9", "offline_engine": "ClamAV", "offline_engine_version": "0.103.5", "definition_version": "osx.cvd:1152", "last_definition_update_published": "osx.cvd: 05 May 2022 13-00 -0400", "last_definition_update_success": 1651857785, "last_scan": 1651857897, "last_scan_status": false, "protect_file_mode": true, "protect_process_mode": true, "scans": [{"scan_type": "flash", "scan_in_progress": false, "last_scan_finished": 1651857039}, {"scan_type": "full", "scan_in_progress": false, "last_scan_finished": 1651857897}, {"scan_type": "custom", "scan_in_progress": false, "last_scan_finished": 1651856819}], "engines": [{"enabled": true, "name": "ClamAV", "version": "0.103.5", "definitions": [{"version": 1152, "name": "osx.cvd", "timestamp": 1651770000, "last_successful_update": 1651857785}]}]}
隔離
(此選項僅對具有root許可權的使用者可用。)
隔離清單
— 列出系統上的隔離專案。
quarantine restore <quarantine_id>
— 通過隔離id(可通過quarantine list命令找到)恢復隔離
檔案。
quit(或q)
— 退出安全終端Mac/Linux聯結器CLI。
-
scan flash
— 執行系統的快閃記憶體掃描。
scan full
— 執行系統的完全掃描。
掃描自定義<path_to_scan>
— 掃描指定的檔案或目錄。
掃描暫停
— 暫停當前運行的所有掃描。
掃描恢復
— 恢復當前暫停的所有掃描。
掃描取消
— 取消當前運行的所有掃描。
掃描清單
— 列出要在系統上執行的所有計畫掃描。
status
— 提供系統上聯結器的當前狀態。
狀態幫助
-顯示一個表,其中包含所有聯結器狀態、當前聯結器狀態、每個狀態狀態的說明以及指定狀態的原因。
ampcli> status
Status: Connected
Mode: Normal
Scan: Ready for scan
Last Scan: 2020-01-22 03:57 PM
Policy: Audit Policy for Cisco Secure Endpoint (#5755)
Command-line: Enabled
Faults: None
如果端點存在故障,「故障」欄位將顯示每個嚴重性級別(嚴重/主要/次要)的故障數。自聯結器版本1.12.3起,CLI顯示故障ID
欄位,顯示終端上出現的每個故障的故障代碼。CLI輸出與終端上存在的每個故障相關的指南。
例如:
Faults: 1 Critical, 1 Major
Fault IDs: 1, 3
ID 1 - Critical: The system extensions failed to load. Approve the system extensions in Security & Privacy System Preferences.
ID 3 - Major: Full Disk Access not granted. Grant access to the ampdaemon executable in Security & Privacy System Preferences.
ampcli> status help
Status Description Reason(s)
=================================================================================
| Initializing... | Program starting/loading. | --
| | |
| Provisioning... | Endpoint identity | --
| | enrollment/subscription. |
| | |
| Provisioning | Endpoint identity | Cannot reach AMP services.
| failed, retrying | enrollment/subscription failed. | Missing SSL certificates.
| | Connector will retry. |
| | |
| Registering... | Registering endpoint identity. | --
| | |
| Registration | Endpoint identity registration | Cannot reach AMP services.
| failed, retrying | failed. Connector will retry. | Missing SSL certificates.
| | |
| Connecting... | Registering with disposition | --
| | service. |
| | |
| Connection failed, | Registration with disposition | Cannot reach AMP services.
| retrying | service failed. Connector will | Missing SSL certificates.
| | retry. |
| | |
| ** Connected | Enrollment and registration | --
| | succeeded. Connected to AMP |
| | services. Connector is operating |
| | normally. |
| | |
| Disabled | Connector is not operational. | AMP subscription is invalid
| | | or has expired.
| | |
| Disconnected, | Lost connection to the disposition | Network connection to the
| retrying | service after an initial | disposition service has been
| | connection was established. | interrupted.
| | Connector will attempt to |
| | reconnect. |
| | |
| Offline (the | The local network has been | Cable disconnected.
| network is down) | disconnected. | The network interface is
| | | disabled.
| | |
=================================================================================
** indicates the current status of the Connector
對於Mac聯結器版本1.16.0和更高版本,對於Linux聯結器版本1.17.0和更高版本,狀態包括電腦上Orbital的當前狀態:
Orbital: Enabled (Running)
軌道狀態有三個值:
- 已啟用(正在運行):表示當前策略已啟用Orbital,並且Orbital服務當前在電腦上運行。
- 已啟用(未運行):表示當前策略已啟用Orbital,但Orbital服務當前未在電腦上運行。
- 已禁用:表示當前策略未啟用軌道。
對於Mac聯結器版本1.21.0及更高版本(不適用於Linux),狀態包括電腦上端點隔離的當前狀態:
Isolation: Isolated
軌道狀態有三個值:
- Isolated:表示當前策略已啟用端點隔離,並且電腦與網路隔離。
- Not Isolated:表示當前策略已啟用Endpoint Isolation,但電腦未隔離。
- Disabled in Policy:表示當前策略未啟用端點隔離。
ampcli> verbose
Verbose mode set to on
ampcli> verbose
Verbose mode set to off
其他資訊
技術支援與文件 - Cisco Systems
思科安全終端 — 使用手冊