-
Notifications
You must be signed in to change notification settings - Fork 26
[DPE-5248] Add pgAudit #612
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
Conversation
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #612 +/- ##
==========================================
+ Coverage 70.81% 70.89% +0.08%
==========================================
Files 12 12
Lines 3039 3048 +9
Branches 537 539 +2
==========================================
+ Hits 2152 2161 +9
Misses 771 771
Partials 116 116 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
config.yaml
Outdated
type: boolean | ||
description: Enable timescaledb extension | ||
plugin_audit_enable: | ||
default: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JFYI, Audit plugin has been enabled on MySQL by default (for login actions only). Please check with @7annaba3l
Please update PR description: s/rock/snap/ |
Thanks, Alex! I updated the description. |
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Thanks for pointing that out, Alex! After syncing with Mohamed, I updated the plugin to enable it by default on 26ad2c0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I would invert the test logic to be close to the real scenarios.
tests/unit/test_charm.py
Outdated
default: false | ||
type: boolean | ||
plugin_audit_enable: | ||
default: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are testing possibility to enable pgaudit.
IMHO, we should keep default true, but test possibility of disabling it in the test below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Fixed on e1d2916.
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Issue
The pgAudit plugin/extension is available in the latest revision of the Charmed PostgreSQL snap, but not in this charm.
Solution
Expose pgAudit as another plugin/extension charm config option and enable it when requested by:
pgaudit
to the PostgreSQLshared_preload_libraries
parameter.lib/charms/postgresql_k8s/v0/postgresql.py
.Added new unit and integration tests.
Also, some adjustments were made in the plugin retrieval, which is used in the
config-changed
anddatabase-requested
hook handlers.This is a port of canonical/postgresql-k8s-operator#688.