473,473 Members | 2,236 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Trusting an assembly configuration

I develop software (.NET) with strong name that needs to access network
drives by default.
Is there any way to make sure that this program have network access without
forcing the user to manually add this strong key to be trusted more?
And not to globally trust all .NET applications by default?

You know, to avoid the "Control panel/ Administrative Tools/ Microsoft .NET
Framework Wizards/ Trust an assembly", but during setup automatic configured
instead.

It appears that our users have problems setting up this trust.
Nov 16 '05 #1
3 2204
HI
you can set these security configurations on your assambly manifist
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #2
Hi,
you can set these security configurations on your assambly manifist


Thanks for the reply, but any tips how to set this up? Example or a link to
a page that describes this?
It must be somewhere in the documentation, but first you must find it. ;-)

I am refering to the administative settings that can be configured through
control panel... (policy settings) by user intervention
I am not refering to the settings that the program requests (permissen
settings), because these are already set up in the assembly.cs.

It would be nice if the user must not have to go through control panel
anymore to set up te security settings for my program that needs network
access, and keep his other security settings in place for other programs.
..

Nov 16 '05 #3
> I develop software (.NET) with strong name that needs to access network
drives by default.
Is there any way to make sure that this program have network access without forcing the user to manually add this strong key to be trusted more?
And not to globally trust all .NET applications by default?

You know, to avoid the "Control panel/ Administrative Tools/ Microsoft ..NET Framework Wizards/ Trust an assembly", but during setup automatic configured instead.

It appears that our users have problems setting up this trust.

I have a potentional sollution to my problem.
3 actually, but below is the code that gets my biggest favourite since it
use .NET code.

What I want to have is that my program, with current strong signed key found
in the executable, registers itself as policy that it automaticall have full
trust because it needs access to network drives. How could I modify the code
below that it does this? It could be machine dependend, but it also might be
user dependend.

I prefer to have this registration process into my application and not as
part of the setup program.

But here comes a scary conclusion, if it is possible, then that mean that
any bad program can give itself enoutgh rights to acces the internet without
the user intervention??? Can this be protected by an administrator?

-------------------------------------------
IEnumerator levels = SecurityManager.PolicyHierarchy();
while (levels.MoveNext()) {
PolicyLevel level = (PolicyLevel)levels.Current;
//Machine policy?
if (level.Label.ToString( ) == "Machine") {
//Start from the Top Level CodeGroup for each Policy Level
CodeGroup group = level.RootCodeGroup;
//Is it for "All code"?
if (group.MembershipCondition.ToString( ) == "All code"){
//Define the PermissionSet as "FullTrust"
PermissionSet psFulltrust =
level.GetNamedPermissionSet("FullTrust");
//Define a URL membership condition for
http://www.contoso.com/bin/*
UrlMembershipCondition umc = new
UrlMembershipCondition("http://www.contoso.com/bin/*");
//Add the Child CodeGroup - this is what the caspol tool
does for us
//caspol -quiet -machine -addgroup 1. -url
http://www.contoso.com/bin/* FullTrust -name TestCodeGroup
UnionCodeGroup ucg = new UnionCodeGroup(umc,new
PolicyStatement(psFulltrust));
ucg.Name ="DICOM-CT";
group.AddChild(ucg);
//Save the policy
SecurityManager.SavePolicy();
}
}
}
}
Thanks in advance.
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Terence Shek | last post by:
Is there a way to set the application binding policy so that it always binds to the latest version of an assembly? I'm hoping there is a way to avoid updating the application's binding...
0
by: | last post by:
I develop software (.NET) with strong name that needs to access network drives by default. Is there any way to make sure that this program have network access without forcing the user to manually...
3
by: Florida Coder | last post by:
I have the need to store some application specific configuration data to be used by a class library and or a windows service. I would like to do this in a fashion similar to the way we do with...
7
by: R Reyes | last post by:
Can someone please explain to me why I can't get the MS Word Interop assembly to work in my VS2005 project? I'm trying to manipulate MS Word from my Web Form application and I can't get passed...
4
by: =?Utf-8?B?SmFu?= | last post by:
I have a .NET 2.0 application divided in two assemblies; the exe and a dll. The application generates a plugin-dll which is then loaded in a separate AppDomain (along with a second instance of my...
1
by: Coaster | last post by:
orig ref here http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/ff29cc370678911d/c0db5b7e3da283b9?lnk=st&q=gac+assembly+new+version&rnum=7#c0db5b7e3da283b9...
7
by: Peter Bradley | last post by:
OK. A bit behind the times, I know; but we're just moving over to .NET 2.0. How on earth do you manage configuration settings in a class library in .NET 2.0? In version 1.1, we used a handy class...
7
by: =?Utf-8?B?RG91Z2llIEJyb3du?= | last post by:
Hi I've written custom configuration section (inherits from System.Configuration.ConfigurationSection) to simplify the contents of the config file and to make life easier when accessing them in...
1
by: Wendi Turner | last post by:
Configuration Error from Visual Studio 2005 .NET 2.0 This is an ASP.NET Website with a Report Viewer Component - Microsoft.ReportViewer.WebForms & .Common included in project output Trying to...
0
balabaster
by: balabaster | last post by:
Hi all, I'm creating a class factory and a bunch of adapters to allow in house applications to communicate with mobile applications over different cellular networks. I've got my class...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.