用 Promptfoo 给 AI skill 做体检:评估、测试、质量与安全把关

Posted on 三 15 4月 2026 in Journal • Tagged with Promptfoo, AI, LLM, Agent, Skill, Evaluation, Red Team, Security, CI/CD

很多团队做 AI skill,还停留在“这次跑通了,看起来不错”的阶段。可真正上线之后,问题往往不在第一次回答,而在波动、成本、工具调用路径和安全边界。本文借 Promptfoo 这把尺子,聊聊怎么系统地评估、测试并给 AI skill 做质量与安全把关。


Continue reading

在 Kubernetes 里用 cert-manager + Venafi 自动签发和轮换证书

Posted on 三 15 4月 2026 in Journal • Tagged with Kubernetes, cert-manager, Venafi, TLS, certificate, security, DevOps

很多团队把 TLS 证书当成一次性配置,直到某个周五晚上证书快过期了,才想起这件事不能靠日历提醒。本文以 Kubernetes 服务为例,讲清楚怎么把 cert-manager 当执行层,把 Venafi 当策略和 CA 门卫,做到声明式签发、自动续期、私钥轮转,以及应用侧平滑 reload。


Continue reading

Axios 被投毒:一场教科书级的供应链攻击复盘

Posted on 三 01 4月 2026 in Tech • Tagged with security, supply-chain, npm, axios, RAT, dependency-management

2026 年 3 月 31 日,周下载量过亿的 npm 包 axios 被投毒,两小时内所有 npm install 的机器可能已沦陷。这次事件再次说明:你写的代码也许没有 bug,但你装的依赖里可能藏着一扇后门。


Continue reading

从 LiteLLM 供应链投毒事件聊聊密钥安全

Posted on 六 28 3月 2026 in Tech • Tagged with security, supply-chain, python, secrets-management, LiteLLM

2026年3月,LiteLLM 遭遇供应链投毒,恶意包窃取用户密钥和云凭证。本文从 .pth 文件机制、漏洞根因、密钥不落盘理念到业界通用方案,聊聊 AI 时代的密钥安全。


Continue reading

证书这活儿:PEM/JKS/P12 怎么选、免费证书哪家强、自动轮换怎么搞

Posted on 二 24 3月 2026 in Journal • Tagged with certificate, TLS, SSL, PEM, JKS, PKCS12, Let's Encrypt, cert-manager, security, DevOps

以我自己的个人网站证书过期为引子,讲清楚 Root CA、Intermediate CA、Leaf Certificate 的职责、格式与验证过程,再把 PEM/JKS/P12 的选择和自动轮换这件事说透。


Continue reading

Workload Identity:别再把云上身份塞进 Secret 里了

Posted on 四 19 3月 2026 in Journal • Tagged with journal, blog, security, cloud, kubernetes, iam, workload identity

讲清楚 workload identity 是什么、为什么它比长期凭证更靠谱,以及在 Kubernetes 和云平台里如何落地。


Continue reading

网络安全指北之 Broken Auth and Session Management:登录与会话管理翻车指南

Posted on 五 06 3月 2026 in Tech • Tagged with tech, blog, security, auth, session

认证翻车和会话翻车, 往往不是因为黑客太聪明, 而是我们把"登录态"当成了万能钥匙: cookie 没设好、token 乱放、会话不轮换、登出不失效。本文用人话拆解常见坑, 给出 Java/Go/Python 可直接抄的防护套路与自检清单。


Continue reading

从 RBAC 到 OpenFGA:细粒度授权的架构、落地与取舍

Posted on 四 05 3月 2026 in Tech • Tagged with authorization, rbac, openfga, zanzibar, security, fine-grained-authorization, 授权, 访问控制

RBAC 是授权领域的"老黄牛",简单可靠,但在多租户、层级继承、动态共享等场景下力不从心。OpenFGA 基于 Google Zanzibar 论文,用关系元组(Relationship Tuple)重新定义了授权模型。本文从 RBAC 的局限出发,深入剖析 OpenFGA 的架构设计,探讨商业公司落地的路径与风险,以及开源方案与自研的取舍。


Continue reading

网络安全指北之 CSRF:Cross-Site Request Forgery (跨站请求伪造)

Posted on 一 02 3月 2026 in Tech • Tagged with tech, blog, security

