Groups | Blog | Home
all groups > dotnet security > july 2005 >

dotnet security : Code Access Security


Scott
7/7/2005 5:01:05 AM
I have been instructed that I have a need to configure the framework to
prevent execution of unauthorized mobile code? I have checked into the .NET
configuration tools, but do not see a way to disallow execution for mobile
Scott
7/7/2005 5:14:02 AM
I am also waiting on that definition, but I believe it is code from outside
the local machine. The app will be on machines which might be hooked up to a
network.

[quoted text, click to view]
Scott
7/7/2005 7:14:03 AM
Nicole,
I am installing an application to a group of computers(probably 24
machines). These systems will need to comply with COE requirements, which is
another can of worms. The program is launched from a main application, so I
am not sure with I have to tackle the mobile code synario, but I guess low
man on the totem-pole? Thank you for your time.

[quoted text, click to view]
Scott
7/7/2005 8:02:02 AM
When my app installs' .NET and SP1, we are wanting to restrict any "mobile"
code from running on that machine at all.

[quoted text, click to view]
Nicole Calinoiu
7/7/2005 8:05:38 AM
What is meant by "unauthorized mobile code" in this context? Any code from
outside the local machine or something else?


[quoted text, click to view]

Nicole Calinoiu
7/7/2005 9:23:03 AM
How is any given application relevant here? Will it be the only application
running on these machines? If not, why should the destributor of this
application get to dictate the CAS policy for the entire machine?


[quoted text, click to view]

Nicole Calinoiu
7/7/2005 10:23:11 AM
Still seems a bit odd to me, so I just want to confirm that I understand the
problem correctly...

Is the intent to prevent any "mobile" code from running on the machine at
all or merely to prevent such code from calling into your application's
code?



[quoted text, click to view]

Nicole Calinoiu
7/7/2005 12:13:54 PM
OK, then this should be relatively simple. Your best bet is probably to add
modify the CAS enterprise policy so that code outside the "my computer" zone
is granted no permissions. Since you're using an installer already,
distributing the new policy via an MSI would probably be the best bet. Here
are some steps to follow for preparing the MSI:

1. Create a backup of your current enterprise policy level file
(<windows>\Microsoft.NET\Framework\v1.1.4322\CONFIG\enterprisesec.config).

2. Launch the "Microsoft .NET Framework 1.1 Configuration" MMC from under
the administrative tools group on your Windows start menu. (You must run
this tool as an admin in order to modify the enterprise policy level.)

3. Once the MMC has loaded, expand to the following node in the treeview:
My Computer\Runtime Security Policy\Enterprise\Code Groups\All_Code.

4. Create a new group under the All_Code node using the following
configuration:
Name: My_Computer_Zone
Condition type: Zone
Zone: My Computer
Permission set: FullTrust

5. Modify the All_Code parent group to use the Nothing permission set.

6. Test the new configuration by attempting to run a .NET test app from a
hard drive on your machine (should run OK) and a shared drive on the network
(a PolicyException should be thrown).

7. Back in the configuration MMC, right-click the My Computer\Runtime
Security Policy node and select the "Create deployment package..." option to
initiate creation of an MSI package. When offered a choice of policy level,
select the enterprise level.

You'll end up with an MSI package that can be installed either as part of
your application's installation sequence, as a group policy object (if
you're running a Windows domain), or any other means that you might find to
be convenient.

HTH,
Nicole




[quoted text, click to view]

AddThis Social Bookmark Button