Commit Graph

651 Commits

Author SHA1 Message Date
Mark Stemm
e1293a7eca Add some additional command lines.
Dangling parentheses intentional.
2017-10-09 09:16:24 -07:00
Mark Stemm
02645e7a2e Be consistent about nested quotes.
Use single quotes for the outer yaml-level strings, and double quote for
the quoted string.
2017-10-09 09:16:24 -07:00
Mark Stemm
c8c0a97f64 Let Xvfb setuid.
X11 program.
2017-10-09 09:16:24 -07:00
Mark Stemm
d96cf4c369 Allow programs to write below /etc/logstash
At least for some logstash configs, device files get written to below
/etc/logstash instead of elsewhere like /var.
2017-10-09 09:16:24 -07:00
Mark Stemm
e2be47e3c2 Allow update-ca-certi(ficates) to write below /etc
Truncation intentonal.
2017-10-09 09:16:24 -07:00
Mark Stemm
ee2c668746 Add systemd as a program that can write below /etc
It can modify /etc/resolv.conf.
2017-10-09 09:16:24 -07:00
Mark Stemm
09e1caf4bb add mesos-executor as a mesos binary. 2017-10-09 09:16:24 -07:00
Mark Stemm
68d29fc906 Add shell management programs.
add-shell and remove-shell are programs that remove shells from
/etc/shells. They are allowed to write to files below /etc.
2017-10-09 09:16:24 -07:00
Mark Stemm
7ac49a2f99 Also allow sysdig agent to setuid.
It was already allowed to change namespaces.
2017-10-09 09:16:24 -07:00
Mark Stemm
e6006e3787 Add additional dpkg binary
dpkg-reconfigur(e), not to be confused with dpkg-preconfigu(re)
2017-10-09 09:16:24 -07:00
Mark Stemm
5d856ef97a Let _apt user setuid to itself. 2017-10-09 09:16:24 -07:00
Mark Stemm
3b486fb6c6 Let npm spawn shells in containers. 2017-10-09 09:16:24 -07:00
Mark Stemm
daedcf172f Let hhvm spawn shells.
http://hhvm.com/, "open-source virtual machine designed for executing
programs written in Hack and PHP."
2017-10-09 09:16:24 -07:00
Mark Stemm
414a4aaba7 Another shell command line. 2017-10-09 09:16:24 -07:00
Mark Stemm
5382aa4e3b More shell spawners
Add additional shell spawning command lines.

Allow package management binaries in containers--lots of people seem to
do it. Also allow pycompile/py3compile.

I need to refactor the shell spawners to more clearly isolate shell
spawners that we don't want to occur in a container from ones that can
run both inside and outside of a container.
2017-10-09 09:16:24 -07:00
Mark Stemm
3a60caa9ed Merge pull request #285 from draios/add-unbuffered-output
Add ability to make outputs unbuffered
2017-10-06 21:51:53 -07:00
Mark Stemm
7a31c59fe4 Add ability to make outputs unbuffered
A new falco.yaml option buffered_outputs, also controlled by
-U/--unbuffered, sets unbuffered outputs for the output methods. This is
especially useful with keep_alive files/programs where you want the
output right away.

Also add cleanup methods for the output channels that ensure output to
the file/program is flushed and closed.
2017-10-06 21:03:59 -07:00
Mark Stemm
8167510694 Merge pull request #284 from draios/add-full-falco-share-dir
add an absolute-path version of FALCO_SHARE_DIR
2017-10-06 17:04:12 -07:00
Mark Stemm
e92ca7574e Merge pull request #283 from draios/long-lived-program-output
Long lived program output
2017-10-06 16:01:46 -07:00
Mark Stemm
ae73f75d81 add an absolute-path version of FALCO_SHARE_DIR
Needed when embedding in other products.
2017-10-06 15:58:30 -07:00
Mark Stemm
1635d08df0 Allow outputs to keep file/program open
Add the ability to keep file/program outputs open (i.e. writing to the
same open file/program for multiple notifications). A new option to the
file/program output "keep_alive", if true, keeps the file/program pipe
open across events.

This makes the need for unbuffered output aka
https://github.com/draios/falco/issues/211 more pressing. Will add that next.
2017-10-06 15:04:40 -07:00
Mark Stemm
5420d0e3a0 WIP on long-lived program outputs. 2017-10-06 15:03:23 -07:00
Mark Stemm
72014f3522 Merge pull request #282 from draios/fields-in-json-output
Add individual event fields to json output
2017-10-06 15:02:49 -07:00
Mark Stemm
aed1897cf1 Add individual event fields to json output
When json output is set, add a sub-object called output_fields to the
json output that contains the individual templated fields from the
output string. Makes it easier to parse those fields.

This fixes https://github.com/draios/falco/issues/261.
2017-10-06 13:16:41 -07:00
Mark Stemm
1e33358742 Merge pull request #278 from draios/handle-default-file
Rework config file handling
2017-10-06 09:08:45 -07:00
Mark Stemm
dca7686e47 Merge pull request #281 from draios/filter-by-severity
Run rules by priority
2017-10-06 09:08:26 -07:00
Mark Stemm
5c09ef2c3f Fully remove package. 2017-10-05 18:36:34 -07:00
Mark Stemm
8641f3c958 Rework config file handling
These changes allow for a local rules file that will be preserved across
upgrades and allows the main rules file to be overwritten across upgrades.

- Move all config/rules files below /etc/falco/
- Add a "local rules" file /etc/falco/falco_rules.local.yaml. The intent
  is that it contains modifications/deltas to the main rules file
  /etc/falco/falco_rules.yaml. The main falco_rules.yaml should be
  treated as immutable.