CSRF 不靠"攻破你的网站",它靠的是"借你的登录态办坏事"。这篇文章把 CSRF 的本质讲清楚,顺便给出 Java/Go/Python 里能直接抄的防护做法:token、SameSite、Referer/Origin 校验,以及什么时候该用哪个。


Continue reading

网络安全指北之 IDOR: Insecure Direct Object Reference (对象引用越权)

Posted on 一 02 3月 2026 in Tech • Tagged with tech, blog, security

IDOR 不玄学,就一句话:你用 "id=123" 这种直达链接访问资源时,服务端有没有确认 "你就是 123 的主人"。这篇文章用可抄的例子讲清楚:它怎么发生,怎么被利用,怎么在 Java/Go/Python 里修到位。


Continue reading

网络安全指北之Sensitive Data Exposure:敏感数据暴露

Posted on 一 02 3月 2026 in Tech • Tagged with tech, blog, security, privacy

敏感数据暴露从来不是黑客多聪明,而是我们自己太大意:日志、报错、对象存储、备份、调试接口——每个环节都可能把数据"顺手递出去"。这篇文章给你一份可直接照抄的"数据防裸奔"清单。


Continue reading

网络安全指北之防止 XSS 的典型套路

Posted on 六 28 2月 2026 in Tech • Tagged with security, xss, owasp, 安全, web

XSS(Cross-Site Scripting,跨站脚本攻击)是 Web 安全里最常见的注入类漏洞之一。本文用通俗类比从 What/Why/How 说起,面向小白讲清楚 XSS 是什么、为什么危险、怎么防,给出 Java/Go/Python 三语言正反示例与常用框架,最后收束成防御套路与自检清单。


Continue reading

网络安全指北: 为什么 BAC 访问控制失效总能霸榜

Posted on 六 28 2月 2026 in Tech • Tagged with security, owasp, access-control, bac, 安全, 访问控制

OWASP Top 10 每隔几年更新一次,榜首却从未换过——BAC(Broken Access Control,访问控制失效)连续霸榜。本文从这个现象出发,用酒店房卡类比说清楚 BAC 是什么、为何难做对、典型场景和缓解措施,并给出 Java/Go/Python 三语言正反示例、常用框架、最佳实践和自检清单。


Continue reading

Go crypto/tls Config.Clone session resumption pitfalls (CVE-2025-68121)

Posted on 三 25 2月 2026 in Tech • Tagged with go, security, tls, cve

CVE-2025-68121 涉及 Go crypto/tls 的两个会话恢复(session resumption)问题:Config.Clone 复制了自动生成的 session ticket keys,导致不同 tls.Config 之间意外共享会话票据;以及服务端在判断会话是否可恢复时,只检查 leaf 证书过期而忽略完整证书链,可能让过期链条下的会话继续被恢复。


Continue reading

什么是时序攻击(Timing Attack)?

Posted on 四 12 2月 2026 in Tech • Tagged with security, timing-attack, constant-time, authentication, crypto

==strings.Compare 比较密钥、密码或 HMAC 时,比较时间会随 "猜对多少" 变化,攻击者可以按响应时间逐字节猜出秘密;一文说清原理与常数时间比较的用法。


Continue reading

微服务的三大安全威胁

Posted on 四 12 2月 2026 in Tech • Tagged with microservices, security, service-mesh, privilege-escalation, injection, SSRF

在微服务与服务网格环境下,最常被利用的往往不是 "高大上" 的零日漏洞,而是权限提升、注入与 SSRF;本文用具体例子说明这三类威胁及应对思路。


Continue reading

在 EKS 上给 Pod 绑 IAM Role:IRSA(ServiceAccount + OIDC)到底怎么回事

Posted on 日 25 1月 2026 in Tech • Tagged with Kubernetes, EKS, AWS, IAM, IRSA, OIDC, security, STS

Node Role 像一把“万能钥匙”。IRSA 让你把权限精确绑定到 Pod:用 Kubernetes 的 ServiceAccount token 走 OIDC 联邦,去 STS 换临时凭证。


Continue reading

密码存储的艺术

Posted on 日 14 9月 2025 in Tech • Tagged with journal, blog, security, encryption, aes-gcm, envelope-encryption

聊聊如何安全存储密码和密钥,从基础概念到实际实现,让你告别"123456"时代


Continue reading