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

Rework config file handling #278

Merged
merged 2 commits into from
Oct 6, 2017
Merged

Rework config file handling #278

merged 2 commits into from
Oct 6, 2017

Conversation

mstemm
Copy link
Contributor

@mstemm mstemm commented Sep 25, 2017

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. falco_rules.yaml can be overwritten on
    upgrade, while falco.yaml/falco_rules.local.yaml are
    flagged as config files and 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].

This fixes #268.

@mstemm
Copy link
Contributor Author

mstemm commented Sep 26, 2017

I still need to fix redhat rpm packaging--several non-config files are being flagged with the %config attribute in the rpm spec, because they are being installed using absolute paths. In order to do that, I want to make some changes on the sysdig agent side first.

@mstemm mstemm force-pushed the handle-default-file branch 2 times, most recently from 3055ebd to 9c660c8 Compare October 5, 2017 17:34
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.
@mstemm mstemm merged commit 1e33358 into dev Oct 6, 2017
@mstemm mstemm deleted the handle-default-file branch October 6, 2017 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

falco.yaml and falco_rules.yaml overwritten during upgrade in Debian
1 participant