Hello,
We are working on a Trial version of Remote Desktop Manager and testing out the system. Now we have AzureAD integration working thanks to the latest update to 14.0.4, thank you for that!
But the next issue we see is the following: If we make an User (AzureAD or even Database) and give this user "Read only User" permissions, the user gets created in the Azure SQL Database, if we check / verify the permission on the database, we see the user is added, but still has Edit / Delete permission on the whole database.
So when the user knows the password / or uses his AzureAD account and connects with SQL Server Management Studio directly to the RDM database, he still can edit / delete records and destroy the database.
I would expect, especially if RDM handles the creation of accounts in the database, that it would also check the permissions and not give a "Read Only" user "Delete" permissions.
How should we solve this issue / can you verify if this is expected behavior? A geek like person is able to destroy a database this way even if we think he only has Read Only permissions.
Strange I will need to double check this, might be a bug in v14. Read only users should have read-only access to most tables. Why most? User will still need write to the log table for example.
As with any client-server type application, preventing the user from manipulating the data directly in the database can very between tricky. Once a user has any sort of authentication on the server (integrated authentication or SQL authentication) it is very difficult to prevent them from malicious actions like deleting or modifying data.
With RDM, one way around this is to not use SQL Authentication but rather use our own "Custom login". With “Custom Login” you configure the data source to connect to the database with a secret database login (say "RDMUser") and then lock the data source. Then you create “custom logins” that users will then use to authenticate and work within RDM. The custom login doesn’t grant them any direct access to the underlying database, all connections to the database are done using the “RDMUser” login.
Outlined here: https://blog.devolutions.net/2016/10/new-sql-server-custom-authentication-mode
Another work around is to use DPS (Devolutions Password Server) to act as a middle man between RDM and the database, preventing users direct access to the underlying database.
With all that said, I will investigate the possible issue on Monday and get back to you. Read-only users should still have a somewhat limited read/write access to the database.
Best regards,
Stéfane Lavergne
I had a look at the grant/deny/revoke statements issued via RDM for a read-only user in SQL Server.
Here is the output of such a userSchema Object username permission_name state_desc column_nameNULL DATABASE ReadOnlyUser CONNECT GRANT NULLNULL DATABASE ReadOnlyUser DELETE GRANT NULLNULL DATABASE ReadOnlyUser INSERT GRANT NULLNULL DATABASE ReadOnlyUser SELECT GRANT NULLNULL DATABASE ReadOnlyUser UPDATE GRANT NULLdbo Attachment ReadOnlyUser DELETE DENY NULLdbo Attachment ReadOnlyUser INSERT DENY NULLdbo Attachment ReadOnlyUser UPDATE DENY NULLdbo Connections ReadOnlyUser DELETE DENY NULLdbo Connections ReadOnlyUser INSERT DENY NULLdbo Connections ReadOnlyUser UPDATE DENY NULLdbo Connections ReadOnlyUser UPDATE REVOKE ModifiedDatedbo Connections ReadOnlyUser UPDATE REVOKE ModifiedUsernamedbo Connections ReadOnlyUser UPDATE REVOKE ModifiedLoggedUserNamedbo DatabaseInfo ReadOnlyUser DELETE DENY NULLdbo DatabaseInfo ReadOnlyUser INSERT DENY NULLdbo DatabaseInfo ReadOnlyUser UPDATE DENY NULLdbo GroupInfo ReadOnlyUser DELETE DENY NULLdbo GroupInfo ReadOnlyUser INSERT DENY NULLdbo GroupInfo ReadOnlyUser UPDATE DENY NULLdbo UserGroupInfo ReadOnlyUser DELETE DENY NULLdbo UserGroupInfo ReadOnlyUser INSERT DENY NULLdbo UserGroupInfo ReadOnlyUser UPDATE DENY NULLdbo UserSecurity ReadOnlyUser DELETE DENY NULLdbo UserSecurity ReadOnlyUser INSERT DENY NULL
As you can see all* the major tables (connection & security tables) have proper DENY for the read-only users.
Statements such as the following will fail:delete dbo.Connections where ID = '68CC5D41-67EE-440B-BA71-0015E4EFE07D'update dbo.Connections set ID = '68CC5D41-67EE-440B-BA71-0015E4EFE07D' where ID = '68CC5D41-67EE-440B-BA71-0015E4EFE07D'insert into dbo.Connections(ID) values (newid());Msg 229, Level 14, State 5, Line 21The DELETE permission was denied on the object 'Connections', database 'Std10', schema 'dbo'.Msg 229, Level 14, State 5, Line 22The UPDATE permission was denied on the object 'Connections', database 'Std10', schema 'dbo'.Msg 229, Level 14, State 5, Line 23The INSERT permission was denied on the object 'Connections', database 'Std10', schema 'dbo'.
* There are, however, a few satellite tables that could benefit from a more restrictive permission grant. I will add it to our to-do list.
Best regards,
Stéfane Lavergne