Home All Groups Group Topic Archive Search About

How to create a script to trust an assembly - Excel 2003 - Office System Project with C#

Author
5 Oct 2005 6:01 PM
John Yung
Hi,

In order to run Excel 2003 - Office System Project with C#. All assemblies
(.DLL) use by the project must be set to full trust.

To do it manually, you right click on .NET Configuration 1.1-->Runtime
Security Policy and select "Trust an Assembly".

How can I automate this process?

Thanks,

John Yung

Author
5 Oct 2005 6:26 PM
Jim Thomlinson
Security policies and such (normally) can not be manipulted in code. If you
could then it would defeat the purpose of the security. A virus would just
change the settings and then do it's damage...
--
HTH...

Jim Thomlinson


Show quote
"John Yung" wrote:

> Hi,
>
> In order to run Excel 2003 - Office System Project with C#. All assemblies
> (.DLL) use by the project must be set to full trust.
>
> To do it manually, you right click on .NET Configuration 1.1-->Runtime
> Security Policy and select "Trust an Assembly".
>
> How can I automate this process?
>
> Thanks,
>
> John Yung
>
>
>
Author
5 Oct 2005 7:15 PM
John Yung
Jim,



The ability to change security policy through code does not defeat the
purpose of the security policy. As long as I have the right to change the
policy, it does not matter how I does (via code or manual operation).



What do you think happens when I modify the policy manually? Behind the
screen, the policy is changed via code.


JY



Show quote
"Jim Thomlinson" <jam***@tcgiRe-Move-This.com> wrote in message
news:<3F1D3108-23CF-4C58-B8D8-5F916E190069@microsoft.com>...

> Security policies and such (normally) can not be manipulted in code. If
you

> could then it would defeat the purpose of the security. A virus would just

> change the settings and then do it's damage...

> --

> HTH...

>

> Jim Thomlinson

>

>

> "John Yung" wrote:

>

> > Hi,

> >

> > In order to run Excel 2003 - Office System Project with C#. All
assemblies

> > (.DLL) use by the project must be set to full trust.

> >

> > To do it manually, you right click on .NET Configuration 1.1-->Runtime

> > Security Policy and select "Trust an Assembly".

> >

> > How can I automate this process?

> >

> > Thanks,

> >

> > John Yung

> >

> >

> >
Author
5 Oct 2005 8:46 PM
Jim Thomlinson
When you change the policy manually you are giving your explicit approval to
change the settings on your machine. The point is that you physically had to
make the change and that is fair warning. If you can make the change through
code and avoid the interaction with the end user then you remove the element
of giving the end user fair warning that making a security change could have
consequences. You can not give consent to security policy changes through
code (normally). My question back to you is if code is allowed to manipulate
security settings then what is the point to the security settings? What
exactly are they protecting against?
--
HTH...

Jim Thomlinson


Show quote
"John Yung" wrote:

> Jim,
>
>
>
> The ability to change security policy through code does not defeat the
> purpose of the security policy. As long as I have the right to change the
> policy, it does not matter how I does (via code or manual operation).
>
>
>
> What do you think happens when I modify the policy manually? Behind the
> screen, the policy is changed via code.
>
>
> JY
>
>
>
> "Jim Thomlinson" <jam***@tcgiRe-Move-This.com> wrote in message
> news:<3F1D3108-23CF-4C58-B8D8-5F916E190069@microsoft.com>...
>
> > Security policies and such (normally) can not be manipulted in code. If
> you
>
> > could then it would defeat the purpose of the security. A virus would just
>
> > change the settings and then do it's damage...
>
> > --
>
> > HTH...
>
> >
>
> > Jim Thomlinson
>
> >
>
> >
>
> > "John Yung" wrote:
>
> >
>
> > > Hi,
>
> > >
>
> > > In order to run Excel 2003 - Office System Project with C#. All
> assemblies
>
> > > (.DLL) use by the project must be set to full trust.
>
> > >
>
> > > To do it manually, you right click on .NET Configuration 1.1-->Runtime
>
> > > Security Policy and select "Trust an Assembly".
>
> > >
>
> > > How can I automate this process?
>
> > >
>
> > > Thanks,
>
> > >
>
> > > John Yung
>
> > >
>
> > >
>
> > >
>
>
>
Author
5 Oct 2005 11:04 PM
Nick Hertl
Code Access Security is a concept too complicated to discuss in full
here, but I suggest that you get a book on it and read up.
For a quick answer to you question, take a look at the tool
"caspol.exe" that comes with visual studio.  It alows you to modify
security policy on the command line.
Author
5 Oct 2005 11:55 PM
Jim Thomlinson
My answers here are all "To the best of my knowledge"... If I missed
something based on a limit there-in then... Sorry. Within the code itself I
was and still am unaware of how to go about making the switches to security
policy... I was under the impression they were blocked.
--
HTH...

