mirror of
https://github.com/falcosecurity/falco.git
synced 2025-10-21 11:29:26 +00:00
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.
30 lines
800 B
CMake
30 lines
800 B
CMake
if(NOT DEFINED FALCO_ETC_DIR)
|
|
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}")
|
|
|
|
install(FILES falco_rules.local.yaml
|
|
DESTINATION "${FALCO_ETC_DIR}"
|
|
RENAME "${FALCO_LOCAL_RULES_DEST_FILENAME}")
|
|
endif()
|
|
|