On 26.09.2025 at 09:50, 'Dimitry Sibiryakov' via firebird-devel wrote:
> Tomasz Tyrakowski wrote 25.09.2025 20:20:
>> In that case I'd rather implement an application server and physically
>> cut the users off the database.
>
> ...and it would still change nothing because the traffic is still
> intercepted, extra data deduced and application is debugged.
Yes, but cutting the users off the database and making them go through
an application server gives you another layer of control. Users cannot
connect directly to the DB and execute any SQL query they wish, they
need to talk to your service, which may decide to do something or not
(based on any number of factors, not the database alone). For example,
there is no way a user can drop a table (because your app server never
does drops). Another example: a user has a certain clearance level to
access only some documents from a table. The app server checks the
clearance and either sends a requested document or not (and it may get
even more complicated: user clearance level may be direct or inherited
from her/his department, etc. - put any convoluted business logic you
wish here). You can't do the same on the DB level alone, unless it
supports record-level permissions (and still inherited permissions and
"any convoluted business logic" would be difficult to do if possible at
all).
There's a reason why web apps have server-side code (which is just
another name for an application server), and not just in-browser
JavaScript talking directly to databases. I wouldn't trust my bank if it
did that ;)
So I think we don't need to argue whether using application server (or
an equivalent) makes any difference, because it does. It just requires
more work and is not always needed.
> Finally everything will come to the main security question: what
> exactly attack scenario they want to prevent. And "any" is not the answer.
>
Exactly. That's why I suggested a very simple solution, which would
prevent only casual users from trying to do something funny, but there's
probably no safe solution if you allow the users to talk to the database
server directly, and, at the same time, give them control over your
client application, so that they can analyze it any way they wish (so
there's no hidden server-side code, to which the users have no access).
A determined user can always mimic your app to authorize her/himself to
the DB server and, once logged in, do whatever the grants in the DB allow.
regards
Tomasz