Jim Thomlinson


Show quote
"Nick Hertl" wrote:

> Code Access Security is a concept too complicated to discuss in full
> here, but I suggest that you get a book on it and read up.
> For a quick answer to you question, take a look at the tool
> "caspol.exe" that comes with visual studio.  It alows you to modify
> security policy on the command line.
>
>
Author
6 Oct 2005 12:11 AM
Jim Thomlinson
Just to clarify, by automate I was under the impression that John wanted a
custom code solution. I was unaware of CASPOL...
--
HTH...

Jim Thomlinson


Show quote
"Jim Thomlinson" wrote:

> My answers here are all "To the best of my knowledge"... If I missed
> something based on a limit there-in then... Sorry. Within the code itself I
> was and still am unaware of how to go about making the switches to security
> policy... I was under the impression they were blocked.
> --
> HTH...
>
> Jim Thomlinson
>
>
> "Nick Hertl" wrote:
>
> > Code Access Security is a concept too complicated to discuss in full
> > here, but I suggest that you get a book on it and read up.
> > For a quick answer to you question, take a look at the tool
> > "caspol.exe" that comes with visual studio.  It alows you to modify
> > security policy on the command line.
> >
> >
Author
6 Oct 2005 1:25 PM
John Yung
Security policy exists to prevent users from making unauthorized
changes/actions. Thus, if the policy says you have the permission to change
it. It does not matter if you are changing it via code or manual operation.

John Yung

Show quote
"Jim Thomlinson" <jam***@tcgiRe-Move-This.com> wrote in message
news:595153D7-52C8-4079-B18E-DC48CC6EDF69@microsoft.com...
> When you change the policy manually you are giving your explicit approval
to
> change the settings on your machine. The point is that you physically had
to
> make the change and that is fair warning. If you can make the change
through
> code and avoid the interaction with the end user then you remove the
element
> of giving the end user fair warning that making a security change could
have
> consequences. You can not give consent to security policy changes through
> code (normally). My question back to you is if code is allowed to
manipulate
> security settings then what is the point to the security settings? What
> exactly are they protecting against?
> --
> HTH...
>
> Jim Thomlinson
>
>
> "John Yung" wrote:
>
> > Jim,
> >
> >
> >
> > The ability to change security policy through code does not defeat the
> > purpose of the security policy. As long as I have the right to change
the
> > policy, it does not matter how I does (via code or manual operation).
> >
> >
> >
> > What do you think happens when I modify the policy manually? Behind the
> > screen, the policy is changed via code.
> >
> >
> > JY
> >
> >
> >
> > "Jim Thomlinson" <jam***@tcgiRe-Move-This.com> wrote in message
> > news:<3F1D3108-23CF-4C58-B8D8-5F916E190069@microsoft.com>...
> >
> > > Security policies and such (normally) can not be manipulted in code.
If
> > you
> >
> > > could then it would defeat the purpose of the security. A virus would
just
> >
> > > change the settings and then do it's damage...
> >
> > > --
> >
> > > HTH...
> >
> > >
> >
> > > Jim Thomlinson
> >
> > >
> >
> > >
> >
> > > "John Yung" wrote:
> >
> > >
> >
> > > > Hi,
> >
> > > >
> >
> > > > In order to run Excel 2003 - Office System Project with C#. All
> > assemblies
> >
> > > > (.DLL) use by the project must be set to full trust.
> >
> > > >
> >
> > > > To do it manually, you right click on .NET Configuration
1.1-->Runtime
Show quote
> >
> > > > Security Policy and select "Trust an Assembly".
> >
> > > >
> >
> > > > How can I automate this process?
> >
> > > >
> >
> > > > Thanks,
> >
> > > >
> >
> > > > John Yung
> >
> > > >
> >
> > > >
> >
> > > >
> >
> >
> >
Author
6 Oct 2005 1:28 PM
John Yung
Actually, I had found the solution (ex: caspol.exe -pp off -af foo.dll would
grant foo.dll full trust) yesterday. But, thanks Nick.

