-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace OSSEC with Wazuh #2140
Comments
In terms of planning on how to harden parts of this stack, then you'd probably want to look at just running the Wazuh Docker containers on hub, combined with the default Docker seccomp profiles... I looked around and I couldn't find many good AppArmor profiles for ElasticSearch or Logstash. Anyways, please take some time to review this info over the next few days and whether it could be conceivably be taken seriously, or if you'd rather stick with OSSEC. I'm going to be playing with it anyway when I get some more free time soon and will report back. |
Well shit, I just remembered that X-Pack only works for 30 days and then they want a license. When I talked to an Elastic representative, they quoted me at something like $5,500 per year for a start-up subscription on 1-5 nodes (with no support). I felt that was a little exorbitant, but maybe a non-profit would receive a better price on a license. Or just disregard everything I said about X-Pack. Sorry about that! |
I'd just like to show off some more of Wazuh's magic and how they've built their own-looking, powerful app on Kibana, and attempt to make the case that it's the next generation of OSSEC, since it's just better, both in rule coverage for so more programs, additional features, (I don't remember OSSEC paying attention to syscalls) and user experience. @redshiftzero @conorsch @dachary @heartsucker @msheiny @garrettr please take a close look at each single image. The title of the views you're observing should be shown in the Just to make a quick point...All of these companies who work with OSSEC (now owned by Trend Micro), plus Wazuh + AtomicCorp who provide expert support for the former and Sucuri, are contribute and support each other a bit. So it's worth looking at what each is up to differently. AtomicCorp uses OSSEC in their secure Linux product and adds thread intelligence feeds. You'll find LOTS of informative and useful info on @dcid's blog website. The bottom of OSSEC's official site even mentions Wazuh:
I'd need to ask my buddy @compoterhacker about AlienVault another product based on OSSEC and whether it's any good. I haven't touched it and don't know much. A few things I want to emphasize:
So, just to be aware, the Wazuh ruleset has 15 more rules than OSSEC by default, and it covers many of the the same services and whatnot, but they have prepended numbers to the filenames. I'll demonstrate what I mean via Meld (directory diff):
(TODO: I'm imagining upstream packages instead of building your own, so might have to make sure whether any updates would overwrite your SecureDrop-customized rules) I could check this quickly but I've already written so much and I'm getting a bit lazy lol.
Here's a diagram showing the data flow: Here's the excellent documentation, starting from the page which explains how to install, update and contribute to the ruleset: New stuff
IntegratorIntegrator allows Wazuh to talk to external APIs and alerting tools:
UpgradingThankfully, upgrading from OSSEC is well-documented and as you saw above the architecture is flexible. You can even make it a gradual rollout if you'd like to simply replace the OSSEC Manager on the Monitor Server first, since Wazuh manager is fully compatible with an OSSEC agent. (though you would lose syscheck there) Unfortunately, the preferred automation is in Puppet. There are a few Ansible OSSEC roles out there (one of them was started by me), and many of them have an issue request to upgrade to Wazuh. There were one or two for Ansible that covered Wazuh, but seemed primitive and I tend not to trust third-party stuff and always like to write it myself instead. So it's just a matter of converting Puppet to Ansible, unless you want to stick to their well-maintained Puppet stuff as complementary and not have to rewrite your Ansible on occasion during updates. There's also the alternative of Dockerization which they have readily prepared out of the box. It's a plus that the majority of your engineers are already familiar with ELK. InstallationThis is extremely well documented. In terms of ELK, you'll have Filebeat --(uses SSL)-->Logstash --> ElasticSearch will be from the various Elastic repos ( Every other component link to list The Wazuh app is actually just a Kibana plugin, e.g. Another option to quickly try all of this out is the pre-built virtual machine image on CentOS 7 which you can import into VirtualBox. What I ask of the SecureDrop devs with this proposal in general:
|
Impact on remote support capabilityAs I pointed out in #973 and earlier, this has a chance to make remote support much easier since Filebeat is present, and thus you could add a second Logstash output listening on a Tor hidden service. (either stealth authenticated or HTTPS over Tor w/ CA client/server keys). Eventually I'll get a chance to look at the Wazuh Logstash instance to see how it tags different agents. You'd either need the filter to tag them per-SecureDrop or put them in separate indicies. Requirements
|
Good comment from Wazuh dev explaining when they forked from OSSEC and their relation to the upstream project:
How they have introduced full agent info (agent ID, name and IP) makes me wonder whether you could get rid of the Monitor Server server entirely in the future and centralize alert collection with FPF running the Wazuh manager+App/ELK stack (since this component might be difficult for some admins to manage/update/deploy), the App Server becomes an agent. But there are a variety of hard problems and concerns with doing something like that, both securely, and providing proper instance segmentation... And the fact that if an attacker got access, they could just turn the agent off (which itself should be an alert managed by a different monitoring service -- "OSSEC not running") |
@ageis What about we start by trying a replacement, to the extent it is possible. I.e. keep just email notifications https://documentation.wazuh.com/current/user-manual/manager/manual-email-report/index.html and use their packages if possible https://documentation.wazuh.com/current/installation-guide/packages-list/index.html#ubuntu . Using the ossec migration documentation you suggested. It would make absolutely no difference/improvement from the SecureDrop admin point of view. It would just migrate to wazuh. Does that sound like something sane ? Things to check:
|
Oh, nice.. There is an official Ansible playbook for Wazuh now: https://github.com/wazuh/wazuh-ansible |
Anecdotally, I have used the official Ansible roles to setup Wazuh manager and agent(s) with great success. Conveniently, there are actually two possible avenues for new agent registration: authd (same as OSSEC, optionally using a shared password) or via the Wazuh API (which potentially can be HTTPS and protected via basic auth). Again, in terms of alerting, logging, configuration, port numbers and file paths, and forgetting about the ELK stack components (e.g. Wazuh Kibana app plus Filebeat and/or Logstash to pipe the alert stream into wazuh-alerts-3.x index) Wazuh is virtually or nearly a complete drop-in replacement for OSSEC. Running /var/ossec/bin/ossec-control status shows just a few extra pieces (I am not sure how this output compares/contrasts with the latest OSSEC): Agent:
Manager:
Additionally, I've found Wazuh's Debian repositories to be usable, all LTS variants of Ubuntu are supported. E-mail notifications are off by default, but can be turned on via vars which influence the OpenSCAPNow here's another cool thing I discovered. Wazuh can be fully integrated (it's disabled by default) with OpenSCAP, which means automated standards compliance, auditing and vulnerability/CVE assessment. IMO this is one of the key advantages of the improved Wazuh ruleset. |
Feature request
Description
Wazuh is the upgraded fork of OSSEC; from what I hear OSSEC HIDS themselves have even started recommending it instead. It is being more actively maintained and has a wider community of users. If you recall what was on their website two years ago, it has vastly improved since then. So, my argument is you should earmark this instead before you get going on #2134, #2136 or #1756 .
The alerting rulesets in Wazuh are also better. From their website:
They also have repositories available and so you won't have to build packages anymore. Just apply whatever customization and hardening to your post-installation.
User Stories
The catch is, there's an ELK stack involved, which I know you're familiar with @conorsch , and will expand the resource requirements of servers a bit. Many people complain and find the OSSEC e-mails frustrating, don't they? This way, admins can just look at Kibana, which I would guess they have already pre-loaded with nice vizs/dashs/searchs of log data. GUI alerts.
If you want to keep some e-mail stuff going and the Postfix setups still useful, then Kibana has the Reporting Plugin in X-Pack which can send out a PDF attachment by e-mail of what a dashboard looks like on a custom schedule( via ElasticSearch's watcher plugin. Then e-mail credentials/server details for the scheduled alert reports would go in elasticsearch.yml.
And, at that point, since you have Filebeat, Logstash and ES X-Pack then you could extend it to introduce additional, traditional forms of non-security monitoring (e.g. resource/cpu/memory/disk) that have been lacking on both machines AFAIK just by adding Metricbeat into the mix. You can write a watcher trigger where if a saved Kibana search (for say, any OSSEC alert above level 8) will trigger the e-mail action.
X-Pack is a plus anyway because it requires you to set up security and authentication on ES (unless explicitly disabled), and it has monitoring, alerting and notification and machine learning features.
They use PhantomJS, but I'm not sure if they have the capability to export regular PNG/image screenshots yet. I complained about it in a ticket because I had to develop some really hacky solutions to get a PNG instead of PDF. I mean inotify-cron watching /tmp for when PhantomJS would write its screenshot temporarily and grabbing that instead of PDF, lol.
And, guess what: because there's Filebeat, then in theory it becomes possible for FPF to directly get secure visibility into SecureDrop instance alerts/logs (without revealing source-related activity or metadata of course), instead of having to troubleshoot remotely or have admins paste them over, by adding your Logstash server as an extra output to the Filebeat config.
I would actually use host a Tor hidden service for that idea, since Filebeat has a proxy_url directive where you can use SOCKS5.
I'm just becoming familiar with Wazuh. I haven't had a chance to try it yet, since I only recently learned that it was being preferred to OSSEC. There's a Docker container available for trying it out quickly.
The text was updated successfully, but these errors were encountered: