2023年1月6日 星期五

Detect if a VM is running in Google Compute Engine

Detect if a VM is running in Compute Engine

sudo dmidecode -s system-product-name | grep "Google Compute Engine"
這個需要 root 權限,實際上是去讀取 /sys/firmware/dmi/tables/DMI
用 strings /sys/firmware/dmi/tables/DMI | grep "Google Compute Engine" 也行

若程式沒有 root 權限,可以去讀取 /etc/hosts 有沒有包含 Added by Google 字樣
grep "Added by Google" /etc/hosts

沒有留言:

LINE Bot Webhook Source IP

根據 http log,LINE Bot Webhook 來源 IP 只會用這兩段 147.92.149.0/24 147.92.150.0/24 不是很確定是否還有其他段,ACL 可以先設 allow 147.92.128.0/17 再長期觀察,限縮區段