慣性聚合 高效追讀感興趣之博客、新聞、科技資訊
閱原文 以慣性聚合開啟

推薦訂閱源

博客园 - 司徒正美
V
V2EX
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
aimingoo的专栏
aimingoo的专栏
Apple Machine Learning Research
Apple Machine Learning Research
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
月光博客
月光博客
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python)
于诸君之服务器上,不立一规,而察其异动。
Gretl · 2026-05-24 · via DEV Community

诸般安防之器,皆欲先令君定义何为"不善"。Falco则授君YAML之规。OSSEC有签验。Wazuh载五千行之规集,随产品发行,然犹漏却君境中要害之半。

患非法之不善也,患法惟能捕人已思立法之事耳。新攻之术,异用之式,或汝队六载前引入而忘之之暴过,皆可直越之。

吾欲异法:欲法自能习各伺之常,自识异者,不假设而显之。

此乃吾辈以eBPF与LanceDB之术所建之方.

其序如下:
__JHSNS_SEG_e1492998_5__eBPF使汝可于内核事件附程,其耗极微。吾辈附于sys_enter_execve之踪迹点,此点每机器一程被行之时即发——于程始运行之前.

每程之行,吾辈所摄者:

进程名(comm)与完整命令行(argv)
父进程名
调用进程的UID
任一活动网络连接(源/目标IP,端口)
此乃以 Rust 语言,借 Aya 框架所撰,其编译 eBPF 内核程序于别处,而于运行时载之。

[跟踪点]

公之gretl_execve也,于TracePointContext中行之。>三十二进制数
令文件名指针为 ctx 之 read_at (16) 之 unsafe 结果,转为 *const u8。
令pidtgid者,bpf_get_current_pid_tgid也。
令pid为pidtgid>>三十二也。

let mut event = ExecveEvent {
    pid,
    comm:     [0u8; 16],
    filename: [0u8; 64],
    argv1:    [0u8; 64],
    // ...
};

if let Ok(comm) = bpf_get_current_comm() {
    event.comm = comm;
}

emit_execve(&event)

入全景模式 退出全屏模式

}
事载于环缓冲,由用户空间代理所取,其聚而每六十秒一投于后端。于内核五点八以上,且启BTF,则无须任何探查——容器内无代理,无副车,应用代码亦无改易。

服务器若无eBPF支持,Node.js代理则退而求其次,直读/proc//cmdline及/proc//status,每期追踪新PID。虽失实时内核钩子,犹得进程遥测。

第二步:将每程之执行表为矢量。
原事——一过程之名、一命令行之文、一父过程、一端口——非可直较。欲度执行间之似,须化每事为定长之矢。

吾用特征散列:析事件之域为词,散每词于百二十八维矢之一位,积其有向之助。其果正之为一单位矢。

为特征向量者,其事乃于进程之变也:
作浮点之列,凡百二十八:

作字之符,曰:
进程之名,
父进程,
事之型,
本地之口,言为文,
远地之口,亦言为文,
...分而析之(event.cmdline),//析为有义之符
》;

夫循(for)之,自(let)零起(i = 0),若(i)未至(i <),则行(i++)之。<遍历tokens.length;i++) {
常以 t 为 tokens[i] 之小写且去空者
若非t,则续之。
索 idx 於 hashStr(t, i * 31) 之餘,以 128 節之。
签者,以哈希之术,取文之韵,数之序,乘以三十一,加一,得签焉。& 1) ? 1 : -1;
vec[idx] += sign;
}

// L2 normalise so cosine distance is well-defined
let norm = 0;
for (let i = 0; i < 128; i++) norm += vec[i] * vec[i];
norm = Math.sqrt(norm) || 1;
乃取vec之众,化而为序,遍施其术,以v(若)除以norm,得,复归之序。
}
特征散列之法,确然无疑,不假外物之模,无增迟滞之弊,于此等结构化之文输入,用之甚宜。A bash -i >& /dev/tcp/... 命令与寻常之 bash --login 调用,将落至向量空间之迥异区域。

何不采用神经嵌入模型?
吾等曾郑重考察。如 all-MiniLM-L6-v2(22 MB,384 维)或 OpenAI 之 text-embedding-3-small 模型,可致语义相似更丰——彼知 sh 与 bash 皆为壳,/tmp 与 /dev/shm 皆为可写之 scratch 路径。

弊在纳新之际之运营费。每服务器约六十秒报一事件。五十服务器之众,则一时约有三千事件,每需一嵌入调用,方得评分而存之。其策有三:

后端本地模型——可行,然增冷启动之依赖,磁盘存模型权重约二百兆,每事件耗CPU五至二十毫秒。于共享API服务之小Fly.io实例,此影响可察。
外部API(如OpenAI)——增每摄取请求之网络延迟,每标记成本随舰队规模增,且为硬性外部依赖,可令安全管道倾覆。
特征哈希——行于<0.1毫秒,无依存,不呼网络,全然定数。同输入恒生同矢,亦使试验简易。
此特异输入——如进程名、亲PID、命令行标记等结构域——特征哈希竟有超乎常情之效。bash -i >& /dev/tcp/10.0.0.1/4444 0>&1 與 bash --login 之間,其符號集幾乎無重疊,故於向量空間中分處異域。此即異常評分所需之全也。

嵌入层故设一函数featureVector()以隔绝之。后欲易以神算之模,但改一函数耳——其评分之理、LanceDB之表、API之表,皆不问其内何物。

第三步:以LanceDB存之、询之。
LanceDB者,嵌入式向量数据库也——运行于汝之进程,存数据于磁盘,且支持快速近似最近邻搜索,无需别之设施.

吾辈每(org_id,workload)之对,创一LanceDB之表。每行存128维向量及时间戳。表随新事件至而增,旧条目过七日则删.

导异步函数scoreAndLearn
者,字符串也;
者,字符串也;
者,ProcessEvent也;
,则Promise也。
者,则: 俟db而得conn;
者,俟getOrCreateTable(conn, tableName(__JHSNS_SEG_e1492998_85__, __JHSNS_SEG_e1492998_86__))而得table;
者,featureVector(__JHSNS_SEG_e1492998_87__)而得vec;

者,于此workload之历史中,求其最近邻十。
待查之果,俟表之向量索,限十,化列而得。

令分數為一。//默認:完全未見
若(results.length>零之括号
距度者,成果之映射也,r为>
余弦距离(vec, Array.from(r.vector))
);
取诸距之最短者,为minDist;
计分以minDist乘二为限,不逾一;
是故…

此变应增入基线,以资后较;
表增列明,明其向量与时辰;

归其分;
是已。
此异常分值为0,乃吾等屡见之景;为1,则全然新异。其值与事件并存于ClickHouse,俾汝可询查、筛选、警示之。

第四步:自然语言检索
每事皆为向量,按状查询则易如反掌。吾以同法嵌入查询,遍索诸作业表,寻其最近邻。

// 仪表盘之安全页:
// "示吾类逆壳者"

POST /telemetry/security/search
{"查询":"反向shell bash出站连接"}
此乃返回与查询向量最相近之事件——语义相似,非关键词匹配。运行bash -i >& /dev/tcp/10.0.0.1/4444 0>&纵非直书"反向shell"之字,

其实际之貌
数日之内,运行于生产之服务器,基线习得所谓"常态":尔之Web服务器进程,尔之cron任务,尔之部署脚本。继而:

一开发者偶遗调试shell于运行→异常分0.85,标为警告
尔之CI/CD管道初运新筑之脚本→首试得分0.72,再试骤降为0.1
有人以根行curl | bash→得分0.94,立时举旗
尔惯用之nginx工者重启→得分0.02,忽而不察
此等皆未立规。系统自通其基,偏异自显。

一图之架构
服务器 后端 存储
───────────────────────────────

eBPF(内核)──执行ve──▶ /otlp/v1/事件

/proc备选 ──────────▶ │

特征向量


LanceDB(每项任务)──▶异常分数


ClickHouse.security_events


仪表盘+自然语言搜索
何所之乎
今之嵌入纯然结构,知bash与sh为异符,而不知其义近。若升小神经嵌入模型(如all-MiniLM-L6-v2),则自然语言检索之质可大进,尤以平实英文之询为甚,非以术语也。

吾辈亦在修制每项任务之警界阈限——故而涉密之生产任务可设警于0.6分,而纷扰之开发环境则用0.85之高阈。

试之诸君之服务器
此代理一令即安,立时始建基线。凡/Linux之服务器皆可施用——EC2、GCP、裸机皆然。eBPF于内核≥5.8,他处则依/proc之备策。

GR_TOKEN=汝之令牌 bash <(curl -fsSL https://gretl.dev/install-agent.sh)