Sunday, June 26. 2011Fixing the Serendipity XMLRPC plugin
A while ago I purchased a copy of BlogPress for my iDevices.. It's pretty full-featured, and seems to work pretty well. Problem was, I couldn't get it to work with my Serendipity-based blog. Oh well, a wasted purchase.
But not so fast! Every once in a while I go back and search for a possible solution. This past week I finally hit paydirt. I came across this post on the s9y forums. This explained why BlogPress was crashing when I used it. In short, it was expecting to see a categoryName tag in the resulting XML from the Serendipity XMLRPC plugin. Serendipity, however, used description instead, likely because Serendipity has better support for the MetaWeblog API. Fortunately, fixing this problem is very straightforward. All you really need to do is implement both APIs and return all of the necessary data for both APIs at the same time. To fix this particular problem, it's a single line addition to the serendipity_xmlrpc.inc.php file located in $S9YHOME/plugins/serendipity_event_xmlrpc. That addition is as follows : And poof, you now have the proper category support for Movable Type. Thursday, June 23. 2011Evaluating a Blogging Platform
I've been pondering my choices lately, determining if I should stay with my current blogging platform or move to another one. There's nothing immediate forcing me to change, nor is there anything overly compelling to the platform I'm currently using. This is an exercise I seem to go through from time to time. It's probably for the better as it keeps me abreast of what else is out there and allows me to re-evaluate choices I've made in the past.
So, what is out there? Well, Serendipity has grown quite a bit as a blogging platform and is quite well supported. That, in its own right, makes it a worthy choice. The plugin support is quite vast and the API is simple enough that creating new plugins when the need arises is a quick task. There are some drawbacks, however. Since it's not quite as popular as some other platforms, interoperability with some things is difficult. For instance, the offline blogging tool I'm using right now, BlogPress, doesn't work quite right with Serendipity. I believe this might be due to missing features and/or bugs in the Serendipity XMLRPC interface. Fortunately, someone in the community had already debugged the problem and provided a fix. Wordpress is probably one of the more popular platforms right now. Starting a Wordpress blog can be as simple as creating a new account at wordpress.com. There's also the option of downloading the Wordpress distribution and hosting it on your own. As with Serendipity, Wordpress also has a vibrant community and a significant plugin collection. From what I understand, Wordpress also has the ability to be used as a static website, though that's less of an interest for me. Wordpress has wide support in a number of offline blogging tools, including custom applications for iPad and iPhone devices. There are a number of "cloud" platforms as well. Examples include Tumblr, Live Journal, and Blogger. These platforms have a wide variety of interoperability with services such as Twitter and Flickr, but you sacrifice control. You are at the complete mercy of the platform provider with very little alternative. For instance, if a provider disagrees with you, they can easily block or delete your content. Or, the provider can go out of business, leaving you without access to your blog at all. These, in my book, are significant drawbacks. Another possible choice is Drupal. I've been playing around with Drupal quite a bit, especially since it's the platform of choice for a lot of projects I've been involved with lately. It seems to fit the bill pretty well and is incredibly extensible. In fact, it's probably the closest I've come to actually making a switch up to this point. The one major hurdle I have at the moment is lack of API support for blogging tools. Yes, I'm aware of the BlogAPI module, but according to the project page for it, it's incomplete, unsupported, and the author isn't working on it anymore. While I was able to install it and initially connect to the Drupal site, it doesn't seem that any of the posting functionality works at this time. Drupal remains the strongest competitor at this point and has a real chance of becoming my new platform of choice. For the time being, however, I'm content with Serendipity. The community remains strong, there's a new release on the horizon, and, most important, it just works. Wednesday, June 22. 2011Technology in the here and now
I'm writing this while several thousand feet up in the air, on a flight from here to there. I won't be able to publish it until I land, but that seems to be the exception these days rather than the norm.
And yet, while preparing for takeoff, the same old announcements are made. Turn off cell phones and pagers, disable wireless communications on electronic devices. And listening around me, hurried conversations between passengers as they ensure that all of their devices are disabled. As if a stray radio signal will cause the airplane to suddenly drop from the sky, or prevent it from taking off to begin with. Why is it that we, as a society, cannot get over these simple hurdles. Plenty of studies have shown that these devices don't interfere with planes. In fact, some airlines are offering in-flight wireless access. Many airlines have offered in-flight telephone calls. Unless my understanding of flight is severely limited, I'm fairly certain that all of these functions use radio signals to operate. And yet we are still told that stray signals may cause planes to crash, may cause interference with the pilots instrumentation. We need to get over this hurdle. We need to start spending our time looking to the future, advancing our technology, forging new paths. We need to stop clinging to outdated ideas. Learning from our past mistakes is one thing, and there's merit in understanding history. But lets spend our energy wisely and make the simple things we take for granted even better. Thursday, June 16. 2011Helpful Rules for OSSECOSSEC has quickly become a primary weapon in my security toolkit. It's flexible, fast, and very easy to use. I'd like to share a few rules I've found useful as of late. I primarily use OSSEC in a server/client setup. One side effect of this is that when I make changes to the agent's configuration, it takes some time for it to push out to all of the clients. Additionally, clients don't restart automatically when a new agent config is received. However, it's fairly easy to remedy this. First, make sure you have syscheck enabled and that you're monitoring the OSSEC directory for changes. I recommend monitoring all of /var/ossec and ignoring a few specific directories where files change regularly. You'll need to add this to both the ossec.conf as well as the agent.conf. <directories check_all="yes">/var</directories> <ignore type="sregex">^/var/ossec/queue/</ignore> <ignore type="sregex">^/var/ossec/logs/</ignore> <ignore type="sregex">^/var/ossec/stats/</ignore> The first time you set this up, you'll have to manually restart the clients after the new config is pushed to them. All new clients should work fine, however. Next, add the following rules to your local_rules.xml file (or whatever scheme you're using). <rule level="12" id="100005"> <if_matched_group>syscheck</if_matched_group> <description>agent.conf changed, restarting OSSEC</description> <match>/var/ossec/etc/shared/agent.conf</match> </rule> This rule looks for changes to the agent.conf file and triggers a level 12 alert. Now we just need to capture that alert and act on it. To do that, you need to add the following to your ossec.conf file on the server. <command> <name>restart-ossec</name> <executable>restart-ossec.sh</executable> <expect>srcip</expect> <timeout_allowed>no</timeout_allowed> </command> <active-response> <command>restart-ossec</command> <location>local</location> <rules_id>100005</rules_id> </active-response> You need to add this to the top of your active response section, above any other rules. OSSEC matches the first active-response block and ignores any subsequent ones. The restart-ossec.sh script referenced in the command section should exist already in your active-response/bin directory as it's part of the distribution. And that's all there is to it. Whenever the agent.conf file changes on a client, it'll restart the OSSEC agent, reading in the new configuration. Next up, a simple DoS prevention rule for apache web traffic. I've had a few instances where a single IP would hammer away at a site I'm responsible for, eating up resources in the process. Generally speaking, there's no real reason for this. So, one solution is to temporarily block IPs that are abusive. Daniel Cid, the author of OSSEC, helped me out a little on this one. It turned out to be a little less intuitive than I expected. First, you need to group together all of the "normal" error response codes. The actual error responses (400/500 errors) are handled with other, more aggressive rules, so you can ignore most of them. For our purposes, we want to trigger on 200/300/400 error codes. <rule id="131105" level="1"> <if_sid>31101, 31108, 31100</if_sid> <description>Group of all "normal" 200/300/400 error codes.</description> </rule> Next, we want to create a composite rule that will fire after a set frequency and time limit. In short, we want this rule to fire if X matches are made in Y seconds. <rule id="131106" level="10" frequency="500" timeframe="60"> <if_matched_sid>131105</if_matched_sid> <same_source_ip /> <description>Excessive access, Temporary block</description> </rule> That should be all you need provided you have active response already enabled. You can also add a specific active response for this rule that blocks for a shorter, or longer, period of time. That's the beauty of OSSEC, the choice is in your hands. I hope you find these rules helpful. If you have any questions or comments, feel free to post them below. Monday, April 18. 2011Hey KVM, you've got your bridge in my netfilter...It's always interesting to see how new technologies alter the way we do things. Recently, I worked on firewalling for a KVM-based virtualization platform. From the outset it seems pretty straightforward. Set up iptables on the host and guest and move on. But it's not that simple, and my google-fu initially failed me when searching for an answer. The primary issue was that when iptables was enabled on the host, the guests became unavailable. If you enable logging, you can see the traffic being blocked by the host, thus never making it to the guest. So how do we do this? Well, if we start with a generic iptables setup, we have something that looks like this:
Adding logging to identify what's going on is pretty straightforward. Add two logging lines, one for the INPUT chain and one for the FORWARD chain. Make sure these are added as the first rules in the chain, otherwise you'll jump to the RH-Firewall-1-INPUT chain and never make it to the log.
Now, with this in place you can try sending traffic to the domU. If you tail /var/log/messages, you'll see the blocking done by netfilter. It should look something like this:
There are a few things of note here. First, this occurs on the FORWARD chain only. The INPUT chain is bypassed completely. Second, the system recognizes that this is a bridged connection. This makes things a bit easier to fix. My attempt at resolving this was to put in a rule that allowed traffic to pass for the bridged interface. I added the following:
This worked as expected and allowed the traffic through the FORWARD chain, making it to the domU unmolested. However, this method means I have to add a rule for every bridge interface I create. While explicitly adding rules for each interface should make this more secure, it means I may need to change iptables while the system is in production and running, not something I want to do. A bit more googling led me to this post about KVM and iptables. In short it provides two additional methods for handling this situation. The first is a more generalized rule for bridged interfaces:
Essentially, this rule tells netfilter to accept any traffic for bridged interfaces. This removes the need to add a new rule for each bridged interface you create making management a bit simpler. The second method is to completely remove bridged interfaces from netfilter. Set the following sysctl variables:
I'm a little worried about this method as it completely bypasses iptables on dom0. However, it appears that this is actually a more secure manner of handling bridged interfaces. According to this bugzilla report and this post, allowing bridged traffic to pass through netfilter on dom0 can result in a possible security vulnerability. I believe this is somewhat similar to cryptographic hash collision. Attackers can take advantage of netfilter entries with similar IP/port combinations and possibly modify traffic or access systems. By using the sysctl method above, the traffic completely bypasses netfilter on dom0 and these attacks are no longer possible. More testing is required, but I believe the latter method of using sysctl is the way to go. In addition to the security considerations, bypassing netfilter has a positive impact on throughput. It seems like a win-win from all angles.
« previous page
(Page 3 of 48, totaling 240 entries)
» next page
|
Calendar
Momentary Wisdom"The column of truth has a hole in it"
LinksCurrently Reading...
TagsSyndicate This Blog |
|||||||||||||||||||||||||||||||||||||||||||||||||






