Commit Graph

838 Commits

Author SHA1 Message Date
Mark Stemm
15e2d0bf7e Add addl bitnami conditions. 2017-11-07 09:54:09 -08:00
Mark Stemm
480ba4e0f8 Let duply write below /etc/duply
It's a shell script that runs touch so the detection is slightly more
complicated.
2017-11-07 09:43:07 -08:00
Mark Stemm
6aae17600f Add addl ruby proc for builds.
Adding ruby2.1
2017-11-07 09:42:15 -08:00
Mark Stemm
e9e0177901 Add additional phusion cmdlines. 2017-11-06 15:28:16 -08:00
Mark Stemm
01459fb49a Let threatstack spawn shells
Either as tsvuln or via node cmdline.
2017-11-06 15:28:16 -08:00
Mark Stemm
d36df62d1e Add an additional yarn cmdline. 2017-11-06 15:26:03 -08:00
Mark Stemm
36d775100e Be more tolerant of es curator procs
The command line occasionally ends with a space.
2017-11-03 17:26:37 -07:00
Mark Stemm
0020b05624 Add additional details for some rules
Helps diagnose FPs.
2017-11-03 16:01:38 -07:00
Mark Stemm
3edfc6ba8e Let plesk run mktemp below /etc 2017-11-03 16:01:12 -07:00
Mark Stemm
9ed1ff5f26 Add additional shell spawning cmdlines/progs 2017-11-03 16:00:03 -07:00
Mark Stemm
664d8fbc1d Add addl mail config binaries
Add additional mail config-related binaries. Also they aren't solely
sendmail-related, so make the list mail_config_binaries.
2017-11-03 15:44:26 -07:00
Mark Stemm
6078d4bd43 Add docker-current as a docker binary. 2017-10-31 20:56:11 -07:00
Mark Stemm
53776b0ec6 Add additional /etc writers 2017-10-31 20:51:18 -07:00
Mark Stemm
2eda3432e9 Let dmeventd write additional dirs 2017-10-31 20:50:58 -07:00
Mark Stemm
56e07f53f2 Let appdynamics spawn shells.
It's java, so look in classpath.
2017-10-30 22:57:08 -07:00
Mark Stemm
87fd4aba70 Let mesos-journald-(logger) spawn shells 2017-10-26 14:17:39 -07:00
Mark Stemm
332e3ad874 Let salt-minion spawn shells 2017-10-26 11:37:12 -07:00
Mark Stemm
5127d51732 Let python run es curator as a shell 2017-10-26 09:42:36 -07:00
Mark Stemm
d8fdaa0d88 Let seed_es_acl spawn shells. 2017-10-26 09:36:07 -07:00
Mark Stemm
b993683b96 Let java running maven spawn shells 2017-10-26 09:35:52 -07:00
Mark Stemm
b8027b5e54 Add additional shell spawn binaries 2017-10-26 09:15:36 -07:00
Mark Stemm
d57b3fe3cf Let spamd read sensitive files. 2017-10-26 09:15:18 -07:00
Mark Stemm
dd3a7df346 Let pam-auth-update/parallels inst write to /etc 2017-10-26 09:14:01 -07:00
Mark Stemm
ba1c8e4506 Let plesk installer write apache config. 2017-10-26 09:13:41 -07:00
Mark Stemm
ccea09b089 Rule updates next (#293)
* Let luajit spawn shells.

* Start support for db mgmt programs

Add support for db management programs that tend to spawn
shells. Starting with two lists
mysql_mgmt_binaries/postgres_mgmt_binaries which are combined into
db_mgmt_binaries. db_mgmt_binaries is added to both shell spawning rules
and the individual programs are removed.

* Let apache beam spawn shells

The program is "python pipeline.py" but it appears to be related to
https://github.com/apache/beam/blob/master/sdks/python/apache_beam/pipeline.py.

* Better support for dovecot

Allow dovecot to setuid by adding to mail_binaries.

Allow the program auth, when run by dovecot, to spawn shells.

* Better support for plesk

Create a list plesk_binaries and allow them to run shells.

Also let them write to files below /etc/sw/keys.

* Let strongswan spawn shells.

Specifically the program starter. Using the full command line to be more
specific.

* Let proftpd modify files below /etc.

* Let chef binaries write below /etc

* Let mandb read sensitive files

* Let specific phusion passenger binaries run shells

The program is "my_init", which is fairly generic, so capture it by the
full command line.

* Make git-remote-http more permissive.

* Let networkmanager modify /etc/resolv.conf

specifically nm-dispatcher

* Let hostid open network connections

It might perform dns lookups as a part of resolving ip addresses.

* Let uwsgi spawn shells

* Add docker-runc-cur as a docker binary.

truncated version of docker-runc-current.

* Add rule for allowed containers

New rule Launch Disallowed Container triggers when a container is
started that does not match the macro allowed_containers. In the main
falco rules file, this macro never matches, so it never
triggers. However, in a second rules file the macro allowed_containers
could be filled in with the specific images that match.

* Also let foreman spawn shells

Used by Red Hat Sattelite.

* Let confluence run shells.

Appears as java program, so look for the classpath.

* Make allowed_containers macro more foolproof.

In some cases, the container image might not be known/is NULL, so the
comparison aganst "dummy-not-allowed-container-image" doesn't work.

Replace this with proc.vpid=1, which is in the main rule Launch
Disallowed Continer. Ensures it will only trigger when the
allowed_containers macro is overridden.

* Let tomcat spawn shells.

It's java so you need to look at the classpath.

* Let pip install software.

* Add another yarn command line.

* Let add-shell write to /etc/shells.tmp

* Let more plesk binaries setuid.

* Add imap-login as a mail binary.

* Fix plesk writing keys macro

Should be testing proc.name, not proc.cmdline.

* Let screen read sensitive files.

* Add more shell spawners.

S99qualys-cloud is the init script, cfn-signal is cloudformation.

* Exclude nologin from user mgmt programs.

* Let programs run by locales.postins write to /etc

It can run scripts like sed to modify files before writing the final
file.

* Let install4j java progs spawn shells.

Again, searching by classpath.

* Let some shell cmds be spawned outside containers

We had a list known_container_shell_spawn_cmdlines that contained
innocuous commandlines, but it only worked for containers.

Split this list into container-specific and general commandlines, and
add an exception for the general commandlines for the Run Shell
Untrusted rule.

* Add addl ruby-based passenger spawners

Add a different way to identify ruby run by phusion passenger.

* Allow bundle ruby cmds to be identififed by name

In some cases, bundle runs ruby scripts by direct script
name (foo.rb). Also allow that to spawn shells.

* Let nginx spawn shells.

* Skip setuid rules for containers.

For now, entirely skip the setuid rule for containers. Will add back
once I can find a way to check for unknown users.

* Let PassengerWatchd run shells

* Add additional foreman shells

Let the direct parent also be scl when the ancestor is tfm-rake,tfm-ruby.

* Add additional innocuous command lines.

* Also let cron spawn shells in containers

Seen when using things like phusion passenger.

* Also let run-parts run cmp/cp for sensitive files

Might be a case of a missing process but might also be legitimate.

* Let erlexec spawn shells.

* Add additional innocuous shell cmdlines.

* Add suexec as a userexec binary.

* Add imap/mailmng-core as mail binaries.

Also split list across multiple lines.

* Let perl spawn shells when run by cpanm

* Let apache_control_ spawn shells

* Let ics_start/stop running java spawn shells

java is the direct parent, ics_start/stop are ancestors.

* Let PassengerAgent setuid.

It setuids to nobody.

* Let multilog write below /etc if run by supervise

* Let bwrap setuid

A container setup utility.

* Detect writes below /, /root

New rule Write below root detects writes either directly below / or
anywhere below /root.

* Don't let shells directly open network connections

In addition to system binaries, don't let shells directly open network
connections. Bash has /dev/{tcp,udp} which allows direct connections.

* Add additional sensitive mounts.

Add additional sensitive mounts, including the docker socket, /,
anywhere below /root, or anywhere below /etc.

* Let pki-realm write below /etc/pki/realms

Appears to be an ansible script.

* Let sgdisk write below dev

* Let debconf-show read sensitive files.

* Additional case for build-related scripts.

* Add additional mail binaries.

* Let ruby running discourse spawn shells.

* Let beam.smp and paster run shells

* Temporarily undo shells opening net conns update

At some customers, at container create time events are being lost, and
for that reason programs spawned by the shell that perform network
connections are being misattributed to the shell.

* Make the actual sensitive files a list.

Make the actual sensitive files used by the sensitive files macro a list
so it can be easily extended.

* Print mounts in Launch Sensitive Mount Container

Add the full list of mounts to the output of Launch Sensitive Mount
Container, so it's easy to see which sensitive mount was used.

* Add container.image to container-related rules.

Helps in diagnosis.

* Add sw-engine-kv as a plesk binary.

* Allow sa-update to read sensitive files

SpamAssassin updater.

* Add additional shell spawners.

* Allow sumologic secureFiles to run user mgmt progs

See https://help.sumologic.com/Send-Data/Installed-Collectors/05Reference-Information-for-Collector-Installation/08Enhanced-File-System-Security-for-Installed-Collectors.

* Only consider full mounts of /etc as sensitive

A legitimate case is k8s mounting /etc/kubernetes/ssl, which was
matching /etc*. The glob matcher we have isn't a full regex so you can't
exclude strings, only characters.

* Let htpasswd write below /etc

Part of nginx

* Let pam-auth-update read sensitive files

* Let hawkular-metric spawn shells.

* Generalize jenkins scripts spawning shells

Generalize jenkins_script_sh to jenkins_scripts and add additional
cases.

* Let php run by assemble spawn shells

Better than globally letting php spawn shells.

* Add additional setuid binaries.

* Add additional package mgmt prog

rhsmcertd-worke(r), red hat subscription manager

* Add additional yarn cmdlines.

* Let dmeventd write below etc.

device mapper event daemon.

* Let rhsmcertd-worke(r) spawn shells.

* Let node spawn bitnami-related shells.

* Add user allowed sensitive mounts

New macro user_sensitive_mount_containers allows a second rules file to
specify containers/images that can perform sensitive mounts.

* Add start-stop-daemon as setuid program

It has -g/-u args to change gid/uid.

Also move some other single setuid programs to the list
known_setuid_binaries.

* Add additional shell spawners/cmdlines.

* Let python running localstack spawn shells.

* Add additional chef binaries.

* Let fluentd spawn shells.

* Don't consider unix_chkpwd to be a user mgmt prog

It only checks passwords.

* Get setuid for NULL user in container working

Reorganize the unknown_user_in_container macro to get it working again
in containers. Previously, it was being skipped entirely due to a
problem with handling of unknown users, which get returned as NULL.

The new macro is known_user_in_container, which tests the user.name
against "N/A". It happens that if user.name is NULL, the comparison
fails, so it has the same effect as if the string "N/A" were being
returned. Any valid user name won't match the string "N/A", so known
users will cause the macro to return true.

The setuid rule needs an additional check for not container, so add that.

* Add exceptions for Write below root

Add lists of files/directories that are acceptable to write.
2017-10-25 14:39:53 -07:00
Mark Stemm
9ec26795c5 Merge pull request #292 from draios/perf-improvements
Expose evttypes for ruleset
2017-10-19 14:38:57 -07:00
Mark Stemm
eeae04ac67 Expose evttypes for ruleset
Add the ability to return the specific event types that are relevant for
a given ruleset. Allows pre-filtering based on ruleset outside the
engine.
2017-10-18 13:34:19 -07:00
Mark Stemm
e5bd58ab91 Merge pull request #291 from draios/update-curl-fix-osx
Update curl version, fixing osx build
2017-10-13 12:45:20 -07:00
Mark Stemm
2fa867e8d0 Try using system cmake
We were installing cmake 3.3.2, while the travis vms have 3.2.2, which
might be new enough.
2017-10-13 12:13:35 -07:00
Mark Stemm
55b9408c7d Update curl version, fixing osx build
@ret2libc reported that osx builds were failing with the current version
of libcurl. Update to the latest version and add the necessary configure
arguments.

Also use https links for all dependencies downloads.
2017-10-13 11:35:48 -07:00
Mark Stemm
5b65fe11f1 Merge pull request #290 from draios/no-rules-files-in-engine
Move rules cmakefiles from engine to falco itself
2017-10-10 15:59:32 -07:00
Mark Stemm
5d21936f60 Move rules cmakefiles from engine to falco itself
The rules CMakeLists.txt, which controls the installation of the falco
rules files, was in the engine CMakeLists.txt, which meant that programs
that included the engine would also include rules files.

This may not always be desired, so move the rules CMakeLists.txt to the
main falco CMakeLists.txt instead.
2017-10-10 14:47:33 -07:00
Mark Stemm
5f688d89e4 Merge pull request #289 from draios/update-readme-no-mailing-list
Update README to drop mailing list
2017-10-10 11:51:23 -07:00
Mark Stemm
2bda0f7ed5 Update README to drop mailing list
Also update the version.
2017-10-10 11:20:36 -07:00
Mark Stemm
9b35e06db8 Merge pull request #288 from draios/fix-rule-loading
Fix built-in falco config location.
2017-10-10 10:48:08 -07:00
Mark Stemm
60d609b8ec Also update changelog. 2017-10-10 09:43:44 -07:00
Mark Stemm
38f1d20ab2 Fix built-in falco config location.
Also needed to be updated from /etc/ to /etc/falco.
2017-10-10 09:42:06 -07:00
Mark Stemm
5230b22876 Merge pull request #287 from draios/prepare-for-0.8.0
Docs changes for 0.8.0
2017-10-09 17:15:38 -07:00
Mark Stemm
1676333d7b Docs changes for 0.8.0
Also fix the incorrect year for several prior releases.
2017-10-09 16:48:59 -07:00
Mark Stemm
4a8ac8d164 Merge pull request #259 from draios/more-beta-updates
More beta updates
2017-10-09 15:09:09 -07:00
Mark Stemm
e1044629cb Work around unknown users in containers wrt setuid
Work around https://github.com/draios/sysdig/issues/954, which relates
to not always knowing the proper user name in containers, by not running
the rule when in a container and the user name is "<NA>". This won't
address cases where the uid from inside the container maps to a user
name outside the container that is different than the user inside the
container, but it will help a bit.
2017-10-09 13:15:39 -07:00
Mark Stemm
080305c7a0 Adjust for new severity
Shell in container is now debug level, so adjust test case to match.
2017-10-09 13:05:12 -07:00
Mark Stemm
26d5ea0123 Merge pull request #286 from draios/no-config-when-validate-rules
Add ability to validate rules file
2017-10-09 12:50:56 -07:00
Mark Stemm
53ca4349f9 Add ability to validate rules file
New argument -V validates a single rules file without any verbose
description of the rules and without reading the main falco config file
at all.
2017-10-09 12:02:23 -07:00
Mark Stemm
0fcd01f98d Let git modify nssdb
Let git-remote-http modify files below the nssdb.
2017-10-09 10:37:33 -07:00
Mark Stemm
1b591dc4f3 Misc build-related fixes
- Let yarn spawn shells
- Add several allowed commandlines
- Let configure spawn shells in containers
2017-10-09 10:36:35 -07:00
Mark Stemm
43b773e9b2 Misc gem/ruby/bundler changes
- Let gem install software.
- Let ruby spawn shells when run by bundle.
2017-10-09 10:34:41 -07:00
Mark Stemm
0d88c3020d Let qualys perform more actions.
It can have more intermediate shells, is allowed to write to its own
conf file, and can run user management binaries.
2017-10-09 09:20:42 -07:00
Mark Stemm
33a28cc173 Let node running yarn spawn shells. 2017-10-09 09:20:41 -07:00
Mark Stemm
a68d2ad769 Let bundle spawn shells. 2017-10-09 09:20:41 -07:00