Stored procedures usually benefit from security. Simplifying the relationship between your application and the database reduces the number of places where errors may occur; errors in code that links business logic to the database are typically security issues. Thus, your database administrator is not mistaken in blocking all stored procedures.
Another advantage of locking the application to stored procedures is that the application stack database connection can have its privileges blocked for certain stored procedure calls, and nothing more.
The advantage of using DBA in the security logic for your application is that the various functions and roles of the applications can be shared in the database prior to representations, so that even if dynamic SQL statements and general choices are needed, the damage from SQL vulnerability can be limited.
The flip side of this, of course, has lost flexibility. Obviously, ORM will evolve faster than constant consistency with the DBA regarding stored procedure parameters. And, as the pressure on these stored procedures grows, it is more likely that the procedures themselves will resort to dynamic SQL, which will be as vulnerable as the application compiled by SQL for attack.
There is a happy middle ground here, and you should try to find it. I recently worked on projects that were saved from the rather terrible problems with SQL injection, because the database administrator carefully configured the database, its connections and stored procedures for "minimal privileges", so that any database user had access only to that what they need to know.
Obviously, when you write SQL code in your application logic, make sure that you consistently use parameterized prepared statements, that you sanitize your input, that you remember internationalized input (there are many ways to specify a single quote over HTTP), and that you remember how your database behaves when inputs are too large for column widths.
tqbf
source share