SlideShare una empresa de Scribd logo
1 de 21
SandBoxed Solution



Shakir Majeed Khan
http://sharepointtechies.wordpress.com/
MySelf
http://junooni.wordpress.com/
shakir.majeed@gmail.com
www.facebook.com/shakir.majeed

      User Group Leader of
      SharePoint Techies,
      Working independently on
      SharePoint technologies.
      Trainer for Microsoft Office
      SharePoint Server
      2007 and Window
      SharePoint Services 3.0 at
      AUC Technologies.
Outline
  Application Hosting and Customization
  Introducing Sandboxed Solutions
  Executing Code in the Sandbox
  Sandbox Resource Monitoring
Application Hosting and
Customization
SharePoint 3.0‟s Challenge
  Developers build           Developer
  custom solutions
                               Design, build, and
  Administrators can           test customizations
  only secure solutions
  with CAS                   Administrator
   Hard to control what is
                               Install and monitor
   being done in custom        customizations
   code
  Biggest cause of           Site Collection Owner
  SharePoint support
  cases: custom code           Activate and use customizations
SharePoint 2010 Approach
 Developers build                   Developer
 custom solutions
                                      Design, build, and
 Site collection owners               test customizations
 deploy, activate and
 implement the                      Administrator
 customizations
                                      Monitor customizations
 Administrators
 leverage resource
 monitors to check site             Site Collection Owner
 collection usage
                                      Deploy, activate and use
    Automatic triggers “turn off”
    custom solutions in a site        customizations
    collection that are too
    expensive and taxing on the
    server
Introducing Sandboxed
Solutions
Sandboxed Solutions
 Allow a subset of „full‟ solution
 features

 Code executes in sandbox

 Are deployed by a Site Collection
 administrator

 Stored in the Solution Gallery
Introducing Sandboxed Solutions
  Sandboxed solution: site collection owners can
  upload to SharePoint
    Empowers site collection owners to deploy new
    functionality w/o involvement of IT
      Local/remote development options
    Self-regulating and monitored by IT
      Limited set of permissions & functionality
      Resource quotas established & monitored by IT
    Secure: site collection owner is in control
Sandboxed Solutions Help
Enterprises
 Sandboxed solutions are important because
   Solve SharePoint hosting issues in corporate
   environments
   Hosted environments much easier to manage
 Reduces time to deploying custom solutions
   Removing process of getting code approved and
   deployed by IT
 Improves stability of SharePoint servers
   Now badly performing code isolated to site collection
   rather than potentially bringing down an entire server
Overview of the Sandbox
 Allows a subset of the full capabilities
 in the SharePoint API
 Secure – enforcing the sandbox
   Execute in a partially trusted environment
   Code executes in a special service process
   Subject to CAS
   Validation framework
      Provides way to do custom farm wide validation for the
      deployed packages
   Each solution is isolated to its site collection
Sandboxed Solution Lifecycle
Installation
• Upload into Solution Gallery
• Solution is validated upon installation


     Activation
     • Auto-activates features


           Deactivation
           • Inert operation, extended by developer
           • Web Parts no longer execute



                 Deletion
Sandboxed Solution Elements

 Web Parts
 Lists
 List Templates
 Custom Actions
 Workflows
 Event Receivers
 Content Types
 Site Columns
 …
Installing & Running
Sandboxed Solution
Executing Code in the
Sandbox
Sandboxed Solutions Process

                   Root SPWeb of SPSite           Per-WFE AssemblyCache
               1
                   Solution gallery 2     5        <siteguid>company.
WebParts.wsp
                                                   intranet.webpart.wsp
                   Web Part gallery                company.intranet.dll


                                                                      6
                                              4


                                                    Sandboxed Code
                                                    Serice
               3
                                          7
The Subset Object Model
 In general
                           SPSite
   SPSite and below


 No SPSecurity             SPWeb

 No SPSite construction
                           SPList



                          SPListItem
