Running an assembly in different User

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Running an assembly in different User

    Hi All

    I have an asp.net Application. It calls an assembly which copies a file from one location say c:\temp to another directory say c:\temp1. I created an assembly to do this where i did not have any problems after giving the ASPNet User write access to that destination forlder c:\temp1. We feel that providing the aspnet user with write access to a folder is a possible security threat, so we want to run this assembly under a different user (other than aspnet user). can any one suggest me how to do this.

    Thanks in advanc

    NMN Guest

  2. Similar Questions and Discussions

    1. Error - Running ColdFusion as a specific user
      I followed the instructions in http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_17279 using an active directory domain accoun and cannot...
    2. Assembly with USER controls (ascx) cannot find its resouces
      Hi, I built an assembly with a set of user controls. This can be done with the Visual Studio 2005 Deployment Project: building and merging for...
    3. Assembly acessing StrongNamed assembly getting "Access Denied" intermitently
      I have an ASP.NET application that is using a code library our development team uses. The code library is a few web controls in a Strong Named...
    4. Reading the public key inside a strongly signed assembly from the assembly itself???
      Hello, is it possible to programmatically read (and how) the public key that is embedded into an assembly that has been strongly signed??? What...
    5. ID1.0 not running under normal user rights
      Hello all, its perplexing. Photoshop 7, illustrator all run when installed under admin rights and run under 'normal' user privileges. But...
  3. #2

    Default Re: Running an assembly in different User

    Use identity Impersonation..Create an account with the minimum priveleges
    you need to do the copying and update your web.config file with this:

    <identity impersonate="true"
    userName="domain\user"
    password="password" />

    that way, the requests will be executed under the context of that user
    instead of ASPNET....



    "NMN" <anonymous@discussions.microsoft.com> wrote in message
    news:DD345E26-19E7-4E83-954A-EE6B051BF4BD@microsoft.com...
    > Hi All,
    >
    > I have an asp.net Application. It calls an assembly which copies a file
    from one location say c:\temp to another directory say c:\temp1. I created
    an assembly to do this where i did not have any problems after giving the
    ASPNet User write access to that destination forlder c:\temp1. We feel that
    providing the aspnet user with write access to a folder is a possible
    security threat, so we want to run this assembly under a different user
    (other than aspnet user). can any one suggest me how to do this.
    >
    > Thanks in advance
    >

    Kunal Guest

  4. #3

    Default Re: Running an assembly in different User

    Probably the best way to do this is to set up your "copy" component to run
    under COM+ and have COM+ run it under a different identity with the correct
    privileges.

    The other ways to do it would be to do some sort of out of process call via
    a Web Service or Remoting, but those are probably more complex. You could
    also try to do some sort of impersonation scenario in ASP.NET so that you
    would be running under the context of a user that has the right permissions.
    Finally, you could change the ASP.NET process model to use a different
    account than ASPNET that already has the correct permissions.

    Joe K.

    "NMN" <anonymous@discussions.microsoft.com> wrote in message
    news:DD345E26-19E7-4E83-954A-EE6B051BF4BD@microsoft.com...
    > Hi All,
    >
    > I have an asp.net Application. It calls an assembly which copies a file
    from one location say c:\temp to another directory say c:\temp1. I created
    an assembly to do this where i did not have any problems after giving the
    ASPNet User write access to that destination forlder c:\temp1. We feel that
    providing the aspnet user with write access to a folder is a possible
    security threat, so we want to run this assembly under a different user
    (other than aspnet user). can any one suggest me how to do this.
    >
    > Thanks in advance
    >

    Joe Kaplan \(MVP - ADSI\) Guest

  5. #4

    Default Re: Running an assembly in different User

    Thanks. Where do i need to put this web.config file. As i want only the dll to run in this user account, but the asp.net page needs to still run in a different user which does not have access to write into a particular directory

    Thanks once again
    ----- Kunal wrote: ----

    Use identity Impersonation..Create an account with the minimum privelege
    you need to do the copying and update your web.config file with this

    <identity impersonate="true
    userName="domain\user
    password="password" /

    that way, the requests will be executed under the context of that use
    instead of ASPNET...

    NMN Guest

  6. #5

    Default Re: Running an assembly in different User

    Hi joe

    Thanks for you valuable suggestions. If you can suggest me on some article which will guide me in doing this i will be very grateful. I would prefer the first scenario of using COM+. I also would like some more details on this statement, actually i am not sure how with this i can run an assembly alone in a different user
    "You coul
    also try to do some sort of impersonation scenario in ASP.NET so that yo
    would be running under the context of a user that has the right permissions.

    Thank

    ----- Joe Kaplan (MVP - ADSI) wrote: ----

    Probably the best way to do this is to set up your "copy" component to ru
    under COM+ and have COM+ run it under a different identity with the correc
    privileges

    The other ways to do it would be to do some sort of out of process call vi
    a Web Service or Remoting, but those are probably more complex. You coul
    also try to do some sort of impersonation scenario in ASP.NET so that yo
    would be running under the context of a user that has the right permissions
    Finally, you could change the ASP.NET process model to use a differen
    account than ASPNET that already has the correct permissions

    Joe K

    NMN Guest

  7. #6

    Default Re: Running an assembly in different User

    COM+ is not my specialty at all, so you might get better help if you ask
    more people. I'd start a new thread saying that you want to write a .NET
    component that runs under COM+ so that you can run it under a different
    identity. There is some good help on writing seviced components here:

    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconwritingservicedcomponents.asp?frame=true[/url]

    Regarding your second question, that doesn't sound like to the way to go
    based on your reply to one of the other messages. From what I could gather,
    you want the main part of the request running as the current user so that
    you can take advantage of their security context, but want this one thing to
    run as a different context. In that situation, you should really be doing
    COM+. Trying to do it by changing impersonation contexts and then changing
    back would be a bit of a hack job.

    HTH,

    Joe K.

    "NMN" <anonymous@discussions.microsoft.com> wrote in message
    news:D0B8C88F-3E02-420D-80A8-E5191960BFDA@microsoft.com...
    > Hi joe,
    >
    > Thanks for you valuable suggestions. If you can suggest me on some
    article which will guide me in doing this i will be very grateful. I would
    prefer the first scenario of using COM+. I also would like some more details
    on this statement, actually i am not sure how with this i can run an
    assembly alone in a different user.
    > "You could
    > also try to do some sort of impersonation scenario in ASP.NET so that
    you
    > would be running under the context of a user that has the right
    permissions. "
    >
    > Thanks
    >
    >
    > ----- Joe Kaplan (MVP - ADSI) wrote: -----
    >
    > Probably the best way to do this is to set up your "copy" component
    to run
    > under COM+ and have COM+ run it under a different identity with the
    correct
    > privileges.
    >
    > The other ways to do it would be to do some sort of out of process
    call via
    > a Web Service or Remoting, but those are probably more complex. You
    could
    > also try to do some sort of impersonation scenario in ASP.NET so that
    you
    > would be running under the context of a user that has the right
    permissions.
    > Finally, you could change the ASP.NET process model to use a
    different
    > account than ASPNET that already has the correct permissions.
    >
    > Joe K.
    >

    Joe Kaplan \(MVP - ADSI\) Guest

  8. #7

    Default Re: Running an assembly in different User

    Thanks Joe and Kunal. I was able to implement this by using Managed COM+ Component. The material i used for referring is as follows

    http://www.informit.com/isapi/product_id~{A1CE8908-9877-4B24-9B2C-BD7B836490D6}/element_id~{A53BFEC1-3FB7-4E6B-B8A7-653F61DAA526}/st~{EA7C8D03-4995-402D-B085-06E000F897B8}/session_id~{275EC953-2A7F-44FB-B08C-BBA54C9C3106}/content/articlex.as

    Thanks once again for your help

    regard
    Madhavan
    NMN Guest

  9. #8

    Default Re: Running an assembly in different User

    Glad you got it working.

    Joe K.

    "NMN" <anonymous@discussions.microsoft.com> wrote in message
    news:E4F225D6-1B63-4822-A782-FC79B59A1DE6@microsoft.com...
    > Thanks Joe and Kunal. I was able to implement this by using Managed COM+
    Component. The material i used for referring is as follows:
    >
    >
    http://www.informit.com/isapi/product_id~{A1CE8908-9877-4B24-9B2C-BD7B836490D6}/element_id~{A53BFEC1-3FB7-4E6B-B8A7-653F61DAA526}/st~{EA7C8D03-4995-402D-B085-06E000F897B8}/session_id~{275EC953-2A7F-44FB-B08C-BBA54C9C3106}/content/articlex.asp
    >
    > Thanks once again for your help.
    >
    > regards
    > Madhavan

    Joe Kaplan \(MVP - ADSI\) Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139