-
Notifications
You must be signed in to change notification settings - Fork 919
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from draios/falco-engine
Falco engine
- Loading branch information
Showing
41 changed files
with
972 additions
and
471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
if(NOT DEFINED FALCO_ETC_DIR) | ||
set(FALCO_ETC_DIR "/etc") | ||
endif() | ||
|
||
if(DEFINED FALCO_COMPONENT) | ||
install(FILES falco_rules.yaml | ||
COMPONENT "${FALCO_COMPONENT}" | ||
DESTINATION "${FALCO_ETC_DIR}") | ||
else() | ||
install(FILES falco_rules.yaml | ||
DESTINATION "${DIR_ETC}") | ||
DESTINATION "${FALCO_ETC_DIR}") | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
gcc -O2 -fPIC -I$LUA_INCLUDE -c lpcap.c -o lpcap.o | ||
gcc -O2 -fPIC -I$LUA_INCLUDE -c lpcode.c -o lpcode.o | ||
gcc -O2 -fPIC -I$LUA_INCLUDE -c lpprint.c -o lpprint.o | ||
gcc -O2 -fPIC -I$LUA_INCLUDE -c lptree.c -o lptree.o | ||
gcc -O2 -fPIC -I$LUA_INCLUDE -c lpvm.c -o lpvm.o | ||
set -ex | ||
|
||
PREFIX=$1 | ||
|
||
if [ -z $PREFIX ]; then | ||
PREFIX=. | ||
fi | ||
|
||
mkdir -p $PREFIX | ||
|
||
gcc -O2 -fPIC -I$LUA_INCLUDE -c lpcap.c -o $PREFIX/lpcap.o | ||
gcc -O2 -fPIC -I$LUA_INCLUDE -c lpcode.c -o $PREFIX/lpcode.o | ||
gcc -O2 -fPIC -I$LUA_INCLUDE -c lpprint.c -o $PREFIX/lpprint.o | ||
gcc -O2 -fPIC -I$LUA_INCLUDE -c lptree.c -o $PREFIX/lptree.o | ||
gcc -O2 -fPIC -I$LUA_INCLUDE -c lpvm.c -o $PREFIX/lpvm.o | ||
|
||
|
||
# For building lpeg.so, which we don't need now that we're statically linking lpeg.a into falco | ||
#gcc -shared -o lpeg.so -L/usr/local/lib lpcap.o lpcode.o lpprint.o lptree.o lpvm.o | ||
#gcc -shared -o lpeg.so -L/usr/local/lib lpcap.o lpcode.o lpprint.o lptree.o lpvm.o | ||
|
||
pushd $PREFIX | ||
/usr/bin/ar cr lpeg.a lpcap.o lpcode.o lpprint.o lptree.o lpvm.o | ||
/usr/bin/ranlib lpeg.a | ||
popd | ||
|
||
chmod ug+w re.lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This ruleset depends on the is_cat macro defined in single_rule.yaml | ||
|
||
- rule: exec_from_cat | ||
desc: A process named cat does execve | ||
condition: evt.type=execve and is_cat | ||
output: "An exec was seen (command=%proc.cmdline)" | ||
priority: ERROR | ||
|
||
- rule: access_from_cat | ||
desc: A process named cat does an access | ||
condition: evt.type=access and is_cat | ||
output: "An access was seen (command=%proc.cmdline)" | ||
priority: INFO |
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- macro: is_cat | ||
condition: proc.name=cat | ||
|
||
- rule: open_from_cat | ||
desc: A process named cat does an open | ||
condition: evt.type=open and is_cat | ||
output: "An open was seen (command=%proc.cmdline)" | ||
priority: WARNING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
include_directories("${PROJECT_SOURCE_DIR}/../sysdig/userspace/libsinsp/third-party/jsoncpp") | ||
include_directories("${PROJECT_SOURCE_DIR}/../sysdig/userspace/libscap") | ||
include_directories("${PROJECT_SOURCE_DIR}/../sysdig/userspace/libsinsp") | ||
include_directories("${PROJECT_BINARY_DIR}/userspace/engine") | ||
include_directories("${LUAJIT_INCLUDE}") | ||
|
||
add_library(falco_engine STATIC rules.cpp falco_common.cpp falco_engine.cpp) | ||
|
||
target_include_directories(falco_engine PUBLIC | ||
"${LUAJIT_INCLUDE}") | ||
|
||
target_link_libraries(falco_engine | ||
"${FALCO_SINSP_LIBRARY}" | ||
"${LPEG_LIB}" | ||
"${LYAML_LIB}" | ||
"${LIBYAML_LIB}") | ||
|
||
configure_file(config_falco_engine.h.in config_falco_engine.h) | ||
|
||
if(DEFINED FALCO_COMPONENT) | ||
install(DIRECTORY lua | ||
DESTINATION "${FALCO_SHARE_DIR}" | ||
COMPONENT "${FALCO_COMPONENT}" | ||
FILES_MATCHING PATTERN *.lua) | ||
else() | ||
install(DIRECTORY lua | ||
DESTINATION "${FALCO_SHARE_DIR}" | ||
FILES_MATCHING PATTERN *.lua) | ||
endif() | ||
|
||
add_subdirectory("${PROJECT_SOURCE_DIR}/../falco/rules" "${PROJECT_BINARY_DIR}/rules") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#pragma once | ||
|
||
#define FALCO_ENGINE_LUA_DIR "${CMAKE_INSTALL_PREFIX}/${FALCO_SHARE_DIR}/lua/" | ||
#define FALCO_ENGINE_SOURCE_LUA_DIR "${PROJECT_SOURCE_DIR}/../falco/userspace/engine/lua/" |
Oops, something went wrong.