What security benefits are provided by using stored procedures to access data?

后端 未结 9 1127
臣服心动
臣服心动 2021-02-07 20:52

I have seen some guidance which recommends that you secure a database by layering all data access through stored procedures.

I know that for SQL Server, you can secure t

9条回答
  •  无人及你
    2021-02-07 21:18

    You might not want to give Matt carte-blanc to update certain tables or columns directly. What if Matt decided to do this:

    UPDATE Person.Address SET AddressLine1 = NULL
    

    Whoops. Matt forgot the WHERE clause and just hosed your database. Or maybe Matt just got pissed at his boss and has decided to quit at the end of the day. Or maybe Matt's password isn't as secure as it should have been and now a hacker has it.

    This is just one simple example. Control over tables and columns could become much more complex and might be untenable through anything other than stored procedures.

提交回复
热议问题