We found an issue with our in-house CDN solution.
An Auth user adds photo’s or docs to their project.
We upload the files to local driver on the server different from the website application.
Example: mysite.com [ d:\websites\mysite.com\] running web-app
Example: cdn.mysite.com [ e:\cdn\mysite.com\assests\] storage area
If a Auth user uploads a an image … then right-clicks on it, the exposed URL
is:
http://cdn.mysite.com/assests/30b3bddc-fe1b-4fef-92c0-576bb6e5b487
/p/347e4ec6-3e36-4ac3-932a-a686d3cffd51/t/347e4ec6-3e36-4ac3-932a-a686d3cffd
51.jpg
We are using GUID for the Project Folder / User Folder / ImageName.jpg
However, if you copy/paste and send this URL to a friend (Not Auth user), you can access the image/file/etc …
How can we protect the CDN to only server up files if user is Auth?
Windows 2008 Server
IIS 7
ASP.NET 4
C# Web app
Create a custom HTTP Module that handles all incoming requests to the cdn site. In the handler you can check if they are authenticated or not
http://msdn.microsoft.com/en-us/library/ms227673.aspx