Ask a Question related to ASP.NET Security, Design and Development.
-
Matt #1
Deny access to a directory with web.config
Hello,
I'm working on a portal based on IBuySpy, where the main page is
desktopdefault.aspx and all content is stored in
[url]www.domain.com/content/html/nnn[/url]
or
[url]www.domain.com/content/images/nnn[/url]
and injected in the desktopdefault.aspx page.
How can I prevent users doing [url]www.domain.com/content/images/test.jpg[/url]
and getting the image (or the html file, or whatever inside the
content directory?)
It doesn't matter if the user is authenticated or not, I just want
obly the webapplication to be able to load and display the files
inside the /content directory.
Can I do this just manipulating the web.config, without changing
directory permissions on the webserver?
Thanks!
Matt Guest
-
How to Deny Access to Certain User?
I need to know how to deny access to a user (or role, for that matter) in Contribute 3. A client called me and they fired the worker who was in... -
Deny web access to a directory?
Hi, I have a asp.net site running on an MS Access database this is, for better or worse, stored under the webroot. How can I lockout the... -
Deny access to a folder
How can I deny access to a folder when authorization mode is none. I have xml files and I don't want then to be seen. When I restrict it from IIS, I... -
Deny Access to a page
I am using forms auth. against a sql db. I am using a role membership to control access to the various pages in the application. I have created a... -
how to deny access to certain volume via file sharing (OS9)?
Hi all - I have a Mac running OS9.2 at work. I connect to it from home by file sharing via TCP/IP. I want to set the permissions such that people... -
Brock Allen #2
Re: Deny access to a directory with web.config
You can move the directory outside of the web application's directory.
-Brock
DevelopMentor
[url]http://staff.develop.com/ballen[/url]
> Hello,
> I'm working on a portal based on IBuySpy, where the main page is
> desktopdefault.aspx and all content is stored in
> [url]www.domain.com/content/html/nnn[/url]
> or
> [url]www.domain.com/content/images/nnn[/url]
> and injected in the desktopdefault.aspx page.
> How can I prevent users doing [url]www.domain.com/content/images/test.jpg[/url]
> and getting the image (or the html file, or whatever inside the
> content directory?)
> It doesn't matter if the user is authenticated or not, I just want
> obly the webapplication to be able to load and display the files
> inside the /content directory.
> Can I do this just manipulating the web.config, without changing
> directory permissions on the webserver?
>
> Thanks!
>
Brock Allen Guest
-
Matt #3
Re: Deny access to a directory with web.config
Good suggestion, but is there a way to control access to that
directory with the web.config?
Thanks.
>You can move the directory outside of the web application's directory.
>
>-Brock
>DevelopMentor
>[url]http://staff.develop.com/ballen[/url]
>
>
>>>> Hello,
>> I'm working on a portal based on IBuySpy, where the main page is
>> desktopdefault.aspx and all content is stored in
>> [url]www.domain.com/content/html/nnn[/url]
>> or
>> [url]www.domain.com/content/images/nnn[/url]
>> and injected in the desktopdefault.aspx page.
>> How can I prevent users doing [url]www.domain.com/content/images/test.jpg[/url]
>> and getting the image (or the html file, or whatever inside the
>> content directory?)
>> It doesn't matter if the user is authenticated or not, I just want
>> obly the webapplication to be able to load and display the files
>> inside the /content directory.
>> Can I do this just manipulating the web.config, without changing
>> directory permissions on the webserver?
>>
>> Thanks!
>>
>Matt Guest
-
Juan T. Llibre #4
Re: Deny access to a directory with web.config
web.config :
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<authorization>
<allow users="ASPNET's account name"/>
<deny users="*"/>
</authorization>
</system.web>
</configuration>
Juan T. Llibre
ASP.NET MVP
[url]http://asp.net.do/foros/[/url]
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
"Matt" <none@none.com> wrote in message news:e2ju61l2vntc345gtvcbc0ukfmdeull60l@4ax.com...> Good suggestion, but is there a way to control access to that
> directory with the web.config?
>
> Thanks.
>>>You can move the directory outside of the web application's directory.
>>
>>-Brock
>>DevelopMentor
>>[url]http://staff.develop.com/ballen[/url]
>>
>>
>>>>> Hello,
>>> I'm working on a portal based on IBuySpy, where the main page is
>>> desktopdefault.aspx and all content is stored in
>>> [url]www.domain.com/content/html/nnn[/url]
>>> or
>>> [url]www.domain.com/content/images/nnn[/url]
>>> and injected in the desktopdefault.aspx page.
>>> How can I prevent users doing [url]www.domain.com/content/images/test.jpg[/url]
>>> and getting the image (or the html file, or whatever inside the
>>> content directory?)
>>> It doesn't matter if the user is authenticated or not, I just want
>>> obly the webapplication to be able to load and display the files
>>> inside the /content directory.
>>> Can I do this just manipulating the web.config, without changing
>>> directory permissions on the webserver?
>>>
>>> Thanks!
Juan T. Llibre Guest
-
Juan T. Llibre #5
Re: Deny access to a directory with web.config
There's a step-by-step tutorial at :
[url]http://www.dotnetcoders.com/web/Articles/ShowArticle.aspx?article=186[/url]
Juan T. Llibre
ASP.NET MVP
[url]http://asp.net.do/foros/[/url]
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
"Juan T. Llibre" <nomailreplies@nowhere.com> wrote in message
news:ejueHIxSFHA.1152@tk2msftngp13.phx.gbl...> web.config :
>
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
>
> <system.web>
> <authorization>
> <allow users="ASPNET's account name"/>
> <deny users="*"/>
> </authorization>
>
> </system.web>
> </configuration>
>
>
>
>
> Juan T. Llibre
> ASP.NET MVP
> [url]http://asp.net.do/foros/[/url]
> Foros de ASP.NET en Español
> Ven, y hablemos de ASP.NET...
> ======================
>
> "Matt" <none@none.com> wrote in message
> news:e2ju61l2vntc345gtvcbc0ukfmdeull60l@4ax.com...>>> Good suggestion, but is there a way to control access to that
>> directory with the web.config?
>>
>> Thanks.
>>>>>You can move the directory outside of the web application's directory.
>>>
>>>-Brock
>>>DevelopMentor
>>>[url]http://staff.develop.com/ballen[/url]
>>>
>>>
>>>
>>>> Hello,
>>>> I'm working on a portal based on IBuySpy, where the main page is
>>>> desktopdefault.aspx and all content is stored in
>>>> [url]www.domain.com/content/html/nnn[/url]
>>>> or
>>>> [url]www.domain.com/content/images/nnn[/url]
>>>> and injected in the desktopdefault.aspx page.
>>>> How can I prevent users doing [url]www.domain.com/content/images/test.jpg[/url]
>>>> and getting the image (or the html file, or whatever inside the
>>>> content directory?)
>>>> It doesn't matter if the user is authenticated or not, I just want
>>>> obly the webapplication to be able to load and display the files
>>>> inside the /content directory.
>>>> Can I do this just manipulating the web.config, without changing
>>>> directory permissions on the webserver?
>>>>
>>>> Thanks!
>
Juan T. Llibre Guest
-
Matt #6
Re: Deny access to a directory with web.config
I tried, but nothing changes, the user can still do something like
[url]www.domain.com/content/html/test.htm[/url]
and see the content.
On Wed, 27 Apr 2005 06:15:05 -0400, "Juan T. Llibre"
<nomailreplies@nowhere.com> wrote:
> <allow users="ASPNET's account name"/>
> <deny users="*"/>Matt Guest
-
Matt #7
Re: Deny access to a directory with web.config
Thanks I'll read it
On Wed, 27 Apr 2005 06:26:18 -0400, "Juan T. Llibre"
<nomailreplies@nowhere.com> wrote:
>[url]http://www.dotnetcoders.com/web/Articles/ShowArticle.aspx?article=186[/url]Matt Guest
-
Brock Allen #8
Re: Deny access to a directory with web.config
> Good suggestion, but is there a way to control access to that
Not if IIS is serving up the files, as the request never makes it to ASP.NET.> directory with the web.config?
-Brock
DevelopMentor
[url]http://staff.develop.com/ballen[/url]
Brock Allen Guest
-
Juan T. Llibre #9
Re: Deny access to a directory with web.config
I think that adding the specific file types to the files managed
by ASP.NET will turn the trick if you implement forms-based
authentication to the directory.
Juan T. Llibre
ASP.NET MVP
[url]http://asp.net.do/foros/[/url]
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
"Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
news:564311632501908156760592@msnews.microsoft.com ...>>> Good suggestion, but is there a way to control access to that
>> directory with the web.config?
> Not if IIS is serving up the files, as the request never makes it to ASP.NET.
>
> -Brock
> DevelopMentor
> [url]http://staff.develop.com/ballen[/url]
>
>
>
Juan T. Llibre Guest
-
Brock Allen #10
Re: Deny access to a directory with web.config
> I think that adding the specific file types to the files managed by
Yep, that will work.> ASP.NET will turn the trick if you implement forms-based
> authentication to the directory.
-Brock
DevelopMentor
[url]http://staff.develop.com/ballen[/url]
Brock Allen Guest



Reply With Quote

