Skip to content

Nuface Blog

隨意隨手記 Casual Notes

Menu
  • Home
  • About
  • Services
  • Blog
  • Contact
  • Privacy Policy
  • Login
Menu

Blog

The Many Potholes When Moving Webmail: Docker Networking, Reverse Proxy, iptables & DNS — A Complete Note

Posted on 2025-11-052025-11-05 by Rico

Symptoms & Clues Root Causes (Multiple) Quick Concept Recap Battle-Tested Diagnostic Commands Fix Steps (Pick What You Need) A) Minimal change: allow Container → Host in INPUT This was the actual unlock in this incident. Simple (what worked): Safer (choose one style): B) Make Docker auto-rules robust (long-term “right way”) C) rp_filter in multi-bridge/PPPoE Reverse…

Read more

把 webmail 搬家踩到的一路坑:Docker 網路、反向代理、iptables 與 DNS 的完整筆記

Posted on 2025-11-052025-11-05 by Rico

症狀與線索 問題根因(多重) 關鍵概念快速複習 最有用的診斷指令(直接抄) 修復步驟(可擇要) A) 最小變更:放行「容器 → 主機」的 INPUT 這是這次真正解鎖的一步。 簡易版(你採用的做法): 更精準(建議其一): B) 讓 Docker 自動規則恢復完整(長期正道) C) rp_filter 與多橋接/PPPoE 反向代理設定要點(兩種做法) 作法 1:主機 IP + 發布埠(不依賴容器名解析) wwwapp vhost: 配合上面的 INPUT 放行與 DOCKER nat 鏈中的 dpt:83 -> 172.24.x.y:8000 即可。 作法 2:把 wwwapp 接到 mail-network 這樣可用容器名: 避免了一層髮夾 DNAT,但需要你調整 wwwapp 的 network。 最後提供一份「乾淨可重複」的最小規則片段 前提:INPUT 預設 DROP;Docker 用 nft;其餘規則由…

Read more

KVM/Libvirt Field Notes: VM Migration, Operations, and Troubleshooting

Posted on 2025-11-042025-11-04 by Rico

(Example: Moving a Windows 10 VM from a3520 → a1550) This note records how we moved win10-cht-pro-basic from a3520 (CentOS 7) to a1550 (Ubuntu 24), including common operations, the cold-migration flow, XML adjustments, RDP/console access, ways to get the guest IP, and frequent errors. Reuse this as a checklist for future cases. 1) Handy virsh…

Read more

KVM/Libvirt 實戰筆記:VM 搬移、操作指令與疑難排解(以 Win10 由 a3520→a1550 為例)

Posted on 2025-11-042025-11-04 by Rico

這篇把這次把 win10-cht-pro-basic 從 a3520 (CentOS 7) 搬到 a1550 (Ubuntu 24) 的過程與重點全記下來,包含基本操作、冷遷移流程、XML 調整、RDP/主控台連線、取 IP 方法與常見錯誤排查。未來同類案件照表操課即可。 一、最常用 virsh 指令小抄 二、冷遷移(建議做法,跨版本最穩) CentOS7 ↔ Ubuntu24 的 libvirt/QEMU 版本差距大,不建議 live migrate。冷遷移:關機→匯出→搬磁碟→修 XML→匯入。 1) 在來源 a3520 關機並匯出定義 2) 複製虛擬磁碟到目的 a1550 先查磁碟路徑: 搬檔: 3) 在 a1550 調整 XML(重點 4 件) 打開 /tmp/win10.xml 依下列重點修改: (A) QEMU 執行檔路徑(Ubuntu 24) 來源機若是 /usr/libexec/qemu-kvm 會報錯,需改為上面這條。 (B) CPU…

Read more

【WordPress Tips】Show “Login / Logout” Dynamically in the Frontend Menu (Supports Ultimate Member Plugin)

Posted on 2025-11-042025-11-04 by Rico

In my WordPress site, I wanted the navigation menu to display “Login” when users are not logged in, and automatically change to “Logout” after login.Here’s how I achieved it — a clean and simple solution that works perfectly with the Ultimate Member plugin. 🎯 Goal 🧱 Method 1: Use a Placeholder Menu Item Step 1:…

Read more

【WordPress 筆記】前端選單動態切換登入/登出(支援 Ultimate Member 外掛)

Posted on 2025-11-042025-11-04 by Rico

在 WordPress 網站的導覽列中,我希望使用者未登入時顯示「登入」,登入後則自動變成**「登出」**。以下記錄整個設定過程,方便日後備查。 🎯 實現目標 🧱 方法一:在選單中加入佔位項目 Step 1:建立選單項目 到 外觀 → 選單新增一個自訂連結: 儲存選單。 Step 2:加入下列程式碼 將以下程式碼貼到主題的 functions.php 或用「Code Snippets」外掛執行。 🧩 如何找到 Ultimate Member 的登入頁 URL 💡 其他建議 🚀 結論 這個方法簡單又穩定,不需額外外掛即可實現: 📌 延伸參考

Read more

Building a Custom Firewall Without Affecting Other Services’ Rules

Posted on 2025-11-042025-11-04 by Rico

— e.g. Docker, Fail2Ban, libvirt — In real-world environments, we often maintain our own firewall scripts — for example, to handle NAT, DNAT, outbound access control, or time-based restrictions.However, servers frequently run services such as Docker, Fail2Ban, or libvirt, which also manage their own iptables rules. If you flush all existing rules using something like…

Read more

自建防火牆,不干擾其他系統服務的防火牆規則

Posted on 2025-11-042025-11-04 by Rico

— 以 Docker、Fail2Ban 為例 — 在實際維運環境中,我們常會自己寫一份防火牆腳本來控管流量,例如 NAT、DNAT、上網白名單、時間限制等。但如果主機同時運行 Docker、Fail2Ban、libvirt 等服務,這些服務也會在 iptables 中自動產生規則。若不小心「清空整個防火牆」,就會把它們的規則一併刪除,導致容器、SSH、甚至 fail2ban 全部失效。 本文介紹一個簡潔安全的方式: 建立自有鏈 (custom chains),在不影響其他服務的前提下,自行維護防火牆邏輯。 🧩 為什麼會互相影響? 因為許多服務(像 Docker、Fail2Ban)啟動時都會自動執行: 或建立自己的鏈: 如果我們的腳本中也執行 iptables -F、iptables -X,那就會清空這些鏈的規則,導致: ✅ 解決原則:用「自有鏈」管理,不清整表 我們不再動系統原生的 INPUT、FORWARD、OUTPUT 等預設鏈,而是在它們裡面「插入一次跳轉」到我們自己的鏈,例如: 這樣: 🔧 實作架構範例 建立自有鏈(只清自己的鏈) 🔍 各表的職責清楚分工 Table 主要職責 我們自有鏈功能 filter ACL(放行、封鎖) FW-INPUT, FW-FORWARD(包含上網白名單、時間控管) nat 位址轉換 FW-PREROUTING(DNAT)、FW-POSTROUTING(MASQ / Hairpin) mangle 封包修改 FW-FORWARD(MSS Clamp for PPPoE)…

Read more

Wazuh: The Core Concept and Working Principles of an Open-Source MDR Platform

Posted on 2025-11-042025-11-04 by Rico

In today’s rapidly evolving cybersecurity landscape, organizations face challenges that go far beyond preventing traditional malware infections. The real question has become how to detect threats early, respond quickly, and maintain continuous monitoring. Traditional antivirus and firewalls stop known threats, but they often miss subtle or unknown attacks happening inside the environment.This is where MDR…

Read more

Wazuh:開源 MDR 平台的核心概念與運作原理

Posted on 2025-11-042025-11-04 by Rico

在資安威脅不斷演變的今天,企業面臨的挑戰不再只是防止病毒入侵,而是如何即時偵測、快速反應、持續監控。傳統防毒與防火牆只能擋住「已知威脅」,但無法即時發現內部異常行為或未知攻擊。這時,MDR(Managed Detection and Response) 的概念便應運而生。 而在眾多 MDR 解決方案中,Wazuh 以開源、靈活與整合能力強等特點,成為許多企業自建 SOC(Security Operation Center)時的首選。 一、什麼是 Wazuh? Wazuh 是一套開源的 安全監控與威脅回應平台,同時具備: 換句話說,Wazuh 能幫助企業從「事後分析」轉變為「主動偵測與即時回應」。 二、整體架構概覽 Wazuh 採用 分散式架構,主要由三個核心元件組成: 整個架構可擴充至多台 Manager、分層式部署,適合跨國或多據點企業使用。 三、運作原理:從資料收集到自動回應 1️⃣ 資料收集(Data Collection) 每台主機上安裝的 Wazuh Agent 會定期蒐集各種安全相關事件,例如: 這些資料會加密傳送到 Wazuh Manager 進行集中分析。 2️⃣ 規則比對與威脅分析(Detection & Correlation) Manager 接收到事件後,會利用內建與自訂的規則集(ruleset)進行分析: 這個階段的分析可搭配: 3️⃣ 威脅關聯與分級(Correlation & Prioritization) Wazuh 會根據事件嚴重度(level 0–15)進行分級。例如: 透過事件關聯分析,能有效降低誤報率,提升告警的精確度。 4️⃣ 自動化回應(Response &…

Read more

Posts pagination

  • Previous
  • 1
  • …
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • …
  • 36
  • Next

Recent Posts

  • Token/s and Concurrency:
  • Token/s 與並發:企業導入大型語言模型時,最容易被誤解的兩個指標
  • Running OpenCode AI using Docker
  • 使用 Docker 實際運行 OpenCode AI
  • Security Risks and Governance Models for AI Coding Tools

Recent Comments

  1. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on High Availability Architecture, Failover, GeoDNS, Monitoring, and Email Abuse Automation (SOAR)
  2. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on MariaDB + PostfixAdmin: The Core of Virtual Domain & Mailbox Management
  3. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Daily Operations, Monitoring, and Performance Tuning for an Enterprise Mail System
  4. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Final Chapter: Complete Troubleshooting Guide & Frequently Asked Questions (FAQ)
  5. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Network Architecture, DNS Configuration, TLS Design, and Postfix/Dovecot SNI Explained

Archives

  • January 2026
  • December 2025
  • November 2025
  • October 2025

Categories

  • AI
  • Apache
  • CUDA
  • Cybersecurity
  • Database
  • DNS
  • Docker
  • Fail2Ban
  • FileSystem
  • Firewall
  • Linux
  • LLM
  • Mail
  • N8N
  • OpenLdap
  • OPNsense
  • PHP
  • Python
  • QoS
  • Samba
  • Switch
  • Virtualization
  • VPN
  • WordPress
© 2026 Nuface Blog | Powered by Superbs Personal Blog theme