# Managed by Ansible, role falco. These build on the macros in Falco's # default rules, such as spawned_process, shell_procs, open_read, outbound. - list: iac_network_services items: [{{ falco_network_services | join(', ') }}] - rule: Shell started by a network service desc: >- A web or application server started a shell. That is what a web shell or a command injection looks like from the host. condition: spawned_process and shell_procs and proc.pname in (iac_network_services) output: >- Shell started by a network service (parent=%proc.pname command=%proc.cmdline user=%user.name host=%evt.hostname) priority: CRITICAL tags: [host, mitre_execution] - list: iac_cloud_credential_readers items: [{{ falco_cloud_credential_readers | join(', ') }}] - rule: Cloud credentials read by an unexpected program desc: A program other than the cloud tools read a stored cloud credential file. condition: >- open_read and (fd.name endswith "/.aws/credentials" or fd.name contains "/.config/gcloud/") and not proc.name in (iac_cloud_credential_readers) output: >- Cloud credentials read by an unexpected program (file=%fd.name program=%proc.name command=%proc.cmdline user=%user.name) priority: WARNING tags: [host, credentials, mitre_credential_access] - rule: Instance credentials fetched by a download tool desc: >- A download tool connected to the instance metadata service, which is how stolen instance credentials are usually fetched. condition: outbound and fd.sip="169.254.169.254" and proc.name in (curl, wget, nc, ncat, socat) output: >- Instance credentials fetched by a download tool (program=%proc.name command=%proc.cmdline user=%user.name) priority: WARNING tags: [host, credentials, mitre_credential_access] - rule: New file in a system binary folder desc: A file was written to a folder that contains system programs, outside a package install. condition: >- open_write and (fd.directory in (/bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin)) and not proc.name in (dpkg, apt, apt-get, rpm, dnf, yum, unattended-upgr) output: >- New file in a system binary folder (file=%fd.name program=%proc.name command=%proc.cmdline user=%user.name) priority: ERROR tags: [host, persistence, mitre_persistence] {% if falco_extra_rules %} {{ falco_extra_rules }} {% endif %}