簡介
本文描述如何在本地FMC上為動態Microsoft 365對象部署和整合CSDAC與Ubuntu 20.04上的Ansible。
必要條件
需求
思科建議您瞭解以下主題:
- 基本的Linux命令。
- 基本Python、Docker和Ansible知識。
- 基本Office 365知識。
採用元件
本文中的資訊係根據以下軟體和硬體版本:
- 執行7.2.5版本的思科防火牆管理中心虛擬(FMCv)VWware。
- 思科安全動態屬性聯結器(CSDAC)版本2.2。
- Ubuntu 4vCPU/8GB版本20.04。
- Docker版本24.0.6。
- Python 3.8.10。
- Ansible 2.12.10。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
背景資訊
思科安全動態屬性(CSDAC)允許從雲提供商收集網路和IP地址等資料,並將其傳送到思科安全防火牆管理中心,以便在訪問控制策略規則中使用。
Cisco Secure Dynamic Attributes Connector允許使用來自各種雲服務平台(如AWS、Github、Google Cloud、Azure、Azure服務標籤、Microsoft Office 365和vCenter)的服務標籤和類別。
由於工作負載的動態性質和IP地址重疊的必然性,在虛擬、雲和容器環境中,IP地址等網路結構不可靠。有時,必須在非網路結構(如虛擬機器(VM)名稱或安全組)上定義策略規則。因此,即使在IP地址或VLAN發生更改時,防火牆策略也具有永續性。可以使用在Ubuntu、CentOs或Red Hat Enterprise Linux虛擬機器上運行的動態屬性聯結器Docker容器來收集這些標籤和屬性。如果您希望在CentOS或Red Hat上安裝CSDAC,請參閱正式文檔指南。
Ubuntu主機上的動態屬性聯結器是使用Ansible Collection安裝的。思科安全動態屬性支援2種型別的介面卡。
- 內部安全防火牆管理中心。
- 雲交付的防火牆管理中心。
本文重點介紹如何通過內部安全防火牆管理中心在Ubuntu主機上為Microsoft Office 365雲服務部署Cisco安全動態屬性連線。
設定
本節分為以下幾個部分:
- Ubuntu 20.04上的CSDAC部署。
- 建立Office 365聯結器。
- 建立vCenter聯結器。
網路圖表
Ubuntu 20.04上的CSDAC部署
本節介紹如何在Ubuntu上安裝必備軟體。
第1步:驗證Docker未安裝。
root@tac:/home/tac# docker --version
Command 'docker' not found.
警告:如果安裝了Docker,請參閱Docker文檔將其解除安裝。
第2步:更新Ubuntu儲存庫。
root@tac:/home/tac# sudo apt -y update && sudo apt -y upgrade
Hit:1 http://security-ubuntu-site/ubuntu focal-security InRelease
Hit:2 http://ubuntu-repository-web-site/ubuntu focal InRelease
Hit:3 http://ubuntu-repository-web-site/ubuntu focal-updates InRelease
Hit:4 http://ubuntu-repository-web-site/ubuntu focal-backports InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
334 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
....
第3步:確認Python版本。
root@tac:/home/tac# /usr/bin/python3 --version
Python 3.8.10
警告:如果Python版本低於3.6,則必須安裝3.6版或更高版本。
第4步:安裝公用庫。
root@tac:/home/tac# sudo apt -y install software-properties-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
...
第5步:安裝Ansible。
root@tac:/home/tac# sudo apt-add-repository -y -u ppa:ansible/ansible && sudo apt -y install ansible
Hit:1 http://security-ubuntu-site/ubuntu focal-security InRelease
Get:2 http://personal-package-archive-site/ansible/ansible/ubuntu focal InRelease [18.0 kB]
Hit:3 http://ubuntu-repository-web-siteubuntu focal InRelease
Hit:4 http://ubuntu-repository-web-site/ubuntu focal-updates InRelease
Hit:5 http://ubuntu-repository-web-site/ubuntu focal-backports InRelease
Get:6 http://personal-package-archive-site/ansible/ansible/ubuntu focal/main amd64 Packages [1 132 B]
Get:7 http://personal-package-archive-site/ansible/ansible/ubuntu focal/main i386 Packages [1 132 B]
Get:8 http://personal-package-archive-site/ansible/ansible/ubuntu focal/main Translation-en [756 B]
Fetched 21.1 kB in 3s (7 526 B/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
...
第6步:驗證Ansible版本。
root@tac:/home/tac# ansible --version
ansible [core 2.12.10]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.8.10 (default, May 26 2023, 14:05:08) [GCC 9.4.0]
jinja version = 2.10.1
libyaml = True
註:對Ansible而言,引用Python 2.x是正常的。聯結器仍使用Python 3.6。
第7步:使用Ansible獲取動態屬性聯結器軟體。
root@tac:/home/tac# ansible-galaxy collection install cisco.csdac
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy-ansible-site/download/cisco-csdac-2.2.1.tar.gz to /root/.ansible/tmp/ansible-local-52406urwp91ou/tmpqabv89vb/cisco-csdac-2.2.1-fr29zaq5
Downloading https://galaxy-ansible-site/download/community-crypto-2.15.1.tar.gz to /root/.ansible/tmp/ansible-local-52406urwp91ou/tmpqabv89vb/community-crypto-2.15.1-dkc897hb
Installing 'cisco.csdac:2.2.1' to '/root/.ansible/collections/ansible_collections/cisco/csdac'
cisco.csdac:2.2.1 was installed successfully
Installing 'community.crypto:2.15.1' to '/root/.ansible/collections/ansible_collections/community/crypto'
Downloading https://galaxy-ansible-site/download/community-general-7.4.0.tar.gz to /root/.ansible/tmp/ansible-local-52406urwp91ou/tmpqabv89vb/community-general-7.4.0-cr9imbx3
community.crypto:2.15.1 was installed successfully
Installing 'community.general:7.4.0' to '/root/.ansible/collections/ansible_collections/community/general'
community.general:7.4.0 was installed successfully
第8步:轉到csdac目錄。
root@tac:/home/tac# cd ~/.ansible/collections/ansible_collections/cisco/csdac/
第9步:安裝集群服務。
root@tac:~/.ansible/collections/ansible_collections/cisco/csdac# ansible-playbook default_playbook.yml --ask-become-pass
BECOME password:
[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match 'all'
[WARNING]: running playbook inside collection cisco.csdac
PLAY [localhost] ***************************************************************
TASK [Gathering Facts] *********************************************************
ok: [localhost]
TASK [cisco.csdac.csdac : Define Python Interpreter] ***************************
ok: [localhost]
...
TASK [cisco.csdac.csdac : verify that core services are started] ***************
ok: [localhost]
TASK [cisco.csdac.csdac : verify that core services are started] ***************
ok: [localhost]
TASK [cisco.csdac.csdac : verify that core services are started] ***************
ok: [localhost]
TASK [cisco.csdac.csdac : verify that core services are started] ***************
ok: [localhost]
TASK [cisco.csdac.csdac : Post task] *******************************************
ok: [localhost] => {}
MSG:
Please login in to https://172.16.1.53 to configure csdac application
PLAY RECAP *********************************************************************
localhost : ok=72 changed=8 unreachable=0 failed=0 skipped=35 rescued=0 ignored=0
警告:如果由於「Permissions denied with Docker daemon socket」導致安裝失敗,請考慮思科錯誤ID CSCwh58312或聯絡思科TAC。
第10步:使用HTTPS協定使用CSDAC IP地址登入到聯結器。
注意:初始登入的使用者名稱為「admin」,密碼為「admin」。首次成功登入後,系統將要求更改密碼。
建立Office 365聯結器
步驟1:登入到動態屬性聯結器。
第2步:按一下「聯結器」。
第3步:新增Office 365聯結器:按一下「新增」圖示(+),然後按一下「Office 365」。
第4步:使用名稱、基本API URL、例項名稱以及啟用或禁用可選IP來配置聯結器。
考慮下一個:
第5步:按一下「測試」,確保在儲存聯結器配置之前測試成功。
第6步:儲存並確保狀態為「OK」。
建立vCenter聯結器
第1步:登入到動態屬性聯結器。
第2步:按一下「介面卡」。
第3步:新增新介面卡:點選新增圖示(+),然後點選「本地防火牆管理中心」。
第4步:使用名稱、IP地址、埠和使用者/密碼配置介面卡。
警告:在專用於介面卡連線的UI上建立新的FMC使用者。使用現有使用者可能會在CSDAC或內部防火牆管理中心UI上建立意外註銷。
注意:使用者角色配置必須具有「管理員」、「訪問管理員」或「網路管理員」角色。在IP地址欄位上使用內部防火牆管理中心FQDN。
第5步:開啟內部防火牆安全管理中心UI。
第6步:從瀏覽器下載HTTPS PEM(鏈)證書:點選瀏覽器上顯示的HTTPS掛鎖、安全連線、更多資訊、檢視證書、PEM(鏈)。
這會下載具有憑證鏈結的.pem檔案。
註:收集HTTPS本地安全防火牆管理中心證書的步驟屬於Firefox瀏覽器。如果使用其他瀏覽器,請查詢類似步驟。
第7步:開啟Dynamic Attributes Connector,然後按一下「Get certificate」和「Browse from file...」。
第8步:上傳.pem證書並按一下「測試」以確保測試成功。
警告:確保Ubuntu電腦上配置的DNS伺服器可以解析內部防火牆管理中心FQDN,否則,測試可能失敗。
第9步:儲存並確保狀態為「OK」。
注意:無法為Office 365建立動態屬性篩選器。
第10步:開始在本地防火牆管理中心UI上使用動態Office 365屬性建立訪問控制策略規則。
驗證
驗證Ubuntu for Core services、Connectors和Adapters上的容器狀態。
root@tac://# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
44f71f675ff1 public.ecr.aws/e6e4t5f5/muster_fmc_adapter:2.2.0-latest "./docker-entrypoint…" 12 hours ago Up 12 hours 50070/tcp muster-adapter-fmc.2.muster
88826cf0742f public.ecr.aws/e6e4t5f5/muster_o365_connector:2.2.0-latest "./docker-entrypoint…" 13 hours ago Up 13 hours 50070/tcp muster-connector-o365.3.muster
4c2c73d351e2 public.ecr.aws/e6e4t5f5/muster_envoy:2.2.0-latest "/docker-entrypoint.…" 2 days ago Up 2 days 0.0.0.0:443->8443/tcp muster-envoy
67f3afae2165 public.ecr.aws/e6e4t5f5/muster_ui:2.2.0-latest "/docker-entrypoint.…" 2 days ago Up 2 days 8080/tcp muster-ui
722a764c54e9 public.ecr.aws/e6e4t5f5/muster_ui_backend:2.2.0-latest "./docker-entrypoint…" 2 days ago Up 2 days 50031/tcp muster-ui-backend
038654545f30 public.ecr.aws/e6e4t5f5/muster_bee:2.2.0-latest "/bin/sh -c /app/bee" 2 days ago Up 2 days 50050/tcp, 50443/tcp muster-bee
90cfd7e3a28b public.ecr.aws/e6e4t5f5/muster_etcd:2.2.0-latest "etcd" 2 days ago Up 2 days 2379-2380/tcp muster-etcd
從CSDAC UI驗證聯結器狀態。
從CSDAC UI驗證介面卡狀態。
驗證防火牆管理中心上的Office 365動態屬性。
建立或編輯訪問控制策略規則,按一下「動態屬性」,按一下「可用屬性」,然後選擇「動態對象」。
注意:如果未列出Office 365動態對象,則整合可能存在問題。檢查疑難排解部分或聯絡Cisco TAC。
疑難排解
如果Ansible存在安全動態屬性聯結器安裝問題,請收集「~/.ansible/collections/ansible_collection/cisco/csdac/logs/」目錄中的「csdac.log」。
root@tac://# cd ~/.ansible/collections/ansible_collections/cisco/logs/
root@tac:~/.ansible/collections/ansible_collections/cisco/csdac/logs# ls -lth
total 276K
-rw-r--r-- 1 root root 272K sep 14 15:37 csdac.log
在此檔案中找到安裝失敗日誌。使用「cat」或「less」Linux命令將其開啟,瀏覽故障日誌,或聯絡Cisco TAC並提供此檔案。
有時,Ansible安裝由於「許可權被拒絕」而失敗。瀏覽csdac.log檔案並查詢「許可權被拒絕」日誌。
TASK [cisco.csdac.csdac : print result of csdac command line start command (stderr)] ***
ok: [localhost] => {
"muster_cli_start_result.stderr_lines": [
"permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post \"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/volumes/create\": dial unix /var/run/docker.sock: connect: permission denied",
"permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post \"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/volumes/create\": dial unix /var/run/docker.sock: connect: permission denied",
"permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post \"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/volumes/create\": dial unix /var/run/docker.sock: connect: permission denied",
"permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post \"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/networks/create\": dial unix /var/run/docker.sock: connect: permission denied",
"docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post \"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create\": dial unix /var/run/docker.sock: connect: permission denied.",
"See 'docker run --help'.",
"docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post \"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create\": dial unix /var/run/docker.sock: connect: permission denied."
如果找到類似的日誌,請考慮Cisco錯誤ID CSCwh58312或與Cisco TAC聯絡以獲得幫助。
如果「docker ps -a」指示容器已關閉或要在出現問題時重新啟動容器,則可以使用「docker restart container-id」命令重新啟動容器。
示例:重新啟動容器ID為「88826cf0742f」的Office 365。
root@tac://# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
44f71f675ff1 public.ecr.aws/e6e4t5f5/muster_fmc_adapter:2.2.0-latest "./docker-entrypoint…" 12 hours ago Up 12 hours 50070/tcp muster-adapter-fmc.2.muster
88826cf0742f public.ecr.aws/e6e4t5f5/muster_o365_connector:2.2.0-latest "./docker-entrypoint…" 13 hours ago Up 13 hours 50070/tcp muster-connector-o365.3.muster
root@tac://# docker restart 88826cf0742f
root@tac://# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
44f71f675ff1 public.ecr.aws/e6e4t5f5/muster_fmc_adapter:2.2.0-latest "./docker-entrypoint…" 12 hours ago Up 12 hours 50070/tcp muster-adapter-fmc.2.muster
88826cf0742f public.ecr.aws/e6e4t5f5/muster_o365_connector:2.2.0-latest "./docker-entrypoint…" 13 hours ago Up 2 seconds 50070/tcp muster-connector-o365.3.muster
驗證與CSDAC的連線,並驗證是否在安全防火牆管理中心上建立對象。
> expert
sudoadmin@firepower:~$ sudo su -
Password:
root@firepower:/Volume/home/admin# cat /var/opt/CSCOpx/MDC/log/operation/usmsharedsvcs.log
17-Sep-2023 17:24:58.046,[INFO],(DefenseCenterServiceImpl.java:1462)
com.cisco.nm.vms.api.dc.DefenseCenterServiceImpl, ajp-nio-127.0.0.1-9009-exec-2
** REST Request [ CSM ]
** ID : ff3e6259-2417-48cc-8e5e-a41d0bd04b39
** URL: POST /audit
{
"version":"7.2.5",
"requestId":"ff3e6259-2417-48cc-8e5e-a41d0bd04b39",
"data":{
"userName":"TAC",
"subsystem":"API",
"message":"POST https://FMC-FQDN/api/fmc_config/v1/domain/e276abec-e0f2-11e3-8169-6d9ed49b625f
/object/bulkdynamicobjects Created (201) - The request has been fulfilled and resulted in a new resource being created",
"sourceIP":"172.16.1.53",
"domainUuid":"e276abec-e0f2-11e3-8169-6d9ed49b625f",
"time":"1694971497660"},"deleteList":[]
}
相關資訊
有關思科安全動態屬性(CSDAC)的其他檔案,請瀏覽以下網站:
關於思科動態屬性聯結器
https://www.cisco.com/c/en/us/td/docs/security/secure-firewall/integrations/dynamic-attributes-connector/220/cisco-secure-dynamic-attributes-connector-v220/m_about-the-cisco-dynamic-attributes-connector_21.html
安裝和升級思科安全動態屬性聯結器
https://www.cisco.com/c/en/us/td/docs/security/secure-firewall/integrations/dynamic-attributes-connector/220/cisco-secure-dynamic-attributes-connector-v220/install-the-cisco-secure-dynamic-attributes-connector.html
配置思科動態屬性聯結器
https://www.cisco.com/c/en/us/td/docs/security/secure-firewall/integrations/dynamic-attributes-connector/220/cisco-secure-dynamic-attributes-connector-v220/configure-the-cisco-secure-dynamic-attributes-collector.html
在訪問控制策略中使用動態對象
https://www.cisco.com/c/en/us/td/docs/security/secure-firewall/integrations/dynamic-attributes-connector/220/cisco-secure-dynamic-attributes-connector-v220/use-dynamic-objects-in-access-control-rules.html
動態屬性聯結器故障排除
https://www.cisco.com/c/en/us/td/docs/security/secure-firewall/integrations/dynamic-attributes-connector/220/cisco-secure-dynamic-attributes-connector-v220/troubleshoot-the-dynamic-attributes-connector.html
.
思科錯誤ID CSCwh58312。