Thursday, July 7, 2011

Wireless Security – Best Practices


The Wireless LAN or WLAN is becoming a popular way to connect devices such as computers these days. In offices and homes, WLAN has become an alternative way of communication compared to wired LAN.  The convenience to connect different devices is both cost effective and easily maintainable.
 
The Wikipedia says: “Wireless LANs have become popular in the home due to ease of installation, and the increasing to offer wireless access to their customers; often for free.”
 
The other factors why WLANs are becoming more acceptable are:
  1. No need to be connected physically with each other through any medium such as cables. You can roam around freely in office premises, home or around.
  2. WLANs are cost effective. Cabling all the way in the offices, hotels etc are not needed. So its cheap and provide same quality of service.
  3. Unreachable spots where a cable is hardly accessible, WLAN signals can reach out such as big installations like airports. Also surfing outdoors is also convenient. Just install the device called Access Points (AP) and you are done.
  4. Less interruption and easy trouble shooting in case of failures as compared to cabled networks.
  5. More secure as most of APs support best encryption methods which protect them from sniffing and other attacks.
A typical wireless network
A typical Wireless network
 
Major issues with WLAN
 
Having said that, WLAN are also as prone to various attacks as their counterpart wired LNAs are. Actually WLANs are easier to hack as compared to wired LANs, if not properly configured, due to its easy accessibility around the installation. No need to be in contact of physical wires to hack, can be done from anywhere. Its convenience can turn into serious risk to the organization if not configured properly. Major attacks include such as, Sniffing, Key cracking, DoS (Denial of Service), Deauthentication attacks, War driving etc. As this paper is not focused on attacks, we shall mainly concentrate on best practices- how to install and use WLAN securely which can thwart a number of above mentioned attacks.
 

Secure WLAN

 
Wireless Security mainly depends on these 3 factors:
  • How much is your wireless network secured in terms of encryption being used.
  • Monitoring for suspicious and unusual activities.
  • User awareness and education.
These are the combination of various approaches ranging from corporate to home networks. These are also for users how to remain safe while surfing.
 

Wi-Fi at home

 
I believe using a Wi-Fi at home is not a luxury anymore it has become a necessity. However, when the question of security comes into the scene, the first thought that would arise in my mind is how you can protect something which you cannot see, neither can you feel it?
 
Protecting a home wireless network is altogether a different side of the coin as compared to wired networks. Most of wireless network device vendor’s and Internet Service provider do not provide any security settings by default and leave the customer to fend for herself. So make sure, your network is secured from being maliciously used.
 
There is no silver bullet that will protect your wireless network infrastructure. These are, however, some
countermeasures listed below that should be used in conjunction with each other to secure your wireless network to the highest level:
1. Use most secure possible encryption:
The first and most necessary step- use industry standard encryptions. The old (however generally used) WEP-Wired Equivalent Privacy, has been known to be broken. Even you use complex passwords it can be broken and decrypted within minutes or hours. WEP uses 40 bit or 128 bits RC4 ciphers to encrypt the channel. Instead use secure protocols such as WPA 2 – Wi-Fi Protected Access -2, which uses strong 128 bits AES ciphers and is typically considered more robust encryption strategy available.
Attacks mitigated: WEP Key cracking, Sniffing, Capturing/Eavesdropping
 
2. Use Firewall:
All the wireless routers come with built-in firewalls. Enable them with all the security features. You should block any anonymous ping requests and place restrictions on website browsing, if required. Define additional security policies and apply them.
Attacks mitigated: Fingerprinting, System compromise
 
3. Have a monitoring system in place:
There’s a saying- prevention is better than a cure. If you are able to detect some suspicious activities before it penetrates your network, you can block them or take precautionary measures. Deploy WIPS/WIDS for monitoring suspicious activities.  
Attacks mitigated: Scanning, DoS
 
4. Don’t use default credentials:
Every wireless router comes with a set of default username/password. Sometimes, people don’t change them and keep using them for long time. Username and passwords are used by computers or other devices to connect to wireless router. If any hacker is able to guess them, he can connect to your network easily. Studies show that majority of users use the same combination of username/passwords as set by manufacturers. Some default username combinations are: admin/admin, admin/password or admin/ “ “.
Attacks mitigated: Unauthorized access, War driving
 
5. Disable Auto-connect feature:
Some devices or the computers/laptops have ‘Let this tool manage your wireless networks’ or ‘Connect automatically to available network’.  Such users having this auto-connect feature enabled are prone to Phishing attack or Rogue AP attack. Attackers keep their APs alive and kicking for such kind of unsuspecting users. They also use luring names as ‘HotSpot’, ‘SecureConnect’, ’GovtNetworks’ etc. The user will never suspect them and keep surfing the wireless network happily. Also if you have not changed the default password of your router, the attacker will try to use this feature on their machine and automatically connect using the easily guessable default passwords.
Attacks mitigated: Phishing, Sniffing, Rouge AP association
 
6. Don’t use public Wi-Fi spots to surf sensitive websites: 
Free and open wireless networks available on airports, cafes, railway stations are not very secure by nature. They do not use any encryption to secure the channel between your laptop to the router. So any information which is not by default going on HTTPS from your laptop/smart phone is susceptible to sniffing and even more your session could be hijacked because the unencrypted channel may leak the active session ID used by your website. Recently to demonstrate these types of attacks one researcher developed a tool Firesheep [http://codebutler.github.com/firesheep/]. All the attacker needs to do is to just install this tool in Firefox and start sniffing the communications on a public unencrypted Wi-Fi. Some applications like Facebook encrypts the login page [HTTPS] but internal pages are served on unencrypted [HTTP] channel so your session ID can be leaked. 
 
7. Change the default SSID:
Although this will not prevent hackers breaking into a network, using a default SSID acts as an indication that the user is careless. So he may be an obvious target to explore further to see if he still uses the default passwords as well? 
Attacks mitigated: War driving
 
8. Restrict access by assigning static IP addresses and MAC filtering:
Disable automatic IP assigning feature and use private static IPs to the legitimate devices you want to connect. This will help you in blocking unwanted devices from being connected to your network. Also, enable MAC filtering- router remembers MAC of each and every device connected to it and saves it as list. You can use this facility to restrict access. Only a set of trusted devices can be allowed to connect. However MAC spoofing is still possible but it raises an extra bar for your wireless network.
 
9. Turn off your router when not in use:
Last but not least, a little obvious, but it will save your network from all the attacks for that time period.
 

Wi-Fi in a Corporate/Enterprise Network

 
Due to the nature of activity and criticality of information, it is very important that Corporate / Enterprise networks have a higher degree of security. 
The following are good to have:
  • Defining an adequate organization wide Information Security policy & procedures for wireless network
  • SSID’s should not be associated with the organization, AP vendor or any other related information which would be easy to guess or associate with the current organization
  • Enable WPA2 Enterprise encryption with RADIUS authentication and use of EAP protocol like EAP-TTLS, TLS   etc.
  • Implementation of PKI infrastructure. CA signed certificates to authenticate the server to client and vice versa
  • Filtering of clients based on unique identifier like MAC Address
  • Isolated ‘Guest’ wireless network with no interface / connection to the corporate network
  • Limiting the radius of Wi-Fi network by reducing the power output of the AP
  • Allocating IP Address to the employee and guest machines only after successful authentication
  • Periodically changing the keys & passwords
  • Use of VPN while accessing corporate information from Public Wi-Fi network
  • Client side utilities like DecaffeintIDcan help in detecting changes in ARP table and serve as common man’s IDS to protect against attacks like ‘hole196’ and DoS.
  • Implementation of Wireless IDS. Wireless IDS is a new concept. The key features of Wireless IDS are:
  1. Prevention against Rogue AP’s
  2. Detection & prevention against DoS attacks
  3. Assistance in locating the approximate physical location of the attacker
  4. Assistance in enforcing the Organization’s Information Security policy on wireless networks
  5. Detection of use of scanning tools like Kismet &NetStumbler
Snort-Wireless & WIDZ are examples of the open source Wireless IDS

Create Nagios Plugin Monitor on Monitis.com


Create Nagios Plugin Monitor on Monitis.com

Posted by Hovhannes Avoyan | Posted in Linux Servers Monitoring, Monitis Vs. Other Services,Monitoring Scripts, Network Monitoring, Performance Management, Server Management,Sysadmin Tools | Posted on 28-06-2011

Tags: 

Nagios Web SiteNagios is a widely used monitoring software for systems and networks. It provides the flexibility to monitor anything on your systems or networks using a script or plugin.  Known for having plugins and scripts available to monitor your needs, Nagios’ the interface and user friendliness leaves much to be desired.  Plus you have to maintain and monitor another server to store and analyze the data provided through your Nagios plugins and scripts.  And worst of all, if your Nagios server or network fail – you may not get an alert at all when you need them the most.
A hosted system monitor gathering your stats is a good way to ensure that alerts get to you, and having it have nice tools and interfaces is definitely a bonus.  Monitis is a hosted systems and networks monitoring solution that offers a simple user interface, with powerful tools, and a distributed network to prevent any service failures  blocking your alerts.  It will free up your sysadmins from monitoring their monitoring servers, and will allow them to focus on the issues rather than looking for the issues.
But suppose you already rely on Nagios scripts and plugins.  There is a simple way to utilize these already known and popular plugins and scripts with a simple wrapper script loading data to your Monitis account.
Monitis provides you with the ability to measure any metric you want through the Custom Monitor.  I will demonstrate by creating a Custom Monitor that accepts data from the Load plugin of Nagios. The Load plugin for Nagios monitors the average load in 1 minute, 5 minute, and 15 minute increments and will alert on user-defined Warning and Critical levels for each of the 3 average load increments.

Create Monitis Custom Monitors

The first thing you need when sending data to Monitis is a Custom Monitor.  The Custom Monitor is where you will store your information for analysis or alerting purposes.  In order to quickly setup the Custom Monitor download this script: https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/API/monitis_create_monitor.sh.
To use the above script, you will need your API Key and Secret Key available from your Monitis Account page.   If you do not have a Monitis Account, you can get a free trial by going here.
Now we are set to create our Custom Monitor where we can load data from the Load plugin for Nagios.  The Load plugin for Nagios monitors 3 results plus has a state value (OK, WARNING or CRITICAL).  So the Custom Monitor that we need to create will monitor these same values, plus use a numeric state value for graphing.  You can run the check_load plugin without the use of nagios to see its default values and expected parameters.
The -w sets the warning level of the avg load and the -c sets the critical level.  You have three options for 1, 5, 15 minute intervals.  So run the plugin with some values in -w and -c.  In the output, you should notice that it gives you State, the load averages results, and then after the | is the performance data.  Performance data is not present for every plugin.
We want to capture the load averages and state for our Custom Monitor.  So we need to setup a Custom Monitor that has 5 columns – load1, load5, load15, state, and state_val.  State_val is used for graphing the different states of OK, WARNING, or CRITICAL.  Here is how to run monitis_create_monitor.sh:

$ ./monitis_create_monitor.sh -n "Load Monitor" -m loadMonitor -r "state:State:state:3;state_val:State Value:state:2;load1:Load 1 Min:load:2;load5:Load 5 Min:load:2;load15:Load 15 Min:load:2" -a API_KEY -s SECRET_KEY

The -n is the Name of the Custom Monitor, -m is the Tag of the Custom Monitor, -r is the ResultParams of the Custom Monitor, -a is your API Key, and -s is the Secret Key.  Definitions for the ResultParams and other necessary Custom Monitor API requests, are available here:http://www.monitis.com/api/api.html#addCustomMonitor
Now you should be able to log into your Monitis account and go to Monitors -> Manage Monitors -> Custom Monitors and add your newly created monitor.
In front of you is your customizable systems monitoring Dashboard.  You are able to place the monitors that are most important to you right in front of your face, not amongst a list of never-ending checks and monitors.  You can have graphs and status checks mixed on the same Dashboard.  The interface is intuitive and has many possibilities for server and network health analysis.

Create Nagios Wrapper Script to Send Data to Monitis

Since a Custom Monitor without any data is not all that interesting, we want to populate it with some data, from the Nagios plugin.  The simplest way is to wrap the plugin script with a custom wrapper script.  Here is an example for the check_load plugin: https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/nagios/monitis_nagios_load_wrapper.sh
This script relies on the script found here to upload data to your Custom Monitor:https://github.com/monitisexchange/Monitis-Linux-Scripts/blob/master/API/monitis_add_data.sh
Using these two scripts, you are able to quickly upload data to your Custom Monitor.
Basically this script runs the plugin then parses through the data and sends the results off to your Custom Monitor.  We are now able to call this script from the command-line and send output to Monitis Custom Monitor.  Here is an example:

$ ./monitis_nagios_load_wrapper.sh -w 5,3,3 -c10,5,4
OK - load average: 0.88, 0.74, 0.65|load1=0.880;5.000;10.000;0; load5=0.740;3.000;5.000;0; load15=0.650;3.000;4.000;0;

As you notice, it outputs the same value as the original check_load plugin.   We are now able to utilize this script to run without Nagios and send data to the Custom Monitor we created.  This frees up the Nagios server we used to have for other services, such as that overloaded webserver, that you have been meaning to scale up for load balancing.
For checking load on a regular basis, we could set the wrapper up in a cronjob.  Since we are also outputting the original output of the check_load plugin, we are able to place this script directly into Nagios and replace the check_load plugin.  This would allow you to utilize both your internal monitoring server and your Monitis account during the transition from Nagios to Monitis, or as a second layer of monitoring.
Once you create your cron or restart Nagios, it will start sending data to your Custom Monitor.
Nagios Widget in Monitis
Here is a sample output from a graph of the Custom Monitor we created.  I put a nice load on the end there by doing a large bzip2 process, while copying files to a different filesystem.  Much nicer than any graph displayed in Nagios.

Setting Up Alerts from Monitis:

OK, we have the data graphing, we all think the interface is beautiful, but we need to setup alerts.  Relying on Nagios to alert you is not always the most comforting solution, if the alert is due to network failure or if the Nagios server is not functioning properly, the alert will never get to you.
Monitis has a distributed framework, which means a single failure on a monitoring server will not prevent you from receiving your alert.  You get to leverage the benefits of this network for alerting from within your Custom Monitor.  In the Dashboard, from your Custom Monitor we can go to Notification rules and setup a new notification:
Set Nagios Alert
Here you can setup alerts based on the numeric values we captured in the wrapper script.  So we can have an alert on Load 1 Min > 10 or Load 5 Mins > 8.  We can also setup an alert if the load is too low, i.e. you are not receiving requests on your web server that always runs at >1 in the 1 min average.
That’s it, you now have hosted monitoring utilizing the plugins you already know and trust, but with the added benefit of an easy to use interface, and a distributed network ensuring alert delivery.
Monitis:
The Monitis account is flexible, allowing for integration with many other systems.
Utilizing Nagios plugins and scripts is just one way to monitor your servers.  It has many other tools and monitoring agents available.  But most of all the easy to use interface allows system administrators to focus on using their tools rather than learning their tools.  The distributed network that Monitis has built up around the tool, ensures that your alerts will get to you when you need them.  Get started utilizing Monitis:https://www.monitis.com/free_signup.jsp.

ClubHACK Magazine

ClubHACK Magazine

Summary of Blog Posts for Week of June 25 at SysAdmin Tips and Tools

Summary of Blog Posts for Week of June 25 at SysAdmin Tips and Tools