-
Notifications
You must be signed in to change notification settings - Fork 897
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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. - 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.
- Loading branch information
Showing
7 changed files
with
83 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ if(NOT DEFINED FALCO_VERSION) | |
endif() | ||
|
||
if(NOT DEFINED FALCO_ETC_DIR) | ||
set(FALCO_ETC_DIR "/etc") | ||
set(FALCO_ETC_DIR "/etc/falco") | ||
endif() | ||
|
||
if(NOT CMAKE_BUILD_TYPE) | ||
|
@@ -399,8 +399,8 @@ add_subdirectory("${SYSDIG_DIR}/userspace/libscap" "${PROJECT_BINARY_DIR}/usersp | |
add_subdirectory("${SYSDIG_DIR}/userspace/libsinsp" "${PROJECT_BINARY_DIR}/userspace/libsinsp") | ||
|
||
set(FALCO_SINSP_LIBRARY sinsp) | ||
set(FALCO_SHARE_DIR ${CMAKE_INSTALL_PREFIX}/share/falco) | ||
set(FALCO_BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin) | ||
set(FALCO_SHARE_DIR share/falco) | ||
set(FALCO_BIN_DIR bin) | ||
add_subdirectory(scripts) | ||
add_subdirectory(userspace/engine) | ||
add_subdirectory(userspace/falco) | ||
|
@@ -422,7 +422,7 @@ set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Sysdig <[email protected]>") | |
set(CPACK_DEBIAN_PACKAGE_SECTION "utils") | ||
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.sysdig.org") | ||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "dkms (>= 2.1.0.0)") | ||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/scripts/debian/postinst;${CMAKE_BINARY_DIR}/scripts/debian/prerm;${PROJECT_SOURCE_DIR}/scripts/debian/postrm") | ||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/scripts/debian/postinst;${CMAKE_BINARY_DIR}/scripts/debian/prerm;${PROJECT_SOURCE_DIR}/scripts/debian/postrm;${PROJECT_SOURCE_DIR}/cpack/debian/conffiles") | ||
|
||
set(CPACK_RPM_PACKAGE_LICENSE "GPLv2") | ||
set(CPACK_RPM_PACKAGE_URL "http://www.sysdig.org") | ||
|
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,3 @@ | ||
/etc/falco/falco.yaml | ||
/etc/falco/falco_rules.yaml | ||
/etc/falco/falco_rules.local.yaml |
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,19 +1,29 @@ | ||
if(NOT DEFINED FALCO_ETC_DIR) | ||
set(FALCO_ETC_DIR "/etc") | ||
set(FALCO_ETC_DIR "/etc/falco") | ||
endif() | ||
|
||
if(NOT DEFINED FALCO_RULES_DEST_FILENAME) | ||
set(FALCO_RULES_DEST_FILENAME "falco_rules.yaml") | ||
set(FALCO_LOCAL_RULES_DEST_FILENAME "falco_rules.local.yaml") | ||
endif() | ||
|
||
if(DEFINED FALCO_COMPONENT) | ||
install(FILES falco_rules.yaml | ||
COMPONENT "${FALCO_COMPONENT}" | ||
DESTINATION "${FALCO_ETC_DIR}" | ||
RENAME "${FALCO_RULES_DEST_FILENAME}") | ||
|
||
install(FILES falco_rules.local.yaml | ||
COMPONENT "${FALCO_COMPONENT}" | ||
DESTINATION "${FALCO_ETC_DIR}" | ||
RENAME "${FALCO_LOCAL_RULES_DEST_FILENAME}") | ||
else() | ||
install(FILES falco_rules.yaml | ||
DESTINATION "${FALCO_ETC_DIR}" | ||
RENAME "${FALCO_RULES_DEST_FILENAME}") | ||
DESTINATION "${FALCO_ETC_DIR}" | ||
RENAME "${FALCO_RULES_DEST_FILENAME}") | ||
|
||
install(FILES falco_rules.local.yaml | ||
DESTINATION "${FALCO_ETC_DIR}" | ||
RENAME "${FALCO_LOCAL_RULES_DEST_FILENAME}") | ||
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#################### | ||
# Your custom rules! | ||
#################### | ||
|
||
# Add new rules, like this one | ||
# - rule: The program "sudo" is run in a container | ||
# desc: An event will trigger every time you run sudo in a container | ||
# condition: evt.type = execve and evt.dir=< and container.id != host and proc.name = sudo | ||
# output: "Sudo run in container (user=%user.name %container.info parent=%proc.pname cmdline=%proc.cmdline)" | ||
# priority: ERROR | ||
# tags: [users, container] | ||
|
||
# Or override/append to any rule, macro, or list from the Default 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
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