John Yung

Show quote
"John Yung" <jo***@sac.com> wrote in message
news:%23X8CqlnyFHA.2792@tk2msftngp13.phx.gbl...
> Security policy exists to prevent users from making unauthorized
> changes/actions. Thus, if the policy says you have the permission to
change
> it. It does not matter if you are changing it via code or manual
operation.
>
> John Yung
>
> "Jim Thomlinson" <jam***@tcgiRe-Move-This.com> wrote in message
> news:595153D7-52C8-4079-B18E-DC48CC6EDF69@microsoft.com...
> > When you change the policy manually you are giving your explicit
approval
> to
> > change the settings on your machine. The point is that you physically
had
> to
> > make the change and that is fair warning. If you can make the change
> through
> > code and avoid the interaction with the end user then you remove the
> element
> > of giving the end user fair warning that making a security change could
> have
> > consequences. You can not give consent to security policy changes
through
> > code (normally). My question back to you is if code is allowed to
> manipulate
> > security settings then what is the point to the security settings? What
> > exactly are they protecting against?
> > --
> > HTH...
> >
> > Jim Thomlinson
> >
> >
> > "John Yung" wrote:
> >
> > > Jim,
> > >
> > >
> > >
> > > The ability to change security policy through code does not defeat the
> > > purpose of the security policy. As long as I have the right to change
> the
> > > policy, it does not matter how I does (via code or manual operation).
> > >
> > >
> > >
> > > What do you think happens when I modify the policy manually? Behind
the
> > > screen, the policy is changed via code.
> > >
> > >
> > > JY
> > >
> > >
> > >
> > > "Jim Thomlinson" <jam***@tcgiRe-Move-This.com> wrote in message
> > > news:<3F1D3108-23CF-4C58-B8D8-5F916E190069@microsoft.com>...
> > >
> > > > Security policies and such (normally) can not be manipulted in code.
> If
> > > you
> > >
> > > > could then it would defeat the purpose of the security. A virus
would
> just
> > >
> > > > change the settings and then do it's damage...
> > >
> > > > --
> > >
> > > > HTH...
> > >
> > > >
> > >
> > > > Jim Thomlinson
> > >
> > > >
> > >
> > > >
> > >
> > > > "John Yung" wrote:
> > >
> > > >
> > >
> > > > > Hi,
> > >
> > > > >
> > >
> > > > > In order to run Excel 2003 - Office System Project with C#. All
> > > assemblies
> > >
> > > > > (.DLL) use by the project must be set to full trust.
> > >
> > > > >
> > >
> > > > > To do it manually, you right click on .NET Configuration
> 1.1-->Runtime
> > >
> > > > > Security Policy and select "Trust an Assembly".
> > >
> > > > >
> > >
> > > > > How can I automate this process?
> > >
> > > > >
> > >
> > > > > Thanks,
> > >
> > > > >
> > >
> > > > > John Yung
> > >
> > > > >
> > >
> > > > >
> > >
> > > > >
> > >
> > >
> > >
>
>

AddThis Social Bookmark Button