Sandbox and Code Access Security
                                   AspNetHostingPermission, Level=Minimal
                                   SharePointPermission, ObjectModel=true
        Sandbox                    SecurityPermission, Flags=Execution

             My.dll                              User Code


 Other.dll        System DLL               wss_usercode.config

     SharePoint                              Framework Code
        DLL


                                                 Full Trust




                               SharePoint OM
      API Block List
Compiling vs. Executing Sandboxed
Solutions
 Visual Studio 2010                          MyWebPart.dll
                                                                      Runtime
 uses IntelliSense to
 hide full-trust types
 All code is compiled      Full Object Model               Subset Object Model
 against the full API
 Thus, no “sandbox”                                               Proxy

 check at compile time…
 only at runtime
 Workaround: change the Microsoft.SharePoint.dll project
 reference to reference the sandbox‟s version
     [..]14UserCodeAssembliesMicrosoft.SharePoint.dll
     NOTE: Switch it back before deployment!
        Use this as a temporary test - do not deploy code that
        references the sandbox‟s assembly
Creating a Sandboxed
 Solution with VS 2010


Demo
Thank You
Facebook: http://www.facebook.com/shakir.majeed
Blog: http://junooni.wordpress.com/
Email: shakir.majeed@gmail.com

Más contenido relacionado

La actualidad más candente

Do not disturb my circles! Secure Application Isolation with OSGi - Mirko Jah...
Do not disturb my circles! Secure Application Isolation with OSGi - Mirko Jah...Do not disturb my circles! Secure Application Isolation with OSGi - Mirko Jah...
Do not disturb my circles! Secure Application Isolation with OSGi - Mirko Jah...
mfrancis
 

La actualidad más candente (20)

OWASP Portland - OWASP Top 10 For JavaScript Developers
OWASP Portland - OWASP Top 10 For JavaScript DevelopersOWASP Portland - OWASP Top 10 For JavaScript Developers
OWASP Portland - OWASP Top 10 For JavaScript Developers
 
Injecting Security into Web apps at Runtime Whitepaper
Injecting Security into Web apps at Runtime WhitepaperInjecting Security into Web apps at Runtime Whitepaper
Injecting Security into Web apps at Runtime Whitepaper
 
Tuning abap with hardware mechanics
Tuning abap with hardware mechanicsTuning abap with hardware mechanics
Tuning abap with hardware mechanics
 
Do not disturb my circles! Secure Application Isolation with OSGi - Mirko Jah...
Do not disturb my circles! Secure Application Isolation with OSGi - Mirko Jah...Do not disturb my circles! Secure Application Isolation with OSGi - Mirko Jah...
Do not disturb my circles! Secure Application Isolation with OSGi - Mirko Jah...
 
Implementing application security using the .net framework
Implementing application security using the .net frameworkImplementing application security using the .net framework
Implementing application security using the .net framework
 
LinuxCon Europe 2012 - Tizen Mini Summit
LinuxCon Europe 2012 - Tizen Mini Summit LinuxCon Europe 2012 - Tizen Mini Summit
LinuxCon Europe 2012 - Tizen Mini Summit
 
AppSec Tel Aviv - OWASP Top 10 For JavaScript Developers
AppSec Tel Aviv - OWASP Top 10 For JavaScript Developers AppSec Tel Aviv - OWASP Top 10 For JavaScript Developers
AppSec Tel Aviv - OWASP Top 10 For JavaScript Developers
 
6. Analyzing Android Applications Part 2
6. Analyzing Android Applications Part 26. Analyzing Android Applications Part 2
6. Analyzing Android Applications Part 2
 
CNIT 128 8. Android Implementation Issues (Part 2)
CNIT 128 8. Android Implementation Issues (Part 2)CNIT 128 8. Android Implementation Issues (Part 2)
CNIT 128 8. Android Implementation Issues (Part 2)
 
SecDevOps - The Operationalisation of Security
SecDevOps -  The Operationalisation of SecuritySecDevOps -  The Operationalisation of Security
SecDevOps - The Operationalisation of Security
 
What's new in Android M
What's new in Android MWhat's new in Android M
What's new in Android M
 
