+ All Categories
Home > Technology > Implementing Partial Trust In Share Point

Implementing Partial Trust In Share Point

Date post: 05-Dec-2014
Category:
Upload: corey-roth
View: 2,806 times
Download: 0 times
Share this document with a friend
Description:
Slides from my talk at Tulsa School of Dev about Implementing partially trusted code using code access security policies in SharePoint.
16
Implemting Partial Trust in SharePoint Presenter: Corey Roth Enterprise Consultant Stonebridge Blog: www.dotnetmafia.com
Transcript
Page 1: Implementing Partial Trust In Share Point

Implemting Partial Trust in SharePoint

Presenter: Corey RothEnterprise ConsultantStonebridge

Blog: www.dotnetmafia.com

Page 2: Implementing Partial Trust In Share Point

Corey Roth

Consultant for Stonebridge Worked in Consumer Electronics, Travel, Advertising,

and Energy industries Currently doing MOSS development specializing in

Enterprise Search and ECM OSU Graduate Microsoft Award for Customer Excellence (ACE)

Winner E-mail: [email protected] Blog: www.dotnetmafia.com (mirrored on

sharepointblogs.com)

Page 3: Implementing Partial Trust In Share Point

Beer and Code Meetup Tonight!

Tonight at Dirty Tavern (325 W 2nd) around 6pm after TechFest

Come talk with other IT professionals about .NET, C#, Agile, SharePoint, Ruby and more

Downtown – Just minutes from TechFest

Now you have something to do tonight!

Page 4: Implementing Partial Trust In Share Point

SharePint – A SharePoint Meetup

Next Thursday at Crawpappy’s (51st and Harvard)

Come talk with other SharePoint developers in a casual setting

Great place to talk to others about best practices and your latest SharePoint issues

No presentations or slides Not a User Group All are welcome!

Page 5: Implementing Partial Trust In Share Point

What is Partial Trust?

Page 6: Implementing Partial Trust In Share Point

Why use Partial Trust More Secure Doesn’t require giving every

deployed DLL full trust Allows deployment of assemblies

to bin folder Deployment doesn’t require an

Application Pool reset

Page 7: Implementing Partial Trust In Share Point

Demo

Page 8: Implementing Partial Trust In Share Point

Implementing Partial Trust

Add [Assembly: AllowParitallyTrustedCallers()] to AssemblyInfo.cs

Set <trust Level=“Minimal” originUrl=“” /> in web.config

Define Security Policy in Trust configuration file

Security policy can be deployed via solution package (.wsp)

Install solution files with –allowCasPolicies parameter

Page 9: Implementing Partial Trust In Share Point

Demo

Page 10: Implementing Partial Trust In Share Point

What the Solution Package does…

Backs up your web.config Changes the trust element to WSS_Custom

in web.config Backs up trust configuration file –

wss_minimaltrust.config becomes wss_custom_wss_minimaltrust.config

Changes the path to the trust configuration file in the web.config <trustLevel> element

Adds code access security settings from manifest.xml

Page 11: Implementing Partial Trust In Share Point

<CodeAccessSecurity>

Element in trust configuration file that defines which CAS Policies apply to each assembly

<IPermission> element defines individual rights to resources such as ASP.NET, SharePoint, EventLog, Configuration, SQL Server, File I/O

Can be copied to configuration file manually or deployed via solution package (wsp)

<IPermission class="Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" version="1" ObjectModel="True" />

Page 12: Implementing Partial Trust In Share Point

<IPermission>

AspNetHostingPermission (Level=“Minimal”) – Required for ASP.NET Controls

SharePointPermission (ObjectModel=“True”) – Required to use SharePoint API

FileIOPermission (Read, Write, PathDiscovery, Append) – Specifies files the code can access - $AppDir$ by default

SqlClientPermission – Required to access SQL Server

ReflectionPermission – Required for LINQ SecurityPermission – Required for most basic

operations EnvironmentPermission – Provides access to

environment variables

Page 13: Implementing Partial Trust In Share Point

What requires Full Trust? Item Event Receivers Timer Jobs STSADM Commands

Page 14: Implementing Partial Trust In Share Point

Questions?

Page 15: Implementing Partial Trust In Share Point

Don’t Forget!

Beer and Code Meetup Tonight at Dirty’s Tavern (325 E 2nd)

SharePint Meetup – This Thursday October 16th at Crawpappy’s (51st and Harvard) at 6pm


Recommended