- All config files are flagged so they are not overwritten on upgrade.
- Change the handling of the config item "rules_file" in falco.yaml to
  allow a list of files. By default, this list contains:
  [/etc/falco/falco_rules.yaml, /etc/falco/falco_rules.local.yaml].

Also change rpm/debian packaging to ensure that the above files are
preserved across upgrades:

- Use relative paths for share/bin dirs. This ensures that when packaged
  as rpms they won't be flagged as config files.
- Add CMAKE_INSTALL_PREFIX to FALCO_ENGINE_LUA_DIR now that it's relative.
- In debian packaging, flag
  /etc/falco/{falco.yaml,falco_rules.yaml,falco_rules.local.yaml} as
  conffiles. That way they are preserved across upgrades if modified.
- In rpm packaging when using cmake, any files installed with an
  absolute path are automatically flagged as %config. The only files
  directly installed are now the config files, so that addresses the problem.

Add CMAKE_INSTALL_PREFIX to lua dir.
2017-10-05 18:35:39 -07:00
Mark Stemm
283c6eea99 Fully remove falco package.
In case there are modified config files from a prior install.
2017-10-05 18:28:29 -07:00
Mark Stemm
aa073586f1 Add ability to filter events by priority/cleanups
Clean up the handling of priority levels within rules. It used to be a
mix of strings handled in various places. Now, in falco_common.h there's
a consistent type for priority-as-number as well as a list of
priority-as-string values. Priorities are passed around as numbers
instead of strings. It's still permissive about capitalization.

Also add the ability to load rules by severity. New falco
config option "priority=<val>"/-o priority=<val> specifies the minimum
priority level of rules that will be loaded.

Add unit tests for same. The test suppresses INFO notifications for a
rule/trace file combination that would otherwise generate them.
2017-10-05 18:07:54 -07:00
Mark Stemm
c41bcbd240 Merge pull request #277 from draios/append-macros-rules
Add ability to append to rules/macros
2017-09-25 10:56:23 -07:00
Mark Stemm
c7d61305cc Merge pull request #263 from draios/govt-cla
adding govt CLA
2017-09-22 17:27:01 -07:00
Mark Stemm
ab3da5dfcf Update govt cla links.
Use the falco file, and the govt file.
2017-09-22 17:25:16 -07:00
Mark Stemm
95bb96e6ec Merge pull request #269 from dkerwin/add_keepalived_to_run_shell_cmd
Add keepalived to list of shell spawning binaries
2017-09-22 17:19:54 -07:00
Mark Stemm
1666d03afc Merge pull request #270 from dkerwin/add_gitlab_ee
Add official gitlab EE docker image to list of known shell spawning images
2017-09-22 17:19:14 -07:00
Mark Stemm
a38f7f181b Add ability to append to rules/macros
Add the ability to append to rules/macros, like we already do with
lists. For rules/macros, if the object has an append: true key, the
condition value is appended to the condition of an existing rule/macro
with the same name.

Like lists, it's an error to specify append: true without there being an
existing rule/macro.

Also add tests that test the same kind of things we did for lists:
 - That append: true really does append
 - That append: false overwrites the rule/macro
 - That it's an error to append with a prior rule/macro existing.
2017-09-22 17:08:00 -07:00
Riccardo Schirone
2d0963e97c CMakeLists: add messages for lpeg, lyaml and libyaml 2017-09-21 11:47:01 -07:00
Mark Stemm
fbdeb26e99 Merge pull request #276 from draios/fix-readme
Fix readme.
2017-09-19 16:16:27 -07:00
Mark Stemm
7e4d9f5b51 Fix readme.
Fix slack url in README to one that allows self-signup.

This fixes https://github.com/draios/falco/issues/272.
2017-09-19 16:14:30 -07:00
Mark Stemm
5bb94c81ed Merge pull request #275 from draios/change-example-port
Switch port to 8181.
2017-09-18 13:55:22 -07:00
Mark Stemm
30ebfd4bcc Switch port to 8181.
Won't conflict with k8s api server port.
2017-09-18 08:46:50 -07:00
Daniel Kerwin
64145ba961
Add official gitlab EE docker image to list of known shell spawning images.
sysdig-CLA-1.0-signed-off-by: Daniel Kerwin <daniel@gini.net>
2017-09-05 13:41:05 +02:00
Daniel Kerwin
598cbbe5e7
Add keepalived to list oh shell spawning binaries.
sysdig-CLA-1.0-signed-off-by: Daniel Kerwin <daniel@gini.net>
2017-09-04 22:08:47 +02:00
Mark Stemm
240a8ffffa Merge pull request #264 from draios/mergable-lists
Mergable lists
2017-08-10 11:08:36 -07:00
Mark Stemm
d1265ff520 Merge pull request #265 from draios/remove-trailing-newline-output
Remove trailing newlines from output
2017-08-10 09:44:39 -07:00
Mark Stemm
0bc2d4f162 Automated tests for list append.
Test the case of appending to a list and appending to a nonexistent
list (should error).
2017-08-10 09:36:31 -07:00
Mark Stemm
2c189d6a60 Add ability to append to lists.
List nodes can now have an 'append' key. If present and true, any values
in this list will be appended to the end of any existing list with the
same name.

It is an error to have a list with 'append' true that has a name that is
not an existing list.
2017-08-09 18:07:34 -07:00
Mark Stemm
ebed9f8dfd Remove trailing newlines from output
If in yaml, the output field is folded-style aka:

output: <
   some multi-line
   output here

The unfolded string will have a trailing newline. Remove it.
2017-08-09 17:53:53 -07:00
Chris Crane
ed2586eafb adding govt CLA 2017-08-04 13:59:17 -07:00
Mark Stemm
9d6fe878e1 Merge pull request #262 from draios/allow-dots-in-paths
Allow dots in paths.
2017-08-04 11:56:15 -07:00