Dark Side of iOS [SmartDevCon 2013]
Dark Side of iOS [SmartDevCon 2013]Dark Side of iOS [SmartDevCon 2013]
Dark Side of iOS [SmartDevCon 2013]
 
SharePoint 2010 Development for ASP.NET Developers - Tyson Devcon 2010
SharePoint 2010 Development for ASP.NET Developers - Tyson Devcon 2010SharePoint 2010 Development for ASP.NET Developers - Tyson Devcon 2010
SharePoint 2010 Development for ASP.NET Developers - Tyson Devcon 2010
 
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3)
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3)CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3)
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3)
 
iOS Application Security
iOS Application SecurityiOS Application Security
iOS Application Security
 
Обмен учетными данными между iOS 8 приложениями и вебом, Константин Чернухо, ...
Обмен учетными данными между iOS 8 приложениями и вебом, Константин Чернухо, ...Обмен учетными данными между iOS 8 приложениями и вебом, Константин Чернухо, ...
Обмен учетными данными между iOS 8 приложениями и вебом, Константин Чернухо, ...
 
OWASP SF - Reviewing Modern JavaScript Applications
OWASP SF - Reviewing Modern JavaScript ApplicationsOWASP SF - Reviewing Modern JavaScript Applications
OWASP SF - Reviewing Modern JavaScript Applications
 
Pentesting iOS Applications
Pentesting iOS ApplicationsPentesting iOS Applications
Pentesting iOS Applications
 
Paris FOD meetup - kafka security 101
Paris FOD meetup - kafka security 101Paris FOD meetup - kafka security 101
Paris FOD meetup - kafka security 101
 
Pentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and ManipulationPentesting iOS Apps - Runtime Analysis and Manipulation
Pentesting iOS Apps - Runtime Analysis and Manipulation
 

Similar a STUG-Sand boxed Solution

Mostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best Practices
Mostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best PracticesMostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best Practices
Mostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best Practices
SharePoint Saturday NY
 
SharePoint Sandboxed Solutions and InfoPath - TechEd Middle East
SharePoint Sandboxed Solutions and InfoPath - TechEd Middle EastSharePoint Sandboxed Solutions and InfoPath - TechEd Middle East
SharePoint Sandboxed Solutions and InfoPath - TechEd Middle East
Ayman El-Hattab
 
Playing in the SharePoint SandBox
Playing in the SharePoint SandBoxPlaying in the SharePoint SandBox
Playing in the SharePoint SandBox
Toni Frankola
 
Acing application lifecycle management in SharePoint
Acing application lifecycle management in SharePointAcing application lifecycle management in SharePoint
Acing application lifecycle management in SharePoint
Jeremy Thake
 

Similar a STUG-Sand boxed Solution (20)

Mostafa Elzoghbi: SharePoint 2010 Sanbbox Solutions bestpractices - public
Mostafa Elzoghbi: SharePoint 2010 Sanbbox Solutions bestpractices - publicMostafa Elzoghbi: SharePoint 2010 Sanbbox Solutions bestpractices - public
Mostafa Elzoghbi: SharePoint 2010 Sanbbox Solutions bestpractices - public
 
Mostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best Practices
Mostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best PracticesMostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best Practices
Mostafa Elzoghbi: SharePoint 2010 Sandbox Solutions Best Practices
 
Diff sand box and farm
Diff sand box and farmDiff sand box and farm
Diff sand box and farm
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
 
SharePoint Sandboxed Solutions and InfoPath - TechEd Middle East
SharePoint Sandboxed Solutions and InfoPath - TechEd Middle EastSharePoint Sandboxed Solutions and InfoPath - TechEd Middle East
SharePoint Sandboxed Solutions and InfoPath - TechEd Middle East
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hour
Convert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hourConvert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hour
Convert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hour
 
Best Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsBest Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point Solutions
 
Developing Sandbox Solutions
Developing Sandbox SolutionsDeveloping Sandbox Solutions
Developing Sandbox Solutions
 
Community Tour Bologna
Community Tour BolognaCommunity Tour Bologna
Community Tour Bologna
 
