在本系列中,运行时威胁检测的事实标准是法尔科我将在一篇文章中简要介绍一种检测规则。
有关运行时安全性和 Falco 本身的概述博客文章在这里请参阅。
这次介绍的检测规则是“启动后读取受信任的敏感文件”是。

规则说明

- rule: Read sensitive file trusted after startup
  desc: >
    an attempt to read any sensitive file (e.g. files containing user/password/authentication
    information) by a trusted program after startup. Trusted programs might read these files
    at startup to load initial state, but not afterwards.
  condition: sensitive_files and open_read and server_procs and not proc_is_new and proc.name!="sshd" and not user_known_read_sensitive_files_activities
  output: >
    Sensitive file opened for reading by trusted program after startup (user=%user.name user_loginuid=%user.loginuid
    command=%proc.cmdline parent=%proc.pname file=%fd.name parent=%proc.pname gparent=%proc.aname[2] container_id=%container.id image=%container.image.repository)
  priority: WARNING
  tags: [filesystem, mitre_credential_access]

规则概述

检测启动后受信任的程序读取了身份验证信息等机密文件。
受信任的程序通常会在启动时加载敏感文件以进行初始加载,但之后不会,这表明存在可疑活动。
也可以使用此规则检测此类活动。

健康)状况

sensitive_files and open_read and server_procs
服务器进程读取敏感文件,

not proc_is_new and
不是一个新的过程

proc.name!="sshd" and
甚至没有 sshd 进程,

not user_known_read_sensitive_files_activities
也不是用户定义的已知敏感文件读取活动


sensitive_files 宏的内容如下。

- macro: sensitive_files
  condition: >
    fd.name startswith /etc and
    (fd.name in (sensitive_file_names)
     or fd.directory in (/etc/sudoers.d, /etc/pam.d))

fd.name startswith /etc and
文件名以 /etc 和

(fd.name in (sensitive_file_names)
文件名包含在sensitive_file_names 列表中,并且

or fd.directory in (/etc/sudoers.d, /etc/pam.d))
或者如果目录是 /etc/sudoers.d 或 /etc/pam.d


sensitive_file_names 列表的内容是:

- list: sensitive_file_names
  items: [/etc/shadow, /etc/sudoers, /etc/pam.conf, /etc/security/pwquality.conf]

输出

受信任的程序启动后打开了一个敏感文件以供读取。

%user.name
用户名

%user.loginuid
用户的登录 UID

%proc.cmdline
命令行

%proc.pname
父进程名称

%fd.name
文件名

%proc.pname
父进程名称

%proc.aname[2]
两代前的父进程名称

%container.id
容器 ID

%container.image.repository
容器镜像仓库


原创声明:本文系作者授权爱码网发表,未经许可,不得转载;

原文地址:https://www.likecs.com/show-308626432.html

相关文章:

  • 2021-07-15
  • 2022-02-26
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2021-11-17
  • 2021-10-19
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-19
  • 2022-02-08
  • 2022-12-23
  • 2022-02-05
  • 2021-07-31
相关资源
相似解决方案