2007-01-30

Code Access Security och SharePoint

Mer från Daniel Larson, några riktigt bra artiklar om Code Access Security (CAS) och SharePoint:

Trustworthy Computing, Code Access Security and SharePoint
En inledande diskussion om CAS, med slutsatser och rekommendationer. Obligatorisk läsning för SharePoint-utvecklare. Ett klipp:
Your code should not be trusted to do anything more than you intend it to do. So lock it down with CAS-- run it in minimal trust and apply only the permissions you need for it to run.

The website should be run in WSS_Minimal trust. This includes derived trust levels generated by WSS through explicit permissions set in Solution Manifests.

Your code should apply security demands where appropriate to ensure it isn't used to compromise security. If you've granted a trust level to your assembly, a security demand will enforce that an untrusted assembly isn't using your component as a trusted backdoor.

Web application code (Web Parts) should ALWAYS be installed to the bin directory. Since GAC deployment will place an assembly in the full trust code group for WSS, only run web components (web parts, web services and http hapdlers) from the bin directory.

Security should be auditable. any changes to the CAS security policy should be auditable. If you require permissions for your assembly, you should document it and make it auditable. (This also makes a great argument for some level of shared source code for SharePoint components.)

SharePoint Ajax Toolkit: Code Access Security Case Study
Ett antal best practices (principles) och kodexempel på hur man implementerar väluppfostrad kod ur ett CAS-perspektiv. Bra principer för alla utvecklare som levererar kod som aspirerar på att köras på live server i någon form... Slutsatser och exempel kommer från Daniels SharePoint AJAX Toolkit.

Technorati tags: , , , ,

0 Comments:

Skicka en kommentar

Links to this post:

Skapa en länk

<< Home