Playing in the SharePoint SandBox
Playing in the SharePoint SandBoxPlaying in the SharePoint SandBox
Playing in the SharePoint SandBox
 
Sharepoint Online
Sharepoint OnlineSharepoint Online
Sharepoint Online
 
SharePoint Development with Visual Studio 2012
SharePoint Development with Visual Studio 2012SharePoint Development with Visual Studio 2012
SharePoint Development with Visual Studio 2012
 
Real World SharePoint Framework and Azure Services
Real World SharePoint Framework and Azure ServicesReal World SharePoint Framework and Azure Services
Real World SharePoint Framework and Azure Services
 
SharePoint Development For Asp Net Developers
SharePoint Development For Asp Net DevelopersSharePoint Development For Asp Net Developers
SharePoint Development For Asp Net Developers
 
Creating personalized cross platform mobile apps with the Sitecore Mobile SDK
Creating personalized cross platform mobile apps with the Sitecore Mobile SDKCreating personalized cross platform mobile apps with the Sitecore Mobile SDK
Creating personalized cross platform mobile apps with the Sitecore Mobile SDK
 
How to build a Oracle cloud adapter SOA, Integration & API's
How to build a Oracle cloud adapter  SOA, Integration & API'sHow to build a Oracle cloud adapter  SOA, Integration & API's
How to build a Oracle cloud adapter SOA, Integration & API's
 
How to build a cloud adapter
How to build a cloud adapterHow to build a cloud adapter
How to build a cloud adapter
 
Micro-Frontends JSVidCon
Micro-Frontends JSVidConMicro-Frontends JSVidCon
Micro-Frontends JSVidCon
 
Acing application lifecycle management in SharePoint
Acing application lifecycle management in SharePointAcing application lifecycle management in SharePoint
Acing application lifecycle management in SharePoint
 
Evolution of VS code Java ecosystem
Evolution of VS code Java ecosystemEvolution of VS code Java ecosystem
Evolution of VS code Java ecosystem
 

Más de Shakir Majeed Khan

Sharepoint Saturday India Online best practice for developing share point sol...
Sharepoint Saturday India Online best practice for developing share point sol...Sharepoint Saturday India Online best practice for developing share point sol...
Sharepoint Saturday India Online best practice for developing share point sol...
Shakir Majeed Khan
 
Stug -Sir Syed University On Location-Live Event
Stug -Sir Syed University On Location-Live EventStug -Sir Syed University On Location-Live Event
Stug -Sir Syed University On Location-Live Event
Shakir Majeed Khan
 
Sharepoint developement tools(webparts+worflows) EBizSoft
Sharepoint developement tools(webparts+worflows) EBizSoftSharepoint developement tools(webparts+worflows) EBizSoft
Sharepoint developement tools(webparts+worflows) EBizSoft
Shakir Majeed Khan
 
SharePoint 2010 and Changing Business Needs-MAJU 2011
SharePoint 2010 and Changing Business Needs-MAJU 2011SharePoint 2010 and Changing Business Needs-MAJU 2011
SharePoint 2010 and Changing Business Needs-MAJU 2011
Shakir Majeed Khan
 
STUG-Client Object Model SharePoint 2010
STUG-Client Object Model SharePoint 2010STUG-Client Object Model SharePoint 2010
STUG-Client Object Model SharePoint 2010
Shakir Majeed Khan
 
Share pointtechies linqtosp-andsbs
Share pointtechies linqtosp-andsbsShare pointtechies linqtosp-andsbs
Share pointtechies linqtosp-andsbs
Shakir Majeed Khan
 
SPS- Share Point 2010 and Windows Azure
SPS- Share Point 2010 and Windows AzureSPS- Share Point 2010 and Windows Azure
SPS- Share Point 2010 and Windows Azure
Shakir Majeed Khan
 
STUG- SharePoint 2010 for ASP.net Devs
STUG- SharePoint 2010 for ASP.net DevsSTUG- SharePoint 2010 for ASP.net Devs
STUG- SharePoint 2010 for ASP.net Devs
Shakir Majeed Khan
 
SharePoint 2010 and its development tools
SharePoint 2010 and its development toolsSharePoint 2010 and its development tools
SharePoint 2010 and its development tools
Shakir Majeed Khan
 

Más de Shakir Majeed Khan (15)

Sharepoint Saturday India Online best practice for developing share point sol...
Sharepoint Saturday India Online best practice for developing share point sol...Sharepoint Saturday India Online best practice for developing share point sol...
Sharepoint Saturday India Online best practice for developing share point sol...
 
Stug -Sir Syed University On Location-Live Event
Stug -Sir Syed University On Location-Live EventStug -Sir Syed University On Location-Live Event
Stug -Sir Syed University On Location-Live Event
 
AUC Tech-SP 2010
AUC Tech-SP 2010AUC Tech-SP 2010
AUC Tech-SP 2010
 
Sharepoint developement tools(webparts+worflows) EBizSoft
Sharepoint developement tools(webparts+worflows) EBizSoftSharepoint developement tools(webparts+worflows) EBizSoft
Sharepoint developement tools(webparts+worflows) EBizSoft
 
SharePoint 2010 and Changing Business Needs-MAJU 2011
SharePoint 2010 and Changing Business Needs-MAJU 2011SharePoint 2010 and Changing Business Needs-MAJU 2011
SharePoint 2010 and Changing Business Needs-MAJU 2011
 
STUG-Client Object Model SharePoint 2010
STUG-Client Object Model SharePoint 2010STUG-Client Object Model SharePoint 2010
STUG-Client Object Model SharePoint 2010
 
Share pointtechies linqtosp-andsbs
Share pointtechies linqtosp-andsbsShare pointtechies linqtosp-andsbs
Share pointtechies linqtosp-andsbs
 
SPS- Share Point 2010 and Windows Azure
SPS- Share Point 2010 and Windows AzureSPS- Share Point 2010 and Windows Azure
SPS- Share Point 2010 and Windows Azure
 
SharePoint 2010- Changing business needs
SharePoint 2010- Changing business needsSharePoint 2010- Changing business needs
SharePoint 2010- Changing business needs
 
STUG- SharePoint 2010 for ASP.net Devs
STUG- SharePoint 2010 for ASP.net DevsSTUG- SharePoint 2010 for ASP.net Devs
STUG- SharePoint 2010 for ASP.net Devs
 
FCPakistan: a case study
FCPakistan: a case studyFCPakistan: a case study
FCPakistan: a case study
 
SharePoint 2010 and its development tools
SharePoint 2010 and its development toolsSharePoint 2010 and its development tools
SharePoint 2010 and its development tools
 
Microsoft SharePoint Server 2010-STUG- DCS-KU 9 feb live and on location
Microsoft SharePoint Server 2010-STUG- DCS-KU 9 feb live and on locationMicrosoft SharePoint Server 2010-STUG- DCS-KU 9 feb live and on location
Microsoft SharePoint Server 2010-STUG- DCS-KU 9 feb live and on location
 
Stug-paf kiet 28 january live and on location-Enterprise Content Management
Stug-paf kiet 28 january live and on location-Enterprise Content Management Stug-paf kiet 28 january live and on location-Enterprise Content Management
Stug-paf kiet 28 january live and on location-Enterprise Content Management
 
Sharepoint introanddevelopementtools
Sharepoint introanddevelopementtoolsSharepoint introanddevelopementtools
Sharepoint introanddevelopementtools
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

STUG-Sand boxed Solution

  • 1. SandBoxed Solution Shakir Majeed Khan http://sharepointtechies.wordpress.com/
  • 2. MySelf http://junooni.wordpress.com/ shakir.majeed@gmail.com www.facebook.com/shakir.majeed User Group Leader of SharePoint Techies, Working independently on SharePoint technologies. Trainer for Microsoft Office SharePoint Server 2007 and Window SharePoint Services 3.0 at AUC Technologies.
  • 3. Outline Application Hosting and Customization Introducing Sandboxed Solutions Executing Code in the Sandbox Sandbox Resource Monitoring
  • 5. SharePoint 3.0‟s Challenge Developers build Developer custom solutions Design, build, and Administrators can test customizations only secure solutions with CAS Administrator Hard to control what is Install and monitor being done in custom customizations code Biggest cause of Site Collection Owner SharePoint support cases: custom code Activate and use customizations
  • 6. SharePoint 2010 Approach Developers build Developer custom solutions Design, build, and Site collection owners test customizations deploy, activate and implement the Administrator customizations Monitor customizations Administrators leverage resource monitors to check site Site Collection Owner collection usage Deploy, activate and use Automatic triggers “turn off” custom solutions in a site customizations collection that are too expensive and taxing on the server
  • 8. Sandboxed Solutions Allow a subset of „full‟ solution features Code executes in sandbox Are deployed by a Site Collection administrator Stored in the Solution Gallery
  • 9. Introducing Sandboxed Solutions Sandboxed solution: site collection owners can upload to SharePoint Empowers site collection owners to deploy new functionality w/o involvement of IT Local/remote development options Self-regulating and monitored by IT Limited set of permissions & functionality Resource quotas established & monitored by IT Secure: site collection owner is in control
  • 10. Sandboxed Solutions Help Enterprises Sandboxed solutions are important because Solve SharePoint hosting issues in corporate environments Hosted environments much easier to manage Reduces time to deploying custom solutions Removing process of getting code approved and deployed by IT Improves stability of SharePoint servers Now badly performing code isolated to site collection rather than potentially bringing down an entire server
  • 11. Overview of the Sandbox Allows a subset of the full capabilities in the SharePoint API Secure – enforcing the sandbox Execute in a partially trusted environment Code executes in a special service process Subject to CAS Validation framework Provides way to do custom farm wide validation for the deployed packages Each solution is isolated to its site collection
  • 12. Sandboxed Solution Lifecycle Installation • Upload into Solution Gallery • Solution is validated upon installation Activation • Auto-activates features Deactivation • Inert operation, extended by developer • Web Parts no longer execute Deletion
  • 13. Sandboxed Solution Elements Web Parts Lists List Templates Custom Actions Workflows Event Receivers Content Types Site Columns …
  • 15. Executing Code in the Sandbox
  • 16. Sandboxed Solutions Process Root SPWeb of SPSite Per-WFE AssemblyCache 1 Solution gallery 2 5 <siteguid>company. WebParts.wsp intranet.webpart.wsp Web Part gallery company.intranet.dll 6 4 Sandboxed Code Serice 3 7
  • 17. The Subset Object Model In general SPSite SPSite and below No SPSecurity SPWeb No SPSite construction SPList SPListItem
  • 18. Sandbox and Code Access Security AspNetHostingPermission, Level=Minimal SharePointPermission, ObjectModel=true Sandbox SecurityPermission, Flags=Execution My.dll User Code Other.dll System DLL wss_usercode.config SharePoint Framework Code DLL Full Trust SharePoint OM API Block List
  • 19. Compiling vs. Executing Sandboxed Solutions Visual Studio 2010 MyWebPart.dll Runtime uses IntelliSense to hide full-trust types All code is compiled Full Object Model Subset Object Model against the full API Thus, no “sandbox” Proxy check at compile time… only at runtime Workaround: change the Microsoft.SharePoint.dll project reference to reference the sandbox‟s version [..]14UserCodeAssembliesMicrosoft.SharePoint.dll NOTE: Switch it back before deployment! Use this as a temporary test - do not deploy code that references the sandbox‟s assembly
  • 20. Creating a Sandboxed Solution with VS 2010 Demo
  • 21. Thank You Facebook: http://www.facebook.com/shakir.majeed Blog: http://junooni.wordpress.com/ Email: shakir.majeed@gmail.com

