PC Review


Reply
Thread Tools Rate Thread

Automating .Net Security settings

 
 
Paul Steele
Guest
Posts: n/a
 
      18th Nov 2004
I love programming in C#/.Net, but distributing applications is a real pain.
I never know if the user who might use one of my utilities might have the
proper code permissions to run a network application or access an assembly.
I'm always having to tell new users to go into the .Net Configuration Wizard
and set All_Code to fulltrust, or add a new assembly under Office_Projects.
Is there anyway to eliminate that aspect of .Net? I understand why Microsoft
has incorporated this feature in .Net, but it makes application distribution
a real hassle. Any suggestions on how to get around the problem would be
greatly appreciated.


 
Reply With Quote
 
 
 
 
Richard Blewett [DevelopMentor]
Guest
Posts: n/a
 
      18th Nov 2004
You tell people to set All Code to FullTrust? at the root of the machine policy? are you mad? You've stopped CAS preventing *any* code from doing things it shouldn't (unless the user has modified other policies - which if they are prepared to follow this advice I'd say was unlikely). The whole point of CAS was to limit what code can do on a machine if its not from a trusted source. You know that message box that IE puts up for .exes about them being dangerous when you click on a link to one, well it doesn't do that for .NET executables because their ability is limited by CAS - but hey, not on the machines of the people you've been advising!

Sorry for going in heavy here but if you're going to advise people what to do with their CAS permissions, please make sure you understand what CAS does, why it does it and how it works. What you should do is create an installer utility or MSI that modifies the machine policy to add a codegroup, say under the root of machine, which grants fulltrust to your strong name or URL or whatever identifies your code in such a way that prevents other less trusted code having the ability to do things it shouldn't - or change your app so it can runn OK with partial trust.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

I love programming in C#/.Net, but distributing applications is a real pain.
I never know if the user who might use one of my utilities might have the
proper code permissions to run a network application or access an assembly.
I'm always having to tell new users to go into the .Net Configuration Wizard
and set All_Code to fulltrust, or add a new assembly under Office_Projects.
Is there anyway to eliminate that aspect of .Net? I understand why Microsoft
has incorporated this feature in .Net, but it makes application distribution
a real hassle. Any suggestions on how to get around the problem would be
greatly appreciated.

 
Reply With Quote
 
Paul Steele
Guest
Posts: n/a
 
      18th Nov 2004
I certainly understand the implications of setting things to fulltrust, and
I guess it's bad advice. I may have to look into creating an installer
utility to get around the problem. The main issue is that I write a lot of
system utilities that are simple EXE files and dont' really need an
installer. These utilities are placed on the network for access by helpdesk
staff and they need to be able to run them on any system they happen to be
working on. It would be a big nuisance to have to install these little
utilities on each machine. Perhaps I'm overlooking something obvious...

"Richard Blewett [DevelopMentor]" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> You tell people to set All Code to FullTrust? at the root of the machine
> policy? are you mad? You've stopped CAS preventing *any* code from doing
> things it shouldn't (unless the user has modified other policies - which
> if they are prepared to follow this advice I'd say was unlikely). The
> whole point of CAS was to limit what code can do on a machine if its not
> from a trusted source. You know that message box that IE puts up for .exes
> about them being dangerous when you click on a link to one, well it
> doesn't do that for .NET executables because their ability is limited by
> CAS - but hey, not on the machines of the people you've been advising!
>
> Sorry for going in heavy here but if you're going to advise people what to
> do with their CAS permissions, please make sure you understand what CAS
> does, why it does it and how it works. What you should do is create an
> installer utility or MSI that modifies the machine policy to add a
> codegroup, say under the root of machine, which grants fulltrust to your
> strong name or URL or whatever identifies your code in such a way that
> prevents other less trusted code having the ability to do things it
> shouldn't - or change your app so it can runn OK with partial trust.
>
> Regards
>
> Richard Blewett - DevelopMentor
> http://www.dotnetconsult.co.uk/weblog
> http://www.dotnetconsult.co.uk
>
> I love programming in C#/.Net, but distributing applications is a real
> pain.
> I never know if the user who might use one of my utilities might have the
> proper code permissions to run a network application or access an
> assembly.
> I'm always having to tell new users to go into the .Net Configuration
> Wizard
> and set All_Code to fulltrust, or add a new assembly under
> Office_Projects.
> Is there anyway to eliminate that aspect of .Net? I understand why
> Microsoft
> has incorporated this feature in .Net, but it makes application
> distribution
> a real hassle. Any suggestions on how to get around the problem would be
> greatly appreciated.
>



 
Reply With Quote
 
Richard Blewett [DevelopMentor]
Guest
Posts: n/a
 
      18th Nov 2004
OK, if they are always on the same server, just create a codegroup on all machines with that server given fulltrust via a site based membership condition.

The other alternative is use a file distribution mechanism (like AD Grooup Policy) to set all machine poicy to grant fulltrust to all code and then secure the Enterprise Policy with whatever configuration you require. You can create this on a separate machine and just distribute the enterprisesec.config via a similar file distribution system.

It all depends on how much control you have over the network infrastructure

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

nntp://news.microsoft.com/microsoft.public.dotnet.framework/<(E-Mail Removed)>

I certainly understand the implications of setting things to fulltrust, and
I guess it's bad advice. I may have to look into creating an installer
utility to get around the problem. The main issue is that I write a lot of
system utilities that are simple EXE files and dont' really need an
installer. These utilities are placed on the network for access by helpdesk
staff and they need to be able to run them on any system they happen to be
working on. It would be a big nuisance to have to install these little
utilities on each machine. Perhaps I'm overlooking something obvious...


 
Reply With Quote
 
Richard Blewett [DevelopMentor]
Guest
Posts: n/a
 
      18th Nov 2004
Just thought, assuming you are happy with the concept, you could get the users to set the Inranet Zone code group to the FullTrust permission set. As long as the machine names they are using don't have a dot (".") in their names then this will also work

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

I certainly understand the implications of setting things to fulltrust, and
I guess it's bad advice. I may have to look into creating an installer
utility to get around the problem. The main issue is that I write a lot of
system utilities that are simple EXE files and dont' really need an
installer. These utilities are placed on the network for access by helpdesk
staff and they need to be able to run them on any system they happen to be
working on. It would be a big nuisance to have to install these little
utilities on each machine. Perhaps I'm overlooking something obvious...


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automating Offer-based Remote Assistance settings without using GPO? rosevilleca@gmail.com Windows XP Work Remotely 0 15th Jan 2007 05:43 AM
Errors in File Security settings in Windows XP Security guide security template? arthg@hotmail.com Windows XP Security 1 25th Jan 2006 01:06 AM
Automating Some Settings ndeal Windows XP Setup 0 21st Sep 2005 03:14 PM
Automating settings changes Conan Kelly Windows XP Customization 0 7th Apr 2005 12:20 AM
Automating settings changes Conan Kelly Windows XP General 0 6th Apr 2005 11:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:39 PM.