Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule updates next #293

Merged
merged 90 commits into from
Oct 25, 2017
Merged

Rule updates next #293

merged 90 commits into from
Oct 25, 2017

Commits on Oct 19, 2017

  1. Let luajit spawn shells.

    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    b068452 View commit details
    Browse the repository at this point in the history
  2. 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.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    c25ab63 View commit details
    Browse the repository at this point in the history
  3. 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.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    e05d379 View commit details
    Browse the repository at this point in the history
  4. Better support for dovecot

    Allow dovecot to setuid by adding to mail_binaries.
    
    Allow the program auth, when run by dovecot, to spawn shells.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    6cd54db View commit details
    Browse the repository at this point in the history
  5. 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.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    b295bfa View commit details
    Browse the repository at this point in the history
  6. Let strongswan spawn shells.

    Specifically the program starter. Using the full command line to be more
    specific.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    2b31a1a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    079ca27 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    22aa9c9 View commit details
    Browse the repository at this point in the history
  9. Let mandb read sensitive files

    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    7d630e0 View commit details
    Browse the repository at this point in the history
  10. Let specific phusion passenger binaries run shells

    The program is "my_init", which is fairly generic, so capture it by the
    full command line.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    9b4e9ea View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    7ebbabb View commit details
    Browse the repository at this point in the history
  12. Let networkmanager modify /etc/resolv.conf

    specifically nm-dispatcher
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    90a5b36 View commit details
    Browse the repository at this point in the history
  13. Let hostid open network connections

    It might perform dns lookups as a part of resolving ip addresses.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    4fc1277 View commit details
    Browse the repository at this point in the history
  14. Let uwsgi spawn shells

    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    145c487 View commit details
    Browse the repository at this point in the history
  15. Add docker-runc-cur as a docker binary.

    truncated version of docker-runc-current.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    bb1bb93 View commit details
    Browse the repository at this point in the history
  16. 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.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    56823e2 View commit details
    Browse the repository at this point in the history
  17. Also let foreman spawn shells

    Used by Red Hat Sattelite.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    ff8123b View commit details
    Browse the repository at this point in the history
  18. Let confluence run shells.

    Appears as java program, so look for the classpath.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    75d5a7b View commit details
    Browse the repository at this point in the history
  19. 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.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    809b7aa View commit details
    Browse the repository at this point in the history
  20. Let tomcat spawn shells.

    It's java so you need to look at the classpath.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    c23ff4b View commit details
    Browse the repository at this point in the history
  21. Let pip install software.

    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    00ddcf6 View commit details
    Browse the repository at this point in the history
  22. Add another yarn command line.

    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    182d70a View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    de2432e View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    4e52cf1 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    2eb0103 View commit details
    Browse the repository at this point in the history
  26. Fix plesk writing keys macro

    Should be testing proc.name, not proc.cmdline.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    29306b6 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    e9a1657 View commit details
    Browse the repository at this point in the history
  28. Add more shell spawners.

    S99qualys-cloud is the init script, cfn-signal is cloudformation.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    2604f9e View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    a50b32a View commit details
    Browse the repository at this point in the history
  30. Let programs run by locales.postins write to /etc

    It can run scripts like sed to modify files before writing the final
    file.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    daa37d6 View commit details
    Browse the repository at this point in the history
  31. Let install4j java progs spawn shells.

    Again, searching by classpath.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    99d4ca7 View commit details
    Browse the repository at this point in the history
  32. 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.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    8104cec View commit details
    Browse the repository at this point in the history
  33. Add addl ruby-based passenger spawners

    Add a different way to identify ruby run by phusion passenger.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    3bd8103 View commit details
    Browse the repository at this point in the history
  34. 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.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    c7fa091 View commit details
    Browse the repository at this point in the history
  35. Let nginx spawn shells.

    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    afbfe1b View commit details
    Browse the repository at this point in the history
  36. 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.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    2bd09cc View commit details
    Browse the repository at this point in the history
  37. Let PassengerWatchd run shells

    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    5a209d0 View commit details
    Browse the repository at this point in the history
  38. Add additional foreman shells

    Let the direct parent also be scl when the ancestor is tfm-rake,tfm-ruby.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    dbc7826 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    709d81d View commit details
    Browse the repository at this point in the history
  40. Also let cron spawn shells in containers

    Seen when using things like phusion passenger.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    0b49909 View commit details
    Browse the repository at this point in the history
  41. Also let run-parts run cmp/cp for sensitive files

    Might be a case of a missing process but might also be legitimate.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    480a1eb View commit details
    Browse the repository at this point in the history
  42. Let erlexec spawn shells.

    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    d2cd0dc View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    f43fdaf View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    841f94b View commit details
    Browse the repository at this point in the history
  45. Add imap/mailmng-core as mail binaries.

    Also split list across multiple lines.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    3d73f77 View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    6344215 View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    cde79ff View commit details
    Browse the repository at this point in the history
  48. Let ics_start/stop running java spawn shells

    java is the direct parent, ics_start/stop are ancestors.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    8299675 View commit details
    Browse the repository at this point in the history
  49. Let PassengerAgent setuid.

    It setuids to nobody.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    17145d8 View commit details
    Browse the repository at this point in the history
  50. Configuration menu
    Copy the full SHA
    0c12507 View commit details
    Browse the repository at this point in the history
  51. Let bwrap setuid

    A container setup utility.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    5f0d0d5 View commit details
    Browse the repository at this point in the history
  52. Detect writes below /, /root

    New rule Write below root detects writes either directly below / or
    anywhere below /root.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    6bfeb6c View commit details
    Browse the repository at this point in the history
  53. 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.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    f8431d3 View commit details
    Browse the repository at this point in the history
  54. Add additional sensitive mounts.

    Add additional sensitive mounts, including the docker socket, /,
    anywhere below /root, or anywhere below /etc.
    mstemm committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    b6e7215 View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2017

  1. Let pki-realm write below /etc/pki/realms

    Appears to be an ansible script.
    mstemm committed Oct 20, 2017
    Configuration menu
    Copy the full SHA
    2be5da9 View commit details
    Browse the repository at this point in the history
  2. Let sgdisk write below dev

    mstemm committed Oct 20, 2017
    Configuration menu
    Copy the full SHA
    4539521 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0fa5315 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6ec06b8 View commit details
    Browse the repository at this point in the history
  5. Add additional mail binaries.

    mstemm committed Oct 20, 2017
    Configuration menu
    Copy the full SHA
    cc47fa2 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    38f8df1 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8c0c789 View commit details
    Browse the repository at this point in the history
  8. 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.
    mstemm committed Oct 20, 2017
    Configuration menu
    Copy the full SHA
    ecbfa1a View commit details
    Browse the repository at this point in the history
  9. 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.
    mstemm committed Oct 20, 2017
    Configuration menu
    Copy the full SHA
    75fdbf4 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2017

  1. 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.
    mstemm committed Oct 23, 2017
    Configuration menu
    Copy the full SHA
    370f64b View commit details
    Browse the repository at this point in the history
  2. Add container.image to container-related rules.

    Helps in diagnosis.
    mstemm committed Oct 23, 2017
    Configuration menu
    Copy the full SHA
    18c405d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a6123e9 View commit details
    Browse the repository at this point in the history
  4. Allow sa-update to read sensitive files

    SpamAssassin updater.
    mstemm committed Oct 23, 2017
    Configuration menu
    Copy the full SHA
    b469122 View commit details
    Browse the repository at this point in the history
  5. Add additional shell spawners.

    mstemm committed Oct 23, 2017
    Configuration menu
    Copy the full SHA
    d1c827d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e640ac4 View commit details
    Browse the repository at this point in the history
  7. 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.
    mstemm committed Oct 23, 2017
    Configuration menu
    Copy the full SHA
    26171da View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2017

  1. Let htpasswd write below /etc

    Part of nginx
    mstemm committed Oct 24, 2017
    Configuration menu
    Copy the full SHA
    d3ccae3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7b99c57 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    84e36d9 View commit details
    Browse the repository at this point in the history
  4. Generalize jenkins scripts spawning shells

    Generalize jenkins_script_sh to jenkins_scripts and add additional
    cases.
    mstemm committed Oct 24, 2017
    Configuration menu
    Copy the full SHA
    fd68ab7 View commit details
    Browse the repository at this point in the history
  5. Let php run by assemble spawn shells

    Better than globally letting php spawn shells.
    mstemm committed Oct 24, 2017
    Configuration menu
    Copy the full SHA
    244397f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    99d275c View commit details
    Browse the repository at this point in the history
  7. Add additional package mgmt prog

    rhsmcertd-worke(r), red hat subscription manager
    mstemm committed Oct 24, 2017
    Configuration menu
    Copy the full SHA
    3966187 View commit details
    Browse the repository at this point in the history
  8. Add additional yarn cmdlines.

    mstemm committed Oct 24, 2017
    Configuration menu
    Copy the full SHA
    4c1f0ff View commit details
    Browse the repository at this point in the history
  9. Let dmeventd write below etc.

    device mapper event daemon.
    mstemm committed Oct 24, 2017
    Configuration menu
    Copy the full SHA
    9c2b110 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    ea1af2b View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2017

  1. Configuration menu
    Copy the full SHA
    ee78d96 View commit details
    Browse the repository at this point in the history
  2. 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.
    mstemm committed Oct 25, 2017
    Configuration menu
    Copy the full SHA
    bc54809 View commit details
    Browse the repository at this point in the history
  3. 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.
    mstemm committed Oct 25, 2017
    Configuration menu
    Copy the full SHA
    f9035d7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d5277c5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ac02fae View commit details
    Browse the repository at this point in the history
  6. Add additional chef binaries.

    mstemm committed Oct 25, 2017
    Configuration menu
    Copy the full SHA
    bcebe72 View commit details
    Browse the repository at this point in the history
  7. Let fluentd spawn shells.

    mstemm committed Oct 25, 2017
    Configuration menu
    Copy the full SHA
    91892f0 View commit details
    Browse the repository at this point in the history
  8. Don't consider unix_chkpwd to be a user mgmt prog

    It only checks passwords.
    mstemm committed Oct 25, 2017
    Configuration menu
    Copy the full SHA
    7f6dfff View commit details
    Browse the repository at this point in the history
  9. 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.
    mstemm committed Oct 25, 2017
    Configuration menu
    Copy the full SHA
    b08ea96 View commit details
    Browse the repository at this point in the history
  10. Add exceptions for Write below root

    Add lists of files/directories that are acceptable to write.
    mstemm committed Oct 25, 2017
    Configuration menu
    Copy the full SHA
    71a386f View commit details
    Browse the repository at this point in the history