Notas del editor

  1. The product SharePoint releasesthe burden on IT departments by allowing end-users to be manage the information structure. This is an important part to the success of SharePoint, the core concept of sites, lists and libraries and provisioning. However, the real value lies in the customizations that enable you to maximize the potential that sits in the templates provided by SharePoint. In SharePoint 2007 you still need IT to install and maintain these customizations. This slows down business and impacts IT unnecessarily.
  2. SharePoint 2010 allows customizations to be deployed and maintained at the site collection level. Increasing agility while releasing burden on IT.Of course there is still IT involvement, but mainly when things go wrong (such as excessive resource usage).
  3. A SharePoint solution has two sides to it. The declarative CAML used to create many components such as list templates and content-types, and The code side in workflow, event receivers or Web Parts. Sandboxed solutions can contain all these elements. The solutions are deployed to a special gallery which sits under _catalog like the other built-in galleries.
  4. Sandboxed solutions allow admins allow more custom code deployment flexibility by site collection owners, at the same time putting up guards to protect the server
  5. Site collections are empowered to deploy custom code that will run within a sandbox thus not hurt the system; no longer need to get admins involved in deployment
  6. The way people install and interact with a sandboxed solution is similar to normal solutions, but automated a bit. Important concept to hit is the fact that solutions get validated before they are allowed to be installed, and that you can extend this validation. After installation the solution is activated, which auto-activates features. Deactivation is a different story. The main thing that is visible are Web Parts executing from the sandbox. They will no longer execute. If you re-activate the solution the Web Parts will start executing again. You can change the behavior using feature receivers.
  7. Generally you can do most things you can with full solutions, at least those within the context of a site collection. You cannot deploy files on disc or assemblies to the GAC.
  8. This chronicles the process of using a custom &quot;bugs&quot; Web Part and solution in a particular site.The SPSite adminuploads a new solution package (*.wsp) into the Solution Gallery of the SPSite. The SPSite admin&quot;activates&quot; the solution.  This activates the features within the solution.  Web Part files are copied into the Web Part gallery.As part of the activation, solution is validated using the validation framework. Custom validator can be added for example to check that only solutions signed with certain key can be activated. Customers and partners can develop their own validators based on their needs.Some time later, a user decides to add a Web Part to their home page.  They go into Web Part edit mode, and click &quot;Add a Web Part&quot;.  They notice the additional Web Part options, and click Add. SharePoint now checks to see if the bugs.dll file, which backs this Web Part, is installed into the assembly cache.  It is not. The assembly is faulted into the assembly cache; it is extracted and copied from the solution file to temporary folder in disk and loaded to memory (disk is cleaned immediately). Now the Web Part is about to be used. It is loaded into Sandbox Code service host.Processes deliver the Web Part to be executed to the service.
  9. This slide discusses the capabilities of the subset object model. The Subset Object model is a subset of the full SharePoint 2010 Object Model and is made available to code executing within the security sandbox. Generally the Subset OM contains classes for content below the SPSite, except for security sensitive classes such as auditing and SPSecurity.Visual Studio 2010 filters IntelliSense based on whether you develop a full-trust or sandboxed solution.
  10. Code is executed in a sandbox protected through CAS. There are two general policies. The first applies to Microsoft SharePoint DLLs, giving them full-trust (including the Subset OM), The other applies to all other code. You are given very strict permissions.In order to shield from lurking dangers in the SharePoint object model, SharePoint has a concept of a API Block List that allows further restrictions on the APIs a sandboxed piece of code can call.
  11. Visual Studio 2010 prompts developer is solution is full/sandbox… this simply sets a bit in the *.csproj.user file.This tells VS to use a specific IntelliSense file that includes the subset of what you can use.However, developers can still type the blocked calls, such as SPSecurity.RunWithElevatedPrivlidges(), and successfully copile.At runtime the link will be resolved against either the subset object model, or against the full object model depending on the type of solution. Calls to SPSecurity will fail at runtime when you are sandboxed. This can be a challenge for developers who copy-paste code samples from what should be full trusted solutions, or upgrading existing projects.WHY? Only at RUNTIME will users find out they can’t do specific things because there is no COMPILETIME checkWORKAROUND: change the Microsoft.SharePoint.dll project reference to use the sandbox proxy assembly: [..]\\14\\UserCode\\Assemblies\\Microsoft.SharePoint.dllNOTE: do not deploy code referenced against this assembly… the workaround should only be a check &amp; temporary.