Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Security / November 2007

Tip: Looking for answers? Try searching our database.

WebPermission.Demand() is failing with membership condition - Strong     Name

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dave - 25 Nov 2007 14:28 GMT
hi,
I'm trying to run an assembly in internet explorer (local mode - smart
client architecture).
I need to secure the running, so the first step is protecting the URL.
In .net framework 2.0 configuration I go to ->runtime security policy -
> Machine -> Code Groups I adding new code group.
In the security permissions the Assert is Yes, and the membership
condition is URL with http://127.0.0.1/* , and then the following code
is working:
WebPermission webPerm = new
WebPermission(PermissionState.Unrestricted);
webPerm.Demand();

The second step is protecting it more with the Strong name of the
assembly.
In .net framework 2.0 configuration I go to ->runtime security policy -
> Machine -> new Code Groups, and the membership condition is Strong
Name with the public key of the assembly. The following code is
failed:
WebPermission webPerm = new
WebPermission(PermissionState.Unrestricted);
webPerm.Demand();

this code is also failing:
WebPermission webPerm = new
WebPermission(PermissionState.Unrestricted);
webPerm.Assert(); // bypass the AppDomain level in stackwalk
webPerm.Demand();

what I need to do for solving this problem?

Thank you,
Dov
dave - 26 Nov 2007 15:13 GMT
ok, I made a mystake,
there is no point to call demand after assert, the assert "pass" the
application about the specific permission set.

If I want to add another permission sets like SocketPermission, I have
problem because you can do assert only to one permission set.
If I'm doing RevertAssert its not good also,
so maybe anyone know how to assert more than one permission set ???

Thanks
Dominick Baier - 26 Nov 2007 15:46 GMT
create a PermissionSet and add all the needed permissions to it.

PermissionSet ps = new PermissionSet();
ps.AddPermission (...);

the call Assert on the set

ps.Assert();
-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)

> ok, I made a mystake,
> there is no point to call demand after assert, the assert "pass" the
[quoted text clipped - 4 lines]
> so maybe anyone know how to assert more than one permission set ???
> Thanks
dave - 27 Nov 2007 08:38 GMT
Thanks a lot Dominick !
James Matthews - 30 Nov 2007 12:21 GMT
are you using internet explorer 7?

Signature

http://search.goldwatches.com/?Search=Movado+Watches
http://www.goldwatches.com/
http://www.jewelerslounge.com/

> hi,
> I'm trying to run an assembly in internet explorer (local mode - smart
[quoted text clipped - 29 lines]
> Thank you,
> Dov

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.