.NET Security

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    .NET Security

    Hi there,

    I don't know if anyone can help me but I've been trying to secure my VB.NET web application so that no outside applications can call my application's custom resources.

    Basically I want my code to check to see if the code calling it has permission to do so. I don't want any code that hasn't been written by me to access any of these custom resources.

    I've been researching CAS the last few weeks and really like the idea of using Demands to check the application stack and make sure that all the calling code has a particular key.

    I understand that this works using Strong Names and Trust Levels. (I could be wrong here so if anyone knows more I'd be grateful!)

    I've managed to try out this technology and have successfully used Demands on a practice project that uses all .NET technology.

    BUT my web application uses a resource that is unmanaged code (not .NET). All of my attempts to use the CAS have failed because of this small but major detail.

    It seems that I cannot use .NET' CAS Security features for any of my web application's resources because of this one function call to an unmanaged assembly (which I also need to secure).

    Does anyone know if I'm heading in the right direction here?
    Is there a way to somehow use CAS even though I reference an unmanaged code assembly ?
    (I've been trying to wrap it inside a .NET wrapper class but all my attempts have failed....)
    Is there a way to some how use the Interop assembly in all of this?
    Is this possible?
    Is there another way to do this?

    Thanks in advance!

    -Frinny
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Could you provide provide an example of what you mean and any exceptions?

    Comment

    • strandberg
      New Member
      • Feb 2007
      • 2

      #3
      Originally posted by Frinavale
      I understand that this works using Strong Names and Trust Levels. (I could be wrong here so if anyone knows more I'd be grateful!)
      Strong names are used to uniquely identify assemblies. F.X Dana Developer creates a dll "lib.dll" with a function "void InitSystem()".

      Suppose Hans Haxxor creates an malware dll called lib.dll with a badness-function he calls "void InitSystem()". If he manages to replace Dana's dll with his bad one he might do bad things.

      For your system to avoid that you can use strong names. F.x Dana can be sure that her dll is called or no dll at all.

      HTH,
      Per

      --
      Per Erik Strandberg
      Home: http://www.pererikstra ndberg.se/blog/ .
      Optimization in .NET: http://tomopt.com/tomnet/ .

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by strandberg
        Strong names are used to uniquely identify assemblies. F.X Dana Developer creates a dll "lib.dll" with a function "void InitSystem()".

        Suppose Hans Haxxor creates an malware dll called lib.dll with a badness-function he calls "void InitSystem()". If he manages to replace Dana's dll with his bad one he might do bad things.

        For your system to avoid that you can use strong names. F.x Dana can be sure that her dll is called or no dll at all.

        HTH,
        Per

        --
        Per Erik Strandberg
        Home: http://www.pererikstra ndberg.se/blog/ .
        Optimization in .NET: http://tomopt.com/tomnet/ .
        I don't understand how Hans Haxxor can create an assembly that has the same Strong name as F.x Dana.

        Strong names are created using some fancy cryptographic Microsoft stuff combined with the name you've given the assembly and version etc. Therefore, no two assemblies should ever have the same strong name. If an assembly has the same strong name as another assembly its considered to be the same, so how does the Haxxor's software manage to get the same strong name as F.x Dana?

        I've read this advice else where too, but I'm not clear on why.

        If I'm not supposed to use Strong names, then how am I supposed to check that the code that's calling my application's components is my code?

        -Frinny

        Comment

        Working...