doctrine2 - Symfony - Multiple Database Users - Principle of Least Privilege -


i symfony noob , i'm on uphill of learning curve @ moment, i'm still trucking along - we've been there @ point.

i've read several resources in designing application , 1 of them principle of least privilege in information security:

in information security, computer science, , other fields, principle of least privilege, known principle of minimal privilege or least privilege, requires in particular abstraction layer of computing environment, every module (such process, user or program on basis of layer considering) must able access such information , resources necessary legitimate purpose.

with in mind decided require 3 distinct database users access database:

  1. read only
  2. volatile - insert, update, delete
  3. admin - lock, backup, alter

with symfony seems me it's designed single database user in mind , although appears it's possible use multiple users/connections appears not recommended standard practice:

using multiple entity managers pretty easy, more advanced , not required. sure need multiple entity managers before adding in layer of complexity.

my questions are:

  1. am making more complicated needs be?
  2. does using single database user make symfony less secure?
  3. is article linked correct way achieve least privilege principle in symfony?

i think you're making more complicated needs be.

in cases you're concerned user's access or privileges domain object. times can approach level of security using simpler means of identifying ownership @ application level (e.g. checking see if associated user object in fact 1 logged in , trying access it), or can apply more complex model of ownership , permissions via access control list.

as whether using single-user makes database more-or-less secure. depends on architecture , you're trying do. however, think inevitably create design , architectural challenges beyond you're experiencing.


in experience web applications want limit privileges of database user associated application, user should have read-and-write privileges (e.g. combination of read-only , volatile users listed above in question). may had secondary database user (externalized application logic) directly usable against database administrative actions.

below, nico makes observation, suggesting looking role based security, allows define different roles (e.g. anonymous, user, admin, etc.) can use perform rudimentary logic around can in application.

for example: anonymous users can view data cannot create or edit it. authenticated users user role can view, create, , edit content, may further restricted in application being able edit content own. finally, user admin role has unrestricted access view, create, , edit content.

the above example using single database user on backend, associated database connection you've configured.

in addition that, mentioned above , discussed below, can have database user. largely depends on whether want have symfony application have full-or-partial rights. if wanted have user in role of system admin dbas create user , attach database table space or schema, user is not associated symfony application. serves power-user can run external application manage database without being restricted possibly restricted privileges on application database user.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -