1 / 35

第十章 網路安全

第十章 網路安全. 常見的網路安全通訊協定 IPSec. AH Header Format. S ecurity P arameter I ndex ( 安全參數識別碼 ) 32 bit 之任意整數 , 來指明通訊兩端事先約定所採用的加密或身份驗證之演算法與其他參數。此 識別碼 (SPI) 和 目的位址 、 轉換格式 ( 此即為 AH 轉換 ) 三者唯一決定一個安全參數組合 ( S ecurity A ssociation) 。.

colin-vega
Download Presentation

第十章 網路安全

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 第十章 網路安全 常見的網路安全通訊協定 IPSec

  2. AH Header Format Security Parameter Index (安全參數識別碼) 32 bit之任意整數,來指明通訊兩端事先約定所採用的加密或身份驗證之演算法與其他參數。此 識別碼 (SPI) 和 目的位址、 轉換格式 (此即為AH轉換) 三者唯一決定一個安全參數組合 (Security Association)。 Authentication Data (身份驗證資料) : 本欄位為任意長度 ( IPv4 為 32bit 的整數倍,IPv6 為64bit 的整數倍) 之資料,其內容為 Integrity Check Value,其長度視所採用的身份認證演算法而定。 Sequence Number (序號) : 為一個 32 bit之嚴格遞增整數,用來去除資料封包在傳遞時產生的重複 ( Duplicated ) 封包。

  3. ESP Header Format Security Parameter Index (安全參數識別碼) :32 bit之任意整數,來指明通訊兩端事先約定所採用的加密或身份驗證之演算法與其他參數。此 識別碼(SPI) 和 目的位址、 轉換格式 (此即為ESP轉換) 三者唯一決定一個安全參數組合 (Security Association)。 Sequence Number (序號) : 為一個 32 bit之嚴格遞增整數,用來去除資料封包在傳遞時產生的重複 ( Duplicated ) 封包。 Authentication Data (身份驗證資料) : 此部份僅為承載之密文之完整檢查碼,與 AH 不同。AH 為整個IP 資料封包之完確檢查值。 Rayload Data ( 承載密文 )完整的IP Packet之密文或IP Packet 的資料部份之密文

  4. Security Gateway GW1 Security Gateway GW2 Internet (隧道模式) 主 機 A 主 機 B 主 機 C 主 機 D (傳送模式) AB:運輸模式 BC:隧道模式 • ESP的傳送模式:

  5. IP ESP的隧道模式及運輸模式各有其優點。 • 隧道模式可以在兩個Security Gateway間建立一個安全“隧道”。 • 運輸模式加密的部份較少,沒有額外的IP標頭,故工作效率較佳。

  6. 格式說明 • SPI、Sequence Number: 和AH的相同 • Payload Data: ESP中定義所承載的密文,有兩種可能 (1)完整的IP資料封包之密文 (2)IP資料封包的資料部份之密文 • 前者稱為隧道模式(Tunnel Mode),後者稱為運輸模式(Transport Mode) • 加密演算法由SPI指明通訊的兩端事先約定所採用的演算法

  7. IPSec 的運作方式 IKE ( Internet Key Exchange ) : Key 為 IPSec作加解密時所須參考的數值。運用IPSec的實體兩端必需知道一組相對的加密金鑰及解密金鑰才能正常運作。IETF定義一組金鑰交換的通訊定: Ineternet Key Exchange ( IKE ) • 資料傳送前IPSec Driver會檢查IPSec Policy決定資料是否需加密處理 • IPSec Driver通知IKE進行協商,而後產生SA • IPSec Driver依照SA的內容進行資料的傳輸 SA ( Security Association ) : 是一組兩端通訊實體的單向關係。由識別碼 ( SPI ) 和目的位址、 轉換格式 ( AH或ESP ) 組合而成。 Secure IP Packet

  8. IPSec 的運作方式(cont'd)

  9. IPSec 實作 測試環境:RedHat 7.3 安裝相關套件 ftp://ftp.xs4all.nl/pub/crypto/freeswan/binaries/RedHat-RPMs/2.4.18-10/ - RedHat 7.3 ftp://ftp.xs4all.nl/pub/crypto/freeswan/binaries/RedHat-RPMs/2.4.18-14/ - Redhat 8.0 1.freeswan-module-1.99_2.4.18_10-0.i386.rpm 2.freeswan-1.99_2.4.18_10-0.i386.rpm 利用 rpm –Uvh 安裝 啟動 ipsec service service ipsec start

  10. IPSec 實作 FreeS/WAN relies on two configuration files: • /etc/ipsec.conf • Setup • Default parameter • Configuration of the tunnel • /etc/ipsec.secrets • private RSA keys • shared secrets

  11. IPSec 實作 42.42.42.1/24 42.42.42.0/24 hostname:left (總公司)IP:192.168.0.254 hostname:right (分公司)IP:192.168.0.253 • 在 left 及 right 均 install 相關 rpm • 在 left (192.168.0.254) 操作1. print your IPsec public key :ipsec showhostkey –left # RSA 2192 bits left leftrsasigkey=0sAQOnwiBPt... 2. get rightrsasigkey :ssh right ipsec showhostkey –right # RSA 2192 bits right rightrsasigkey=0sAQOqH55O…

  12. IPSec 實作 3. Edit /etc/ipsec.conf conn left-to-right # 取個有意義的名字即可 left=192.168.0.254 # 左邊主機的 ip ( 總公司 server 的 ip ) leftsubnet=42.42.42.0/24 # 左邊的主機所連結 subnet ( 總公司的網段 ) leftid=@left.example.com # 左邊主機的 FQDN (總公司 server 的 ip ) leftrsasigkey=0s1LgR7/oUM... # 左邊主機的 public key leftnexthop=X.X.X.X # 左邊主機的 gateway right=192.168.0.253 # 右邊主機的 ip ( 分公司 server 的 ip ) rightsubnet=42.42.42.1/24 # 分公司的網段 rightid=@right.example.com # 右邊主機的 FQDN ( 分公司 server 的 ip ) rightrsasigkey=0sAQOqH55O... # 右邊主機的 public key rightnexthop= X.X.X.X # 右邊主機的 gateway auto=start # 開機時即建立 ipsec tunnel 4.將設定檔 /etc/ipsec.conf copy 至右邊主機(分公司的server ) # scp /etc/ipsec.conf root@right.exampel.com:/etc/ipsec.conf

  13. RHS346 • ( Developing Red Hat VPN Solutions ) • 使用 CIPE架構VPN • 使用 PPTP架構VPN • 如何使用 Windows 95/98/NT/2000/XP連接 PPTP Server • 使用IPSec架構VPN

  14. Reference Site • Linux FreeS/WAN team http://www.freeswan.org/ • Secure VPN Gateway in Redhat 7.3 http://www.hkes.com/themes/hkes/resources/secure_vpn_gateway_in_redhat.htm • Virtual Private Network Consortium- www.vpnc.org • The Automotive Network Exchange - www.anxo.com • National Institute of Standards and Technology - www-08.nist.gov • RADIUS - www.funk.com/RADIUS • TACACS - www.easynet.de/tacacs-faq • Commercial Encryption Export Controls - www.bxa.doc.gov/Encryption • Encryption Privacy and Security Resource Page - www.crypto.com • VPN info on the WEB - kubarb.phsx.ukans.edu/~tbird/vpn.html • http://www.spenneberg.org/

More Related