From 9e97c38d48dd84c2318d395473f3e6532c9dd80e Mon Sep 17 00:00:00 2001 From: Timo Pollmeier Date: Tue, 6 Jul 2021 11:54:28 +0200 Subject: [PATCH 1/3] Add --optimize add-/cleanup-feed-permissions The add-feed-permissions option adds read permissions on the feed data objects for all roles defined in the "Feed Import Roles" setting if they do not exist. The cleanup-feed-permissions removes all role permissions on the feed data objects that do not match ones in the setting. --- INSTALL.md | 18 ++++ doc/gvmd.8 | 2 +- doc/gvmd.8.xml | 3 +- doc/gvmd.html | 3 +- src/gvmd.c | 3 +- src/manage_sql.c | 268 +++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 293 insertions(+), 4 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 39e61194c..2de29be32 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -355,6 +355,16 @@ supported values for `` are: For more information see the documentation for the `ANALYZE` command of the database back-end you are using. +- `add-feed-permissions` + + This option adds new read permissions on all feed data objects for the roles + defined in the "Feed Import Roles" setting if they do not exist. + The new permissions will be owned by the same user as the data objects, + usually the feed import owner. + + This does not affect the command permissions, any permissions created for + users or groups, or other types of permissions like modify or delete. + - `cleanup-config-prefs` This option removes duplicate preferences from Scan Configs and corrects @@ -362,6 +372,14 @@ supported values for `` are: database must be up to date (if Manager and Scanner are both running, then this should happen automatically). +- `cleanup-feed-permissions` + + This option removes permissions on all feed data objects for all roles + that are not defined in the "Feed Import Roles" setting. + + This does not affect the command permissions, any permissions created for + users or groups, or other types of permissions like modify or delete. + - `cleanup-port-names` This cleans up the ports of results as stored in the database by removing diff --git a/doc/gvmd.8 b/doc/gvmd.8 index 6d8bdc6c7..d7441ae83 100644 --- a/doc/gvmd.8 +++ b/doc/gvmd.8 @@ -125,7 +125,7 @@ Modify user's password and exit. Modify user's password and exit. .TP \fB--optimize=\fINAME\fB\f1 -Run an optimization: vacuum, analyze, cleanup-config-prefs, cleanup-port-names, cleanup-report-formats, cleanup-result-nvts, cleanup-result-severities, cleanup-schedule-times, migrate-relay-sensors, rebuild-report-cache or update-report-cache. +Run an optimization: vacuum, add-feed-permissions, analyze, cleanup-config-prefs, cleanup-feed-permissions, cleanup-port-names, cleanup-report-formats, cleanup-result-nvts, cleanup-result-severities, cleanup-schedule-times, migrate-relay-sensors, rebuild-report-cache or update-report-cache. .TP \fB--osp-vt-update=\fISCANNER-SOCKET\fB\f1 Unix socket for OSP NVT update. Defaults to the path of the 'OpenVAS Default' scanner if it is an absolute path. diff --git a/doc/gvmd.8.xml b/doc/gvmd.8.xml index 79fc50d44..10499ee7e 100644 --- a/doc/gvmd.8.xml +++ b/doc/gvmd.8.xml @@ -283,7 +283,8 @@ along with this program. If not, see .