WHAT CAN .NET CODE DO FROM WITHIN SQL

WHAT CAN .NET CODE DO FROM WITHIN SQL SERVER SQL Server. Code location evidence means very little for SQL Server assemblies, because .NET code is never loaded from the Internet or the local file system. SQL Server enforces a stronger security policy, using HPAs as well as three levels of security that are declared when the assembly is cataloged. If SQL Server determines that the assembly contains code it shouldn t be allowed to execute, CREATE ASSEMBLY simply fails. The .NET Framework class libraries are the only code loaded from the global assembly cache, and they are subject to strong constraints, which we will discuss shortly. Code access security enforces permission-based security through HPAs at execution time as well. With each access to any resource that requires a permission (such as a file or DNS resolver), the CAS access security inspects the call stack to ensure that every piece of code, up to the original caller, has the appropriate permission. This is known as the stack walk. Between code analysis at create assembly time and the execution-time stack walk, the .NET code access security system and SQL Server s extensions to strengthen it ensure that no code is called that could compromise the stability and security of the system in unforeseen ways. This is a big improvement over pre SQL Server 2005 compiled code, which consisted of extended stored procedures and COM-based components. Code Access Security and .NET Assemblies Because SQL Server controls assembly loading, as well as facets of .NET code execution, it can also assign a custom safety level to an assembly. Safety levels determine what non SQL Server resources .NET assemblies can access. There are three safety levels: SAFE, EXTERNAL_ACCESS, and UNSAFE. These are specified on CREATE ASSEMBLY and changed by using ALTER ASSEMBLY under the control of the database administrator. The different safety levels approximately correspond to the following. SAFE Can access computational .NET classes. Safety is equivalent to a T-SQL procedure. EXTERNAL_ACCESS Can access all code that SAFEmode can and, in addition, items like the file system and other databases through ADO.NET. Approximately equivalent to a T-SQL procedure that can access some of the system extended stored procedures. UNSAFE Can access most (but not all) code in a subset of the FX assemblies. Approximately equivalent to a user-written extended stored procedure without the bad pointer and memory buffer overflow problems.

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Tomcat Web Hosting services

Bookmark the permalink.

Comments are closed.