Monday, September 10, 2007

extended web apps, a primer on AAM, and why I don' think they secure the way you think they do...

So I am working on the edits for the web application chapter and I am at the end, where Alternate Access Mapping was introduced by, ironically, first extending a web app (not exactly what I would have done, but that's what happens when you give the chapter to another author). It's after that extension though, that everything comes together, the creation of the blogging web app earlier in the chapter, the anonymous access, the self-service site creation, the host header intro. And it is then that I really realized something that had been bothering me.

Alternate Access Mapping is purely a way to teach sharepoint what URLs to respond to, and what content to point them at when they come calling-- with a dash of misdirection if the URL it sends back isn't the one sent by the user initially. But it is also tied up with extending web applications in a way that almost makes me feel insulted.

Before we get to that, here's a pretty beefy primer on the Alternate Access Mapping concept so you understand where I am coming from here (and where I might be going wrong if you want to skool me):

You can have web applications that hold site collections that contain a structure of sites and subsites consisting of pages containing lists, libraries, and web parts (most of which point back at the lists and libraries). All of the site collections get their data for those pages from the content database(s) used by the web application. The site collections get their web addresses from appending their path to the web application's address, like http://sharesrv/sitecol1/.

And if that web application's contents are successful, a lot of your users will want to use it, and may want to use it from several different places-- like the office, home, and at branch offices. So to give those users access to those site collections, you have to somehow get Sharepoint to accept more than one URL for the same web application.

Therefore you can use Alternate Access Mapping and just associate some URLs to the same web application, meaning you can have http://sharesrv for the internal office users, and http://sharesrv.mycompany.com for the external users. As long as DNS is set up correctly, then both URLs will go to the same web application.

So why would you ever want to extend a web application? I really had to wrestle with this concept (no, not to understand the concept, but to understand why). An extended web application is where you create a second IIS Web Site that uses the same application pool as an existing web application. This means the extended web application uses exactly the same content as the first web application.

According to Microsoft and people who repeat what they say, you want to extend a web app' because that second web app' can use different security and a different URL. And if you give that extended web app's URL to users that need to be constrained by that extended web app's security, they will use that URL and be constrained. And what is really pushed is the fact that Alternate Access Mapping is a thinly veiled way of managing the URLs of your various extended web applications.

Sharepoint handles URLs as internal and public (external). Internal URLs are what sharepoint gets from the user, accepts them, and sends back the appropriate data. Public URLs are what sharepoint uses to show the user it's links and usually the internal and public URLs are the same.

That makes sense to me, if you want a different URL for a web app to be accepted by sharepoint, you use a public URL (which made its own internal matching URL for resolution purposes only) and point it at the correct web app. Then the user (if DNS is set up correctly) uses either URL and still gets to the web app. Case closed.

All web applications have one real internal URL and five public URLs they can use. Yes, five. Why five you ask? I ask that too. This where MS muddies the waters. Instead of having a nice clear concept of using alternate URLs for web apps, they decided that, in addition to doing alternate URLs, sharepoint will also use the public URLs as the only way to create and manage URLs for those extended web applications.

Remember those? Extended web applications are IIS Web Sites that point to the same content for, apparently the sake of having a different URL than the original web application and for the sake of being able to explicitly set things like authentication and SSL on the extended web app that is different than the original web app.

You can only have four extended web applications per existing web application by the simple expedient of having only four fields available (default is taken by the internal address of original web app itself). These public URL fields are called zones, and you select from the available ones for a web app being extended when you are filling in the settings for the new extension (so to speak). When you fill in a zone address, which is a public URL, it also creates a matching internal URL so that sharepoint uses that address coming and going, you could say.

Say you wanted to have more than one URL go to the same web application, and you decide not to just type one in one of the public URL fields, but instead you decide to create an extended web application for it instead.

So, you use the URL you want for the extended web app, and assign it a public URL zone. Back in Alternate Access Mapping that public URL will be taken. Everywhere else in the administrative interface for sharepoint, that extended web app will be referred to by its zone name. So if you want to change its security settings or whatever, remember that you need to remember its zone. You won't be seeing it by it's URL anywhere. Furthermore, it's not considered "real", so if you want to make any general web app changes (like enable the metaweblog api), you can only do that for the "real" existing web app it was extended from.

Anyway, you have an alternate URL to access the original web application's contents. You can apply security to that extended web app so the users who use its URL to get to the content will have to comply with its security requirements, like SSL or Kerberos (eek).

So now you're with me: how using extended web apps ties up and limits Alternate Access Mappings to these arbitrary four public zones. Muddying the clear waters of alternate addressing with forcing the alternate access for an existing web application to a few public URLs with a strong insistence that those should be extended, extra IIS Web Sites pointed at the same data.

And also I have a concern about this whole alternate web apps with different URLs thing implying that it will somehow secure sharepoint sites by simplygiving the different groups of users the URL you want them to use.

And, of course, that'll work, right? They'll just be happy using that one URL. They won't confer with their buddies and find out that james uses a different URL than they do, one that lets him see things on sharepoint pages without logging in, right? And, even if they did, they'd never be tempted, nay driven, to use that URL instead, would they?

I find the idea of security through expecting users to freely comply to be bad practice. Unless you have only one internal URL for the office, and one URL for outside of the firewall, I don't see how the users are not going to figure out how to cheat. Hell, internal users can use the external address if they want to, so even with two URLs, half of the users can be exposed to data they possibly shouldn't, or security settings you weren't expecting.

And that's why I am bothered by zones, extended web applications, and alternate access mapping. Because they strongly imply that admins must create more IIS web sites to use for public URLs, which they seem to think will corral those users and get them to access the site collections using only the URL they suggest. And then, to allow only four public URLs per web app, adds insult to injury...

...Frankly, what I have come up with, and this seems to be true of most things sharepoint is that there is no why to a feature that is there, or how it works, or how its set. The point to sharepoint is not that it was meant to do something in particular. Often we find a use for it that has nothing to do with what we were told it was meant to do, we use it because of what it does. The point to sharepoint is not that the option, feature, or setting is there, specifically, for a single use or reason. The point to sharepoint is that the option is there if you have a reason for it. If you want it, extended web apps are there for you. If you want, you can use the public zones for URLs you type in that are not part of the extended web apps. You can use SSL, Kerberos, or Anonymous Access on either or both the original web app or the extended one. And, finally, you can try to tell only those users who need to have a certain kind of access to use a certain URL. It's up to you.

This is how I am feeling during the last few hours of editing chapter 8, if you're wondering.

Sunday, September 2, 2007

Interesting URL trick-- How to Get a SharePoint Server on the Farm to Use Its own Local Central Admin Site

So I am in the end run for editing the book and I, of course, ran into something that has absolutely nothing to do with what I am doing...

...Bill Baer has a great little blog article about changing the URL address of a Sharepoint server's default Central Administration site.

I've always hated how, by default, even if you enable Central Administration on a second (or third, or fourth) sharepoint server in the farm, that server never actually points to its own Central Admin site's address.

Now I've always thought that I needed to add it in the Alternate Access Mapping, but according to Bill Baer, it's a registry thing. That each server has a hardcoded URL that it uses for its access Central Administration site. According to the blog entry, you need to change the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\WSS. Locate CentralAdministrationURL and edit the value to reflect the desired location.

Check out the blog entry at: http://blogs.technet.com/wbaer/archive/2007/08/30/sharepoint-3-0-central-administration-url-on-multiple-web-front-end-servers.aspx

Saturday, August 25, 2007

Ifilters, TIFFs, and OCR...or why don't my TIF files show up in search queries?

You know that SharePoint (That's at least MOSS and WSS3) is capable of indexing the contents of Office files because it comes with built in Ifilters for those products. You, like myself, have also read the hype about the fact that SharePoint was also meant, out of the box, to be able to index content of OCR TIFF files.

But, when you add a TIFF to a library, and then search for it, the file doesn't come up in the results unless your query includes something from the file's metadata.

And that is because, despite the Ifilter being built in, it is not turned on. In order to enable the ifilter for OCR to be enabled you must enable it in the registry of the sharepoint server (and likely all servers on the farm). The KB article outlining what to do is: http://support.microsoft.com/kb/837847. Please note, as I am in the last throes of editing the book I don't have time to try this puppy out. So all I am, at this point, is the messenger girl. But if I get it to work I'll try to squeeze it into chapter 15. If I can't, well, you'll read about here with screenshots and everything.

Meanwhile, feel free to try it out and see if it works for you.

Sunday, August 19, 2007

Document Libraries, Forms, Explorer View, and Combine.aspx, or Hmmm, why's that there?

So I am messing around with libraries while I edit the library chapter, and I came across something that puzzled me earlier (when I was writing the chapter) but I didn't have time to mess with it.

I don't have time to mess with it now, but I can't take the chance of ignoring it either.

Have you ever noticed, when you are in a document library, that you can use Explorer view?

Have you noticed, in Explorer View (or if you use Open with Windows Explorer, you get an explorer window), that there is a hidden folder called Forms?

Have you noticed, in the Forms folder that there is a file called Combine.aspx?

Have you ever wondered what it does or why it's there?

Well, for starts, it is a view page that displays the libraries contents with check boxes so you can select several of the library items in one shot, and a Merge Selected Documents button. However, it will never work for a standard library holding standard documents or other files.

It only works with InfoPath 2007 (see http://msdn2.microsoft.com/EN-US/library/ms452435.aspx for more about it).

So why is it available in a document library? I don't know, but maybe it was an oversight and MS should have removed it before RTM. Maybe it's an unfinished feature left in and forgotten in the rush to release.

Nonetheless, Combine.aspx, which opens a Merge Documents view in a library, is supposed to allow you to merge InfoPath forms, if you are using an InfoPath template for the library (and if you are using a Forms Library you are), and if InfoPath is installed locally on the machine you are using to access the site and perform this function.

What I know for sure is, no matter what you do in a document library, you will always get an error dialog box that is completely useless. It tells you, again and again, to make sure you have the correct template associated with the library and if you don't, and you are allowed to administer the library, please change the template to the correct one---- with no mention as to what the correct one would be (my guess is InfoPath).

I think, despite the fact that Combine.aspx exists in the Forms folder, that's why Merge Documents is not a standard view in the view drop down menu for any library--- not even the Forms library.

Now you know.

Tuesday, August 7, 2007

SharePoint Security? An oxymoron? An after thought?

You know the old adage, "The only secure computer is one that is off, unplugged, in the back of a closet." Securing data has always been a case of how inaccessible you want the data to be. If accessing data easily from anywhere is the main focus of a product, chances are good that security will not be.

I was recently asked to submit some abstracts to a conference in Toronto (absolutely *love* that city, those people rock). It's a hardcore security conference. And they want me to, since I am so into WSS, to focus on WSS security.

Now I am talking hardcore, 300 to 400 level security; threat modeling, hack-this-box kind of stuff. Real white hat/black hat, exploit people.

So, what would I talk about concerning security to this jaded bunch of experts?

How about being prepared for the disgruntled administrator? About *really* securing Central Administration? Or what damage you can do with knowing the server farm account, or content database accounts? Or what nefarious things can be done with policy for web application? I dunno. I have been so busy, so overwhelmed, with documenting all the normal functions of sharepoint, I really haven't had time yet to focus on exploiting it.

And now, in the middle of editing, maybe I should. I know, I am doing something else, but this is how it happens. You never get opportunities when you can do them, only when you are too busy to think about them. But inevitably, those opportunities come up, like a call for papers, months before the actual event takes place.

So, in order to have a job at all in November, I have to find time to respond now.

I'll let you know what I come up with, and whether or not they are accepted, as soon as I can.

Monday, August 6, 2007

I just had to get this off my chest-- something I forgot to say about Closed Web Parts gallery

Okay look, in chapter 4, I talk about, and demonstrate, using the closed web part gallery.

But there's something I forgot to say, and it is driving me nuts.

The closed web parts gallery is page specific. It makes sense. If you close a web part on a page, sharepoint will remember it in case you change your mind.

It is not site wide, it is not site collection wide. If you try to be clever and close a web part on page one, thinking it would go to the closed web part gallery and be available on page two, you would be sorely mistaken. See, that's what exporting and the site collection web part gallery are for.

Further, the closed web part gallery is page view version specific. In otherwords, and this makes sense if you think about it, if you have a web part on a page's shared version, it will be on your personal version of the page. Then if you edit your personal version, and in doing so close the web part, it will show up in the closed web part gallery for that version of the page, only.

If you go back to the shared version of the page, the web part is still there. And if you check the galleries, you'll see that its not on that version's closed web parts.

Something else to keep in mind is if you have many, many closed web parts associated with a page or page version, it might load more slowly. So if slow page loads have begun to plague your home page, check to see how many closed web parts might be lurking in your (or the user's) closed web parts gallery. Consider that when configuring the web parts, you might want to allow delete (which deletes the web part from the users' personal version of the web part page), but not close-- just in case.

I really wish I'd remember to put this in. I just hit send, then remembered.

Sigh, so much minutae, so little time...

Wednesday, August 1, 2007

W00t, Technorati, claim me away!!!

Technorati Profile

technorati needs to me add this link to a post so it will let me claim my blog so it can start pinging it. Hey, I'm all for that right? So here goes....