HighTechTalks DotNet Forums  

.NET Assembly permissions

Dotnet Security microsoft.public.dotnet.security


Discuss .NET Assembly permissions in the Dotnet Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Nick Goloborodko
 
Posts: n/a

Default .NET Assembly permissions - 02-20-2005 , 07:49 AM






Hi,

I am in the process of working on ASP.NET web control. Basically the control
is just a timer which after a certain timespan posts the page back to
server. It is now functionally complete, and as good coding practice i ran
FxCop on the assembly.

Im a relative newbie in .NET, espacially when it comes to subjects like
security, which previously i just tended to ignore because it was
non-essential for a functionally complete product.

FxCop complained that Assemblies should declare minimum security. At the
moment im looking for a quick fix, so what should a security permissions of
such assembly be?

Kind regards,
nick Goloborodko

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default RE: .NET Assembly permissions - 02-25-2005 , 08:37 PM






If you want the quick fix, then you could do a minimum request for
FullTrust.

[assembly: PermissionSet(SecurityAction.RequestMinimum, Unrestricted=true)]

Which will prevent your assembly from loading if its not going to be fully
trusted; this should work fine by default on the server side. If you're
deploying to the client side, then adding this permission will prevent your
assembly from loading. (More on assembly-level declarative security here:
http://blogs.msdn.com/shawnfa/archiv...0/222918.aspx).

If this is a client-side control, you'll need to start with the Internet
permission set, which will be quite a few more attributes. (caspol -lp and
then search for the Internet set to get an idea.) At the very least you'll
need:

[assembly: SecurityPermission(SecurityAction.RequestMinimum,
SecurityAction.Execution)]

You could start from there, and then work your way up as you encounter
security exceptions.

-Shawn
http://blogs.msdn.com/shawnfa
--
This posting is provided "AS IS" with no warranties, and confers no rights.


Note:
For the benefit of the community-at-large, all responses to this message
are best directed to the newsgroup/thread from which they originated.
--------------------
Quote:
From: Nick Goloborodko <coolbest (AT) paradise (DOT) net.nz
Subject: .NET Assembly permissions
Followup-To: microsoft.public.dotnet.framework.aspnet.security
Reply-To: coolbest (AT) paradise (DOT) net.nz
Date: Mon, 21 Feb 2005 01:49:18 +1300
Lines: 17
User-Agent: KNode/0.7.6
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
Message-ID: <eU8H#p0FFHA.3384 (AT) tk2msftngp13 (DOT) phx.gbl
Newsgroups:
microsoft.public.dotnet.framework.aspnet.security, microsoft.public.dotnet.se
curity
Quote:
NNTP-Posting-Host: 202-0-63-3.adsl.paradise.net.nz 202.0.63.3
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSF TNGP08.phx.gbl!tk2msftngp1
3.phx.gbl
Quote:
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.security:9157
microsoft.public.dotnet.framework.aspnet.security: 13329
X-Tomcat-NG: microsoft.public.dotnet.security

Hi,

I am in the process of working on ASP.NET web control. Basically the
control
is just a timer which after a certain timespan posts the page back to
server. It is now functionally complete, and as good coding practice i ran
FxCop on the assembly.

Im a relative newbie in .NET, espacially when it comes to subjects like
security, which previously i just tended to ignore because it was
non-essential for a functionally complete product.

FxCop complained that Assemblies should declare minimum security. At the
moment im looking for a quick fix, so what should a security permissions
of
such assembly be?

Kind regards,
nick Goloborodko



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.