簡介
本文說明如何產生CSR和安裝身份憑證,以便在FP 4100/9300系列裝置上用於FXOS的機箱管理員。
必要條件
需求
思科建議您瞭解以下主題:
- 從命令列配置Firepower可擴展作業系統(FXOS)
- 使用憑證簽署請求(CSR)
- 私鑰基礎架構(PKI)概念
採用元件
本文中的資訊係根據以下軟體和硬體版本:
- Firepower(FP)4100和9300系列硬體
- FXOS版本2.10
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
背景資訊
初始配置後,將生成自簽名SSL證書,供機箱管理器Web應用程式使用。由於證書是自簽名的,因此客戶端瀏覽器不會自動信任該證書。新客戶端瀏覽器首次訪問機箱管理器Web介面時,瀏覽器會拋出與您的連線類似的SSL警告(非專用),並要求使用者在訪問機箱管理器之前接受證書。此過程允許安裝由受信任的證書頒發機構簽名的證書,這允許客戶端瀏覽器信任連線,並在沒有警告的情況下啟動Web介面。
設定
產生CSR
執行以下步驟以獲取包含裝置(允許客戶端瀏覽器正確識別伺服器)的IP地址或完全限定域名(FQDN)的證書:
注意:金鑰環名稱可以是任何輸入。在這些示例中,使用firepower_cert。
此範例會建立金鑰大小為1024位元的金鑰環:
Firepower-chassis# scope security
Firepower-chassis /security # create keyring kr220
Firepower-chassis /security/keyring* # set modulus mod1024
Firepower-chassis /security/keyring* # commit-buffer
- 設定CSR欄位。可以只使用基本選項(如使用者名稱)來產生CSR。這也會提示輸入憑證要求密碼。
本示例建立並顯示一個證書請求,該請求帶有用於金鑰環的IPv4地址,並具有以下基本選項:
Firepower-chassis# scope security
Firepower-chassis /security # scope keyring kr220
Firepower-chassis /security/keyring # create certreq ip 192.168.200.123 subject-name sjc04
Certificate request password:
Confirm certificate request password:
Firepower-chassis /security/keyring* # commit-buffer
- 也可以使用更高級的選項來生成CSR,這些選項允許將區域設定和組織等資訊嵌入到證書中。
Firepower-chassis# scope security
Firepower-chassis /security # scope keyring kr220
Firepower-chassis /security/keyring # create certreq
Firepower-chassis /security/keyring/certreq* # set "ip 192.168.200.123"
Firepower-chassis /security/keyring/certreq* # set subject-name "sjc04"
Firepower-chassis /security/keyring/certreq* # set country "US"
Firepower-chassis /security/keyring/certreq* # set dns "bg1-samc-15A"
Firepower-chassis /security/keyring/certreq* # set email "test@cisco.com"
Firepower-chassis /security/keyring/certreq* # set locality "new york city"
Firepower-chassis /security/keyring/certreq* # set org-name "Cisco Systems"
Firepower-chassis /security/keyring/certreq* # set org-unit-name "Testing"
Firepower-chassis /security/keyring/certreq* # set state "new york"
Firepower-chassis /security/keyring/certreq* # commit-buffer
- 匯出CSR以提供給您的證書頒發機構。複製以(包括)-----BEGIN CERTIFICATE REQUEST)-----以(包括)-----END CERTIFICATE REQUEST)結尾-----。
Firepower-chassis /security/keyring/certreq # show certreq
Certificate request subject name: sjc04
Certificate request ip address: 192.168.200.123
Certificate request e-mail name: test@cisco.com
Certificate request country name: US
State, province or county (full name): New York
Locality name (eg, city): new york city
Organization name (eg, company): Cisco
Organization Unit name (eg, section): Testing
Request:
-----BEGIN CERTIFICATE REQUEST-----
MIIBfTCB5wIBADARMQ8wDQYDVQQDEwZzYW1jMDQwgZ8wDQYJKoZIhvcNAQEBBQAD
gY0AMIGJAoGBALpKn1t8qMZO4UGqILKFXQQc2c8b/vW2rnRF8OPhKbhghLA1YZ1F
JqcYEG5Yl1+vgohLBTd45s0GC8m4RTLJWHo4SwccAUXQ5Zngf45YtX1WsylwUWV4
0re/zgTk/WCd56RfOBvWR2Dtztu2pGA14sd761zLxt29K7R8mzj6CAUVAgMBAAGg
LTArBgkqhkiG9w0BCQ4xHjAcMBoGA1UdEQEB/wQQMA6CBnNhbWMwNIcECsEiXjAN
BgkqhkiG9w0BAQQFAAOBgQCsxN0qUHYGFoQw56RwQueLTNPnrndqUwuZHUO03Teg
nhsyu4satpyiPqVV9viKZ+spvc6x5PWIcTWgHhH8BimOb/0OKuG8kwfIGGsEDlAv
TTYvUP+BZ9OFiPbRIA718S+V8ndXr1HejiQGxlDNqoN+odCXPc5kjoXD0lZTL09H
BA==
-----END CERTIFICATE REQUEST-----
匯入證書頒發機構證書鏈
注意:所有證書必須採用Base64格式才能匯入到FXOS。如果從證書頒發機構接收的證書或鏈採用不同的格式,則必須首先使用SSL工具(如OpenSSL)對其進行轉換。
注意:信任點名稱可以是任何輸入。示例中使用了firepower_chain。
Firepower-chassis# scope security
Firepower-chassis /security # create trustpoint tPoint10
Firepower-chassis /security/trustpoint* # set certchain
Enter lines one at a time. Enter ENDOFBUF to finish. Press ^C to abort.
Trustpoint Certificate Chain:
> -----BEGIN CERTIFICATE-----
> MIIDMDCCApmgAwIBAgIBADANBgkqhkiG9w0BAQQFADB0MQswCQYDVQQGEwJVUzEL
> BxMMU2FuIEpvc2UsIENBMRUwEwYDVQQKEwxFeGFtcGxlIEluYy4xEzARBgNVBAsT
> ClRlc3QgR3JvdXAxGTAXBgNVBAMTEHRlc3QuZXhhbXBsZS5jb20xHzAdBgkqhkiG
> 9w0BCQEWEHVzZXJAZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ
> AoGBAMZw4nTepNIDhVzb0j7Z2Je4xAG56zmSHRMQeOGHemdh66u2/XAoLx7YCcYU
> ZgAMivyCsKgb/6CjQtsofvtrmC/eAehuK3/SINv7wd6Vv2pBt6ZpXgD4VBNKONDl
> GMbkPayVlQjbG4MD2dx2+H8EH3LMtdZrgKvPxPTE+bF5wZVNAgMBAAGgJTAjBgkq
> hkiG9w0BCQcxFhMUQSBjaGFsbGVuZ2UgcGFzc3dvcmQwDQYJKoZIhvcNAQEFBQAD
> gYEAG61CaJoJaVMhzCl903O6Mg51zq1zXcz75+VFj2I6rH9asckCld3mkOVx5gJU
> Ptt5CVQpNgNLdvbDPSsXretysOhqHmp9+CLv8FDuy1CDYfuaLtvlWvfhevskV0j6
> jtcEMyZ+f7+3yh421ido3nO4MIGeBgNVHSMEgZYwgZOAFLlNjtcEMyZ+f7+3yh42
> 1ido3nO4oXikdjB0MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFDASBgNVBAcT
> C1NhbnRhIENsYXJhMRswGQYDVQQKExJOdW92YSBTeXN0ZW1zIEluYy4xFDASBgNV
> BAsTC0VuZ2luZWVyaW5nMQ8wDQYDVQQDEwZ0ZXN0Q0GCAQAwDAYDVR0TBAUwAwEB
> /zANBgkqhkiG9w0BAQQFAAOBgQAhWaRwXNR6B4g6Lsnr+fptHv+WVhB5fKqGQqXc
> wR4pYiO4z42/j9Ijenh75tCKMhW51az8copP1EBmOcyuhf5C6vasrenn1ddkkYt4
> PR0vxGc40whuiozBolesmsmjBbedUCwQgdFDWhDIZJwK5+N3x/kfa2EHU6id1avt
> 4YL5Jg==
> -----END CERTIFICATE-----
> ENDOFBUF
Firepower-chassis /security/trustpoint* # commit-buffer
注意:對於使用中間證書的證書頒發機構,必須組合根證書和中間證書。在文本檔案中,將根憑證貼上在頂端,接著貼上鏈結中的每個中間憑證(包括所有BEGIN CERTIFICATE和END CERTIFICATE標誌)。然後,在ENDOFBUF劃分之前貼上整個檔案。
匯入伺服器的簽名身份證書
- 將在上一步中建立的信任點與為CSR建立的金鑰環相關聯。
Firepower-chassis# scope security
Firepower-chassis /security # scope keyring kr220
Firepower-chassis /security/keyring # set trustpoint tPoint10
Firepower-chassis /security/keyring* # set cert
Enter lines one at a time. Enter ENDOFBUF to finish. Press ^C to abort.
Keyring certificate:
> -----BEGIN CERTIFICATE-----
> MIIB/zCCAWgCAQAwgZkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEVMBMGA1UE
> BxMMU2FuIEpvc2UsIENBMRUwEwYDVQQKEwxFeGFtcGxlIEluYy4xEzARBgNVBAsT
> ClRlc3QgR3JvdXAxGTAXBgNVBAMTEHRlc3QuZXhhbXBsZS5jb20xHzAdBgkqhkiG
> 9w0BCQEWEHVzZXJAZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ
> AoGBAMZw4nTepNIDhVzb0j7Z2Je4xAG56zmSHRMQeOGHemdh66u2/XAoLx7YCcYU
> ZgAMivyCsKgb/6CjQtsofvtrmC/eAehuK3/SINv7wd6Vv2pBt6ZpXgD4VBNKONDl
> GMbkPayVlQjbG4MD2dx2+H8EH3LMtdZrgKvPxPTE+bF5wZVNAgMBAAGgJTAjBgkq
> hkiG9w0BCQcxFhMUQSBjaGFsbGVuZ2UgcGFzc3dvcmQwDQYJKoZIhvcNAQEFBQAD
> gYEAG61CaJoJaVMhzCl903O6Mg51zq1zXcz75+VFj2I6rH9asckCld3mkOVx5gJU
> Ptt5CVQpNgNLdvbDPSsXretysOhqHmp9+CLv8FDuy1CDYfuaLtvlWvfhevskV0j6
> mK3Ku+YiORnv6DhxrOoqau8r/hyI/L43l7IPN1HhOi3oha4=
> -----END CERTIFICATE-----
> ENDOFBUF
Firepower-chassis /security/keyring* # commit-buffer
配置機箱管理器以使用新證書
證書現在已安裝,但Web服務尚未配置為使用它。
Firepower-chassis# scope system
Firepower-chassis /system # scope services
Firepower-chassis /system/services # enable https
Firepower-chassis /system/services* # set https port 443
Warning: When committed, this closes all the web sessions.
Firepower-chassis /system/services* # set https keyring kring7984
Firepower-chassis /system/services* # set https cipher-suite-mode high
Firepower-chassis /system/services* # commit-buffer
驗證
使用本節內容,確認您的組態是否正常運作。
- show https - Output顯示與HTTPS伺服器相關聯的金鑰環。它可反映前面提到的步驟中建立的名稱。如果仍然顯示預設值,則未將其更新為使用新證書。
Firepower-chassis
/system/services # show https Name: https Admin State: Enabled Port: 443 Operational port: 443 Key Ring: kring7984
Cipher suite mode: Medium Strength Cipher suite: ALL:!ADH:!EXPORT40:!EXPORT56:!LOW:!RC4:!MD5:!IDEA:+HIGH:+MEDIU M:+EXP:+eNULL
- show keyring <keyring_name> detail - Output顯示已匯入的憑證內容,並顯示其是否有效。
fp4120 /security # scope security
fp4120 /security # show keyring kring7984
detail Keyring kring7984
: RSA key modulus: Mod2048 Trustpoint CA: tPoint10
Certificate status: Valid Certificate: Data: Version: 3 (0x2) Serial Number: 45:00:00:00:0a:de:86:55:16:82:24:f3:be:00:00:00:00:00:0a Signature Algorithm: ecdsa-with-SHA256 Issuer: DC=local, DC=naaustin, CN=naaustin-NAAUSTIN-PC-CA Validity Not Before: Apr 28 13:09:54 2016 GMT Not After : Apr 28 13:09:54 2018 GMT Subject: C=US, ST=California, L=San Jose, O=Cisco Systems, OU=TAC, CN=fp4120.test.local Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: 00:b3:43:8d:e6:06:a0:91:f6:76:7e:2e:09:54:40: 0d:1b:ee:d8:1a:07:07:6e:75:2d:ec:ba:55:c8:c0: a1:9c:a3:8f:26:30:70:91:43:0d:40:0d:66:42:c4: 50:0d:c6:c9:db:7d:bf:b0:ad:1f:31:29:f2:a8:e2: fc:27:30:bb:8a:dc:5e:54:46:51:cb:3e:ff:6b:1e: d6:18:db:de:83:f5:cf:fb:37:74:de:7b:78:19:73: 3a:dc:5b:2b:3d:c3:e6:03:b1:30:82:a0:d2:2e:84: a1:b4:11:15:d7:48:61:7f:8f:8d:c3:8a:4a:09:9f: 9e:49:29:12:26:44:c1:d5:91:da:29:5f:5b:b6:d6: 20:de:47:ff:50:45:14:82:4f:c4:ca:b5:6a:dc:1f: ae:d8:3b:28:a0:f5:6a:ef:a9:93:9b:c0:70:60:ca: 87:6c:91:2f:e0:f9:ae:46:35:84:f3:cc:84:bd:5c: 07:ec:94:c4:8a:3f:4e:bf:16:da:b6:30:e3:55:22: 47:64:15:11:b4:26:a7:bf:20:6f:1a:e2:cf:fd:0f: cd:9a:fd:cb:a3:71:bd:21:36:cb:2f:98:08:61:95: 5a:b5:3c:69:e8:74:d4:7b:31:f6:30:82:33:39:ab: d4:e9:dd:6d:07:da:e7:cb:18:06:b6:1e:5d:3d:5d: 1d:85 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Alternative Name: DNS:fp4120.test.local X509v3 Subject Key Identifier: FF:55:A9:B2:D8:84:60:4C:6C:F0:39:59:59:CB:87:67:03:ED:BB:94 X509v3 Authority Key Identifier: keyid:C8:89:DB:0C:73:EB:17:01:04:05:C6:F1:19:28:10:5B:BA:4E:54:89 X509v3 CRL Distribution Points: Full Name: URI:ldap:///CN=naaustin-NAAUSTIN-PC-CA,CN=naaustin-pc,CN=CDP,CN=Public%20Key%20Services,CN=Services,CN=Configuration,DC=naaustin,DC=local?certificateRevocationList?base?objectClass=cRLDistributionPoint Authority Information Access: CA Issuers - URI:ldap:///CN=naaustin-NAAUSTIN-PC-CA,CN=AIA,CN=Public%20Key%20Services,CN=Services,CN=Configuration,DC=naaustin,DC=local?cACertificate?base?objectClass=certificationAuthority 10.3.6.1.4.1.311.20.2: ...W.e.b.S.e.r.v.e.r X509v3 Key Usage: critical Digital Signature, Key Encipherment X509v3 Extended Key Usage: TLS Web Server Authentication Signature Algorithm: ecdsa-with-SHA256 30:45:02:20:57:b0:ec:d7:09:8a:b1:2d:15:1b:f2:c6:39:10: e3:f7:55:a3:6a:08:e8:24:41:df:4f:16:41:b6:07:35:4b:bf: 02:21:00:ed:47:4e:6e:24:89:04:6f:cf:05:98:e6:b2:0a:08: 2b:ad:1a:91:b8:e8:b4:e4:ef:51:d5:1d:f5:be:8a:d5:4c -----BEGIN CERTIFICATE----- MIIE8DCCBJagAwIBAgITRQAAAArehlUWgiTzvgAAAAAACjAKBggqhkjOPQQDAjBT MRUwEwYKCZImiZPyLGQBGRYFbG9jYWwxGDAWBgoJkiaJk/IsZAEZFghuYWF1c3Rp bjEgMB4GA1UEAxMXbmFhdXN0aW4tTkFBVVNUSU4tUEMtQ0EwHhcNMTYwNDI4MTMw OTU0WhcNMTgwNDI4MTMwOTU0WjB3MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2Fs aWZvcm5pYTERMA8GA1UEBxMIU2FuIEpvc2UxFjAUBgNVBAoTDUNpc2NvIFN5c3Rl bXMxDDAKBgNVBAsTA1RBQzEaMBgG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dGU/YmFzZT9vYmplY3RDbGFzcz1jZXJ0aWZpY2F0aW9uQXV0 aG9yaXR5MCEGCSsGAQQBgjcUAgQUHhIAVwBlAGIAUwBlAHIAdgBlAHIwDgYDVR0P AQH/BAQDAgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMBMAoGCCqGSM49BAMCA0gAMEUC IFew7NcJirEtFRvyxjkQ4/dVo2oI6CRB308WQbYHNUu/AiEA7UdObiSJBG/PBZjm sgoIK60akbjotOTvUdUd9b6K1Uw= -----END CERTIFICATE----- Zeroized: No
- 在Web瀏覽器的位址列中輸入https://<FQDN_or_IP>/,瀏覽到Firepower機箱管理器,並驗證是否顯示新的受信任證書。
警告:瀏覽器還根據位址列中的輸入來驗證證書的使用者名稱,因此,如果向完全限定的域名頒發證書,則必須在瀏覽器中通過這種方式訪問證書。如果通過IP地址訪問它,則即使使用受信任的證書,也會引發其他SSL錯誤(公用名無效)。
疑難排解
目前尚無特定資訊可用於排解此組態的疑難問題。
相關資訊