<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>运维安全 on SRE工程实践</title><link>https://www.sre.wang/tags/%E8%BF%90%E7%BB%B4%E5%AE%89%E5%85%A8/</link><description>Recent content in 运维安全 on SRE工程实践</description><image><title>SRE工程实践</title><url>https://www.sre.wang/share-card-square.jpg</url><link>https://www.sre.wang/share-card-square.jpg</link></image><generator>Hugo -- gohugo.io</generator><language>zh-cn</language><lastBuildDate>Mon, 30 Nov 2026 15:05:00 +0800</lastBuildDate><atom:link href="https://www.sre.wang/tags/%E8%BF%90%E7%BB%B4%E5%AE%89%E5%85%A8/index.xml" rel="self" type="application/rss+xml"/><item><title>清理脚本 exit 0 报了成功，三天后扩容才炸：上线前必做的 7 项 Shell 安全审计</title><link>https://www.sre.wang/posts/shell-script-security-audit/</link><pubDate>Mon, 30 Nov 2026 15:05:00 +0800</pubDate><guid>https://www.sre.wang/posts/shell-script-security-audit/</guid><description>一段每天凌晨跑的清理脚本删掉了线上正在使用的发布目录，退出码却是 0，故障三天后扩容时才暴露。本文复盘这起延迟故障，并给出 Shell 脚本上线前的 7 项安全审计清单：空变量靶向校验、set -e 的三个漏网点、pipefail 吞错、引号与通配符、破坏性命令护栏、flock 并发锁、临时文件与信号清理，附 ShellCheck 门禁落地方式与改造前后的实测对比。</description></item></channel></rss>