2023 年 03 月 - 設定雲端服務的防火牆的方法 === ### 防火牆怎麼運作 Q: 為什麼要關 port? 防守方要做的事情是什麼 -> 增加攻擊方的難度、門檻 -> 關 port 減少攻擊的入口 Q: 雲端跟現實的防火牆有差異嗎? 雲端跟現實的防火牆沒差別 有軟體防火牆(通常從 L7 開始看) 也有硬體防火牆 硬體防火牆搭配專門處理的晶片,通常效率更高 Q: 防火牆怎麼運作? 一般對第二三四層做處理 Q: 封包長怎樣? 封包的資訊,會一層一層包上來 L3 那層(Internet)的資訊裡面會包含例如:Source Address, Destination 可以透過 wireshark 來看:https://www.wireshark.org/download.html ethernet 實體網路線 設備連線的資訊 Frame Ethernet Internet Transmission Data OSI https://zh.wikipedia.org/zh-tw/OSI%E6%A8%A1%E5%9E%8B 第一層 實體: 網卡、網路線 第二層 資料連結: eg. MAC 第三層 網路: eg. IP 第四層 傳輸: eg. TCP (port) 第五層 Session ```ruby # frozen_string_literal: true require "socket" # L4 -> TCP == Protocol server = TCPServer.new("0.0.0.0", 8888) # L5 -> Session client = server.accept # L6/L7 -> App client.puts "HTTP/1.1 200 OK" client.puts client.puts client.puts "Hello World" client.puts Time.now client.close ``` 例如,ELB 其實有作用在不同層的方案: https://aws.amazon.com/tw/elasticloadbalancing/features/?nc=sn&loc=2&dn=1 Q: 特殊應用晶片? ASIC GPU & CPU https://zh.wikipedia.org/zh-tw/%E8%BB%9F%E9%AB%94%E5%AE%9A%E7%BE%A9%E7%B6%B2%E8%B7%AF VPC 設定 VPC 在第三層 https://zh.wikipedia.org/zh-tw/%E9%AB%98%E5%8F%AF%E7%94%A8%E6%80%A7%E9%9B%86%E7%BE%A4
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up