11.07.2015 Views

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 14: Building Secure Data Access 381Figure 14.3 summarizes the authorization points <strong>and</strong> techniques that should be used.Data Access AuthorizationPrincipal permission dem<strong>and</strong>s<strong>and</strong>/orIdentity permission dem<strong>and</strong>sSQL Server<strong>Application</strong>Data AccessCodeLogin AccountSQL LoginDatabase UserDatabase RoleDatabase AuthorizationRestricted access to stored proceduresStored ProcsTables <strong>and</strong>ViewsFigure 14.3Data access authorization, assembly, <strong>and</strong> databaseNotice how the data access code can use permission dem<strong>and</strong>s to authorize the callinguser or the calling code. Code identity dem<strong>and</strong>s are a feature of .NET code accesssecurity.To authorize the application in the database, use a least privileged SQL server loginthat only has permission to execute selected stored procedures. Unless there arespecific reasons, the application should not be authorized to perform create, retrieve,update, destroy/delete (CRUD) operations directly on any table.Note Stored procedures run under the security context of the database system. Although you canconstrain the logical operations of an application by assigning it permissions to particular storedprocedures, you cannot constrain the consequences of the operations performed by the storedprocedure. Stored procedures are trusted code. The interfaces to the stored procedures must besecured using database permissions.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!