Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
tarian — Anti-Virus for K8s。保护你在Kubernetes上运行的应用程序免受恶意攻击,通过预注册源代码、运行时进程监控、分析、警报,并与社区共享检测结果。或许还能防范勒索软件。 | Kitploit
工具/GitHubGitHub/devopstoday11/tarian
容器安全云安全DevSecOps入侵检测事件响应
GitHubdevopstoday11/tarian

tarian

Anti-Virus for K8s。保护你在Kubernetes上运行的应用程序免受恶意攻击,通过预注册源代码、运行时进程监控、分析、警报,并与社区共享检测结果。或许还能防范勒索软件。

查看仓库
2434年前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Tarian

我们希望以开源方式维护此项目,以对抗针对我们喜爱的 Kubernetes 生态系统的攻击。通过持续的贡献,我们可以作为社区共同应对威胁。
通过预先注册源代码签名、运行时进程监控、运行时源代码监控、变更检测、告警,以及基于检测的预配置和即时响应操作,并共享检测结果,保护在 Kubernetes 上运行的应用免受恶意攻击。从勒索软件中拯救您的 K8s 环境!

构建状态 Go 报告卡

Tarian 如何工作?

Tarian 作为 sidecar 容器运行在主应用 Pod 中,监控进程 ID、运行中的进程数量、父子进程关系变化、文件系统中属于应用的文件和目录、文件签名变更等。Tarian 将从开发到生产环境始终成为应用 Pod 的一部分,因此您可以向 Tarian 数据库注册容器中应当发生和运行的内容、可监控的内容、可通知的内容以及基于检测变更采取的操作(自我销毁 Pod)。将您的检测机制左移!

如果容器内发生了未在 Tarian 注册数据库中的未知变更,Tarian 如何应对?

如果发生未知变更,Tarian 可以简单地将观察到的分析结果通知给您的安全团队,同时将日志发送给安全团队。然后您的安全工程师可以在 Tarian 数据库中注册该变更为威胁或非威胁,并根据分析配置要采取的操作。该操作将以命令形式发送给 sidecar Tarian 应用来执行。

社区通过 Tarian 的贡献如何帮助对抗威胁?

由安全专家分析并标记为威胁的任何新检测,如果他们选择,可以与开源 Tarian 社区共享所有日志、要搜索的字符串、观察结果、透明度、要配置的操作等,基本上专家想要警告并分享给社区的一切。您作为 Tarian 用户可以应用这些信息,并在您的环境中配置 Tarian 应用的操作。这本质上是共享有关威胁及其应对措施的信息。这可以帮助所有使用 Tarian 的人通过分享知识和经验,在各自的 K8s 环境中共同分析并采取行动。

Tarian 会根据已知威胁采取什么操作?

Tarian 会简单地自行销毁其所在的 Pod,同时删除卷上的任何文件,以降低风险。如果恶意软件/病毒扩散到环境的其余部分,您知道会发生什么。因此,Tarian 本质上旨在通过销毁 Pod 来尽可能降低风险。新 Pod 的配置将由 K8s 处理,因为这就是 K8s 的工作方式。Tarian 只会销毁 Pod,并且只有在您通过预先在 Tarian 控制器中配置操作或动态告知 Tarian 这样做时才会执行。如果您不希望发生任何操作,则无需配置或触发任何操作;您可以简单地让 Tarian 仅通知您。Tarian 基本上执行您想要的操作来降低风险。

为什么在有众多现有工具(如 Falco、Kube-Hunter、Kube-Bench、Calico Enterprise Security 等可在网络、基础设施和应用层面检测和防御威胁的开源和商业安全工具)的情况下,还需要另一个新的安全工具?为什么是 Tarian?

正如我上面提到的,Tarian 诞生的主要原因是作为社区共同对抗 Kubernetes 中的威胁。另一个原因是,如果仍然存在某种能够穿透每一层安全防护、到达运行时应用和存储卷,并能够扩散以破坏或锁定您的基础设施和数据的复杂攻击,您该如何应对?特别是当它演变成勒索软件时。Tarian 旨在通过采取操作来降低此类风险。我们知道 Tarian 并非终极解决方案,但我们相信,在社区持续共享知识以及 Tarian 在技术层面通过销毁受感染资源来降低风险的能力下,它能够有所帮助。

架构图

我将在与更多安全专家讨论(我已经与几位交流过,还有几次讨论待进行)后,尽快确定设计图。

架构图

安装

  1. 创建 tarian-system 命名空间
root@kitploit:~
kubectl create namespace tarian-system
  1. 准备一个 PostgreSQL 数据库。您可以使用云服务提供的 DBaaS,也可以在集群中自行运行。例如,在集群中安装数据库:
root@kitploit:~
helm install tarian-postgresql bitnami/postgresql -n tarian-system \
  --set postgresqlUsername=postgres \
  --set postgresqlPassword=tarian \
  --set postgresqlDatabase=tarian
  1. 安装 tarian
root@kitploit:~
helm repo add tarian https://devopstoday11.github.io/tarian
helm repo update

helm install tarian-server tarian/tarian-server --devel -n tarian-system
helm install tarian-cluster-agent tarian/tarian-cluster-agent --devel -n tarian-system
  1. 等待所有 Pod 就绪
root@kitploit:~
kubectl wait --for=condition=ready pod --all -n tarian-system
  1. 运行数据库迁移以创建所需表
root@kitploit:~
kubectl exec -ti deploy/tarian-server -n tarian-system -- ./tarian-server db migrate

配置

参见 Helm Chart 的 values 文件:

  • tarian-server
  • tarian-cluster-agent

使用

使用 tarianctl 控制 tarian-server

  1. 从 Github 发布页面 下载
  2. 解压文件并将 tarianctl 复制到您的 PATH 目录中
  3. 将 tarian-server 暴露到您的机器,可以通过 Ingress 或端口转发。本例使用端口转发:
root@kitploit:~
kubectl port-forward svc/tarian-server -n tarian-system 41051:80
  1. 通过环境变量配置服务器地址
root@kitploit:~
export TARIAN_SERVER_ADDRESS=localhost:41051

查看违规事件

root@kitploit:~
tarianctl get events

添加进程约束

root@kitploit:~
tarianctl add constraint --name nginx --namespace default \
  --match-labels run=nginx \
  --allowed-processes=pause,tarian-pod-agent,nginx
root@kitploit:~
tarianctl get constraints

添加文件约束

root@kitploit:~
tarianctl add constraint --name nginx-files --namespace default \
  --match-labels run=nginx \
  --allowed-file-sha256sums=/usr/share/nginx/html/index.html=38ffd4972ae513a0c79a8be4573403edcd709f0f572105362b08ff50cf6de521
root@kitploit:~
tarianctl get constraints

在 Pod 中运行 tarian agent

创建约束后,通过添加注解将 tarian-pod-agent 注入到 Pod 中:

root@kitploit:~
metadata:
  annotations:
    pod-agent.k8s.tarian.dev/threat-scan: "true"

带有此注解的 Pod 会额外注入一个容器(tarian-pod-agent)。tarian-pod-agent 容器将根据注册的约束持续验证运行时环境。任何违规行为都将被报告,可以通过 tarianctl get events 查看。

演示:尝试一个违反约束的 Pod

root@kitploit:~
kubectl apply -f https://raw.githubusercontent.com/devopstoday11/tarian/main/dev/config/monitored-pod/configmap.yaml
kubectl apply -f https://raw.githubusercontent.com/devopstoday11/tarian/main/dev/config/monitored-pod/pod.yaml

# 等待 Pod 就绪
kubectl wait --for=condition=ready pod nginx

# 模拟运行未知进程
kubectl exec -ti nginx -c nginx -- sleep 15

# 您应该会在 tarian 中看到报告
tarianctl get events

Alert Manager 集成

Tarian 默认自带 Prometheus Alert Manager。如果您想使用其他 alert manager 实例:

root@kitploit:~
helm install tarian-server tarian/tarian-server --devel \
  --set server.alert.alertManagerAddress=http://alertmanager.monitoring.svc:9093 \
  --set alertManager.install=false \
  -n tarian-system

要禁用它,可以将 alertManagerAddress 值设置为空。

Falco 集成

参见 docs/falco-integration.md

故障排除

参见 docs/troubleshooting.md

自动约束注册

当 tarian-pod-agent 在注册模式下运行时,它不会将未知进程和文件报告为违规,而是自动将它们注册为新约束。这可以节省手动注册的时间。

要启用约束注册,需要配置 cluster-agent。

root@kitploit:~
helm install tarian-cluster-agent tarian/tarian-cluster-agent --devel -n tarian-system \
  --set clusterAgent.enableAddConstraint=true
root@kitploit:~
metadata:
  annotations:
    # 注册进程和文件校验和
    pod-agent.k8s.tarian.dev/register: "processes,files"
    # 忽略自动注册中的特定路径
    pod-agent.k8s.tarian.dev/register-file-ignore-paths: "/usr/share/nginx/**/*.txt"

自动约束注册也可以在开发/预发布集群中完成,这样生产环境中的变更会更少。

其他支持的注解

root@kitploit:~
metadata:
  annotations:
    # 指定 tarian-pod-agent 验证文件校验和的频率
    pod-agent.k8s.tarian.dev/file-validation-interval: "1m"
下载工具