Drupal and mod_security : Part 2
Hi all,
I've gotten quite a few emails regarding my last post about Drupal and mod_security, and what those rules I'm removing actually do. Well, I'll explain.
First Rule: 960010
SecRule REQUEST_METHOD "!^(?:get|head|propfind|options)$" \
"chain, t:lowercase, deny,log,auditlog,status:401,msg:'Request content type
is not allowed by policy',,id:'960010',severity:'4'"
SecRule REQUEST_HEADERS:Content-Type "!(?:^(?:application\/x-www-form-urlencoded
(?:;(?:\s?charset\s?=\s?[\w\d\-]{1,18})?)??$|multipart/form-data;)|text/xml)"
This rule basically only allows certain content-type headers to be passed with the request methods listed in REQUEST_METHOD. Apparently, Drupal doesn't respect this rule in posts.
Next, 960015
SecRule &REQUEST_HEADERS:Accept "@eq 0" \
"chain,skip:1,log,auditlog,msg:'Request Missing an Accept Header', severity:'2',,id:'960015',"
SecRule REQUEST_METHOD "!^OPTIONS$" "t:none"
SecRule REQUEST_HEADERS:Accept "^$" \
"chain,log,auditlog,msg:'Request Missing an Accept Header', severity:'2',,id:'960015',"
SecRule REQUEST_METHOD "!^OPTIONS$" "t:none"
This basically says, any request other than an OPTIONS request, *must* have an Accept header sent with it.
Next, 960032:
SecRule REQUEST_METHOD "!^((?:(?:POS|GE)T|OPTIONS|HEAD))$" \
"phase:2,log,auditlog,status:401,msg:'Method is not allowed by policy', severity:'2',,id:'960032',"
This says any methods other than POST, GET, OPTIONS or HEAD aren't allowed. While generally this is true, and I don't know why Drupal will occasionally hit this rule, I just remove it out of completeness.
And Lastly,
Rule 950107:
SecRule REQUEST_FILENAME|ARGS|ARGS_NAMES|REQUEST_HEADERS|XML:/*|!REQUEST_HEADERS:Referer "@validateUrlEncoding" \
"chain, deny,log,auditlog,status:400,msg:'URL Encoding Abuse Attack Attempt',,id:'950107',severity:'4'"
SecRule REQUEST_FILENAME|ARGS|ARGS_NAMES|REQUEST_HEADERS|XML:/*|!REQUEST_HEADERS:Referer "\%(?!$|\W|[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})"
This rule merely checks the URL encoding on a URL. I say merely, but this rule is also matched almost _all of the time_.
I haven't actually run through the Drupal code and figured out why these are completely necessary, however I do know that they've fixed quite a few peoples problems.
Anyway, hope that clarifies some things for people.
Dantes Inferno: ++
Well, last week I got Dante's Inferno for the PS3 (the game, I've had the poem for years), and I have to say it's a pretty good game overall. It chronicles a soldier of the crusade fighting through hell as described by Dante Alighieri to try to win back the soul of the woman he loves. Later, we find out Dante wasn't such a good guy while he was slaughtering thousands of people, but you probably guessed that already.
Oh, and he didn't know he was dead? Fighting Death and stealing his scythe didn't give that away? What? A few little plot holes aside. It was awesome. Any other difficulty higher than Hellish is damn near impossible even with a decked out set of gear (It's probably because I suck at it, though).
And it has King Minos! Everyone loves King Minos! Remember that show? with his wife Deborah?
...
Wait.
Stuff I care about, but Delicious is being a pain in the ass.
USB VGA Adapters that work in Linux
nload
NSLU2 Ideas
Changing windows key in server 2008
Yay, paranoia!
Maybe because I've got this head cold, but I am oddly paranoid about random things in general as of late.
One sentence posts aren't usually my style, but short posts are better than no posts.
Wow. Not the warcraft kind.
Wow, it has been a long time since I posted something. You'd think I could find something to rant about. Anything.
So, I'll just post randomness.
The car chase scene from Mr. and Mrs. Smith? Awesome. Hilarity.
My Job? Not to brag, but I have quite possibly the most awesome job that has ever existed. Anywhere.
I'm making a remarkable attempt to get back into photography. Some of the photos from my last jaunt in this art are over on my deviantart page. It's in the sidebar.
World of Warcraft: Cataclysm
So if you're the last one on the block to hear about it, Blizzard is releasing a new expansion to World of Warcraft. Dubbed Cataclysm, Blizzard has opted to go for a end of world scenario and what is touted as huge landmass changes for Eastern Kingdoms and Kalimdor. Not enough information for you? Here have a trailer:
Frankly, I'm a bit concerned here. Yes, the world looks cool, and those of us who have frequent ideas of the end of the world are going to love the changes to the ever so boring starting areas that we end up visiting millions of times to deliver bits of string or stringy wolf meat. But, I think that most people who have gotten used to the old game and aren't destruction buffs are going to find the new world intimidating. I can't see Blizzard alienating their player base though by doing something as drastic as this, so I don't know if its going to be more than I'm making it out to be.
As a side note, most people are humored when they learn that the wife and I both play WoW. You want to know why we do it? It's a whole lot of fun, lets us blow off some steam after work, oh and its probably the greatest value entertainment wise. Ever.
I'm telling you, its cheaper than a movie. And you get to hack things to bits with a large Axe. What's wrong with that?
Que Sera, Sera
As many of you may or may not know, I fancy myself a decent poker player. Not decent like I could make a living, but decent to where I could become a degenerate gambler who smokes Lucky Strikes and spits on cars off of the Spring Mountain exit ramp. Anyway, everyone who plays poker has had a few bad beats happen to in their poker life. I am no exception. Here are some of my recent ones:
I've got A-10, flop is KQJ, Heads up, I bet like a madman, Turn and river are both 7's. Guy turns over Q7 for a full house.
I've got 67, flop is 458, I flopped a straight. I bet, guy calls. Turn is a 9. I bet, guy calls. River is 8. I check, guy bets $20, I move all in over the top of him for $60 more. He instacalls with 89 for a full house.
I've got AK of clubs. Preflop, I raise to $7. Two callers to the flop. Flop is 3c8c7d. I bet $10 on a semi bluff. Two calls. Turn is 7c, giving me the nut flush. I now bet $20, two callers. (seriously, wtf?). River is 7h. I check because now anyone with a 3 or an 8 has a full house. Guy to the right bets $35, other guy calls, I have to call because I'm a freaking moron who can't let go of the nut flush. They both turn over 8's for the full boat and split the pot.
In the same instance, all poker players have some hands that are unbelievable. Here are a few of mine:
I have AsAc preflop. I bet $7, this guy who talks alot of crap goes over the top of me and raises to $15. I raise to $30. He calls. Flop is 7s8sAd, giving me the nuts. I check into him, he bets $40. I grumble for a while, putting on a show, and call the $40. the turn is the Ace of hearts, giving me quad aces. I check, he bets $50, I grumble, look at my cards, sigh, etc. And call his $50. (Right now, he's drawing dead. There is no way he can have a better hand than mine). River is the K of spades. I go all in for $120. He grumbles and calls. I flip over the Aces. (Not only was that pot massive, I also got a high hand bonus for $400).
I have a few other hands that involve quads, full houses and the like. Never had a straight flush or a royal yet. Which kinda sucks, because the high hand bonus for those sometimes hits over $2k.
Interesting people on Twitter
Well, since I'm amazingly absent at posting lately, I'll put a list of cool people to follow on Twitter up.
why not.
* androidlust (Shikhee from Android Lust)
* trent_reznor (Trent Reznor from Nine Inch Nails)
* amandapalmer (Amanda Palmer from The Dresden Dolls)
* thelindsayellis (Lindsay Ellis the Nostalgia Chick)
* drtiki (Dr. Tiki from TikiBarTV)
There, I posted! Yay.
What’s that on my shoe? oh, its my jejunum.
Link dump time.
A cool little post on using Ferret and ruby to do search magics
A post about putting NetBSD on an NSLU2 (ARM)
BlackBerry Curve General Discussion forums over at Blackberry Forums
There, just a few links that I have in my Bookmarks. Figured someone could use them.
(Jejunum is here.)





