After granting system privilege USE_GBAK_UTILITY to a role, they still can't use gbak. #8299
Replies: 10 comments 12 replies
-
Pass role to gbak, using ROLE switch |
Beta Was this translation helpful? Give feedback.
-
Also you may grant default role to user, it will be always active. |
Beta Was this translation helpful? Give feedback.
-
To clarify the other two replies, unless the role is granted as a default role (a feature introduced in Firebird 4.0), a role is not automatically used; it only applies when you explicitly specify it when connecting. |
Beta Was this translation helpful? Give feedback.
-
I converted the issue to a discussion, as it is not a bug. For questions, either use firebird-support, or the GitHub Discussions. |
Beta Was this translation helpful? Give feedback.
-
I tried your suggestion, specifying the gbak.exe -b -user backup -password "MYPW" "MYDBPATH.FDB" "MYFBKPATH.FBK" -ROLE BACKUP_ROLE And it looks like it worked, but I got this message:
Any idea how to proceed? I thought that giving the |
Beta Was this translation helpful? Give feedback.
-
On 10/31/24 15:07, Mark Rotteveel wrote:
@AlexPeshkoff <https://github.com/AlexPeshkoff> Is this the intended
behaviour, that you still need sufficient "normal" access privileges
even if you have |USE_GBAK_UTILITY|?
Yes.
System privileges are minimal pieces of additional rights check. Most of
them match exactly single place of superuser() check in the code. It's
OK to combine them into roles oriented on execution of superuser tasks.
From README.ddl.txt:
System privileges make it possible to delegate part of DBO rights to
other users.
Pay attention that system privileges provide very thin level of control,
therefore sometimes
you will need to give user >1 privilege to perform some task (for
example add
IGNORE_DB_TRIGGERS to USE_GSTAT_UTILITY cause gstat wants to ignore
database triggers).
|
Beta Was this translation helpful? Give feedback.
-
Although I understand everything you guys said, I would argue that Isn't GBAK's sole purpose to perform such tasks? if a user is allowed to use it, it means that the DBA is granting them permission to perform such tasks. It's like giving someone permission to open a box, look inside of it, rearrange the content if necessary but not giving them permission to put, take or modify anything inside of it. |
Beta Was this translation helpful? Give feedback.
-
On 10/31/24 15:00, Nickolas de Luca Alberton wrote:
Would this grant allow the user to access the database's tables and
run queries on it?
This grant is absolutely required for gbak to work - w/o it utility can
not query data to be backed up.
Yes, and update, insert and delete data.
@mark: This made me surprised. The problem is with USAGE grant, which
controls access to generators and exceptions and is currently included
into ACCESS_ANY_OBJECT_IN_DATABASE privilege. I wonder - may be it must
go into SELECT_ANY_OBJECT_IN_DATABASE too?
|
Beta Was this translation helpful? Give feedback.
-
On 10/31/24 17:43, Dimitry Sibiryakov wrote:
I just wonder what for gbak needs *use* any user trigger...
That's simple - to backup it's value. Any other way to get it except
gen_id(x, 0) ?
|
Beta Was this translation helpful? Give feedback.
-
On 10/31/24 17:39, Mark Rotteveel wrote:
It might be a sign that there needs to a separate
|USAGE_ON_ANY_OBJECT_IN_DATABASE| privilege, or that there is a gap in
the privileges, and there should be a |SELECT| privilege on sequences
which allows you to inspect the current value, e.g. |GEN_ID(sequence,
0)| (which I think is the only thing gbak needs here).
Adding USE_ANY_OBJECT_IN_DATABASE is possible way to go.
Well understanding that second suggestion, an ability to inspect the
current value with |SELECT| privilege, looks better I must say that
mplementing it is far not trivial - privileges checked at compile time,
and we can't know fr sure the value of second parameter in gen_id, it
may be query or procedure parameter. If we choose this way possible
solution is appropriate new info call to get generator value. As for me
I prefer new privilege.
|
|
|
Beta Was this translation helpful? Give feedback.
-
Firebird version: 4.0.4.3010.
Steps to reproduce:
1 - Created a user called
backup
.2 - Created a role called
BACKUP_ROLE
using this command:CREATE ROLE BACKUP_ROLE SET SYSTEM PRIVILEGES TO USE_GBAK_UTILITY;
3 - Granted the user
backup
the role ofBACKUP_ROLE
4 - Tried to use gbak with the backup user
Got this message:
The password, the database path and fbk path were redacted because of obvious reasons but they were correctly typed, I double checked
What am I supposed to do to allow my user
backup
to perform gbak backups and restores?Beta Was this translation helpful? Give feedback.
All reactions