Archive for the ‘Security’ Category

Configuring APACHE2 with SSL support in OpenSuSE

Friday, August 17th, 2012
Please note that this post is a copy of below two pages, and has been copied here for archiving purposes :ress>
http://www.tc.umn.edu/~brams006/selfsign.html
http://www.tc.umn.edu/~brams006/selfsign_opensuse.html.
 
Creating Certificate Authorities and self-signed SSL certificates

Following is a step-by-step guide to creating your own CA (Certificate Authority) — and also self-signed SSL server certificates — with openssl on Linux. Self-signing is the simpler route to take, but making one’s own CA allows the signing of multiple server certificates using the same CA and involves only a few extra steps.

After using openssl to generate the necessary files, you’ll need to integrate them into Apache. This process differs between Linux distros and versions of Apache.

Making a homemade CA or self-signed certificate will cause the client web browser to prompt with a message whether to trust the certificate signing authority (yourself) permanently (store it in the browser), temporarily for that session, or to reject it. The message “web site certified by an unknown authority… accept?” may be a business liability for general public usage, although it’s simple enough for the client to accept the certificate permanently.Whichever route you take, you’ll save the periodic expense of paying a recognized signing authority. This is purely for name recognition — they’ve paid the major browser producers to have their CA pre-loaded into them. So if you’re on a budget, have a special need or small audience, this may be useful.

Before you start
You need Apache and openssl. Compiling them from source, handling dependencies, etc. is beyond the scope of this document. You can consult their documentation, or go with a mainstream Linux distro that will do the preliminary work for you.Now you need to decide whether you’ll make a CA (Certificate Authority) and sign a server certificate with it — or just self-sign a server certificate. Both procedures are detailed below.


 
(1A) Create a self-signed certificate.
Complete this section if you do NOT want to make a CA (Certificate Authority). If you want to make a CA, skip 1A entirely and go to 1B instead.Some steps in this document require privileged access, and you’ll want to limit access to the cert files to all but the root user. So you should su to root and create a working directory that only root has read/write access to (for example: mkdir certwork, chmod 600 certwork). Go to that directory.

Generate a server key:

openssl genrsa -des3 -out server.key 4096
 
Then create a certificate signing request with it. This command will prompt for a series of things (country, state or province, etc.). Make sure that “Common Name (eg, YOUR name)” matches the registered fully qualified domain name of your box (or your IP address if you don’t have one). I also suggest not making a challenge password at this point, since it’ll just mean more typing for you.
The default values for the questions ([AU], Internet Widgits Pty Ltd, etc.) are stored here: /etc/ssl/openssl.cnf. So if you’ve got a large number of certificate signing requests to process you probably want to carefully edit that file where appropriate. Otherwise, just execute the command below and type what needs to be typed:

openssl req -new -key server.key -out server.csr
 
Now sign the certificate signing request. This example lasts 365 days:
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
 
Make a version of the server.key which doesn’t need a password:
openssl rsa -in server.key -out server.key.insecure
mv server.key server.key.secure
mv server.key.insecure server.key
 
These files are quite sensitive and should be guarded for permissions very carefully. Chown them to root, if you’re not already sudo’d to root. I’ve found that you can chmod 000 them. That is, root will always retain effective 600 (read) rights on everything.
Now that you’ve just completed Step 1A, skip ahead to Step 2.

(1B) Generate your own CA (Certificate Authority).
 
Complete this section if you want to make a CA (Certificate Authority) and sign a server certificate with it. The steps for making a server certificate are also included here. If you’d rather one-time self-sign a server certificate, skip this step entirely and go to 1A instead.
Some steps in this document require priviledged access, and you’ll want to limit access to the cert files to all but the root user. So you should su to root and create a working directory that only root has read/write access to (for example: mkdir certwork, chmod 600 certwork). Go to that directory.

In this step you’ll take the place of VeriSign, Thawte, etc. You’ll first build the CA key, then build the certificate itself.

The Common Name (CN) of the CA and the Server certificates must NOT match or else a naming collision will occur and you’ll get errors later on. In this step, you’ll provide the CA entries. In a step below, you’ll provide the Server entries. In this example, I just added “CA” to the CA’s CN field, to distinguish it from the Server’s CN field. Use whatever schema you want, just make sure the CA and Server entries are not identical.

CA:
Common Name (CN): www.somesite.edu CA
Organization (O): Somesite
Organizational Unit (OU): Development

Server:
Common Name (CN): www.somesite.edu
Organization (O): Somesite
Organizational Unit (OU): Development

If you don’t have a fully qualified domain name, you should use the IP that you’ll be using to access your SSL site for Common Name (CN). But, again, make sure that something differentiates the entry of the CA’s CN from the Server’s CN.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
 
Generate a server key and request for signing (csr).
This step creates a server key, and a request that you want it signed (the .csr file) by a Certificate Authority (the one you just created in Step #1B above.)Think carefully when inputting a Common Name (CN) as you generate the .csr file below. This should match the DNS name, or the IP address you specify in your Apache configuration. If they don’t match, client browsers will get a “domain mismatch” message when going to your https web server. If you’re doing this for home use, and you don’t have a static IP or DNS name, you might not even want worry about the message (but you sure will need to worry if this is a production/public server). For example, you could match it to an internal and static IP you use behind your router, so that you’ll never get the “domain mismatch” message if you’re accessing the computer on your home LAN, but will always get that message when accessing it elsewhere. Your call — is your IP stable, do you want to repeat these steps every time your IP changes, do you have a DNS name, do you mainly use it inside your home or LAN, or outside?

openssl genrsa -des3 -out server.key 4096
openssl req -new -key server.key -out server.csr
 
Sign the certificate signing request (csr) with the self-created Certificate Authority (CA) that you made earlier.
Note that 365 days is used here. After a year you’ll need to do this again.Note also that I set the serial number of the signed server certificate to “01”. Each time you do this, especially if you do this before a previously-signed certificate expires, you’ll need to change the serial key to something else — otherwise everyone who’s visited your site with a cached version of your certificate will get a browser warning message to the effect that your certificate signing authority has screwed up — they’ve signed a new key/request, but kept the old serial number. There are a couple ways to rectify that. crl’s (certificate revocation list) is one method, but beyond the scope of the document. Another method is for all clients which have stored the CA certificate to go into their settings and delete the old one manually. But for the purposes of this document, we’ll just avoid the problem. (If you’re a sysadmin of a production system and your server.key is compromised, you’ll certainly need to worry.)

The command below does a number of things. It takes your signing request (csr) and makes a one-year valid signed server certificate (crt) out of it. In doing so, we need to tell it which Certificate Authority (CA) to use, which CA key to use, and which Server key to sign. We set the serial number to 01, and output the signed key in the file named server.crt. If you do this again after people have visited your site and trusted your CA (storing it in their browser), you might want to use 02 for the next serial number, and so on. You might create some scheme to make the serial number more “official” in appearance or makeup but keep in mind that it is fully exposed to the public in their web browsers, so it offers no additional security in itself.

openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt
 
To examine the components if you’re curious:
openssl rsa -noout -text -in server.key
openssl req -noout -text -in server.csr
openssl rsa -noout -text -in ca.key
openssl x509 -noout -text -in ca.crt
 
Make a server.key which doesn’t cause Apache to prompt for a password.
Here we create an insecure version of the server.key. The insecure one will be used for when Apache starts, and will not require a password with every restart of the web server. But keep in mind that while this means you don’t have to type in a password when restarting Apache (or worse — coding it somewhere in plaintext), it does mean that anyone obtaining this insecure key will be able to decrypt your transmissions. Guard it for permissions VERY carefully.
openssl rsa -in server.key -out server.key.insecure
mv server.key server.key.secure
mv server.key.insecure server.key
 
These files are quite sensitive and should be guarded for permissions very carefully. Chown them to root, if you’re not already sudo’d to root. I’ve found that you can chmod 000 them. That is, root will always retain effective 600 (read) rights on everything.
(2) Copy files into position and tweak Apache.
 
Some professors like to pause for a moment after a long lecture, and do a little recap. It’s a good pedagogical tool, so let’s do so here. If you took route 1A above, you should have four files in a working directory:
server.crt: The self-signed server certificate.
server.csr: Server certificate signing request.
server.key: The private server key, does not require a password when starting Apache.
server.key.secure: The private server key, it does require a password when starting Apache.

If you took route 1B and created a CA, you’ll have two additional files:

ca.crt: The Certificate Authority’s own certificate.
ca.key: The key which the CA uses to sign server signing requests.

The CA files are important to keep if you want to sign additional server certificates and preserve the same CA. You can reuse these so long as they remain secure, and haven’t expired.

Setting up SSL: openSuSE :
(1) Make your keys and copy them into position.
Copy the resulting files into these locations. It’s possible to put them somewhere else and change the reference in the appropriate conf file in a later step, but these are the default locations:

cp server.key /etc/apache2/ssl.key
cp server.crt /etc/apache2/ssl.crt
cp server.csr /etc/apache2/ssl.csr
 
(2) Create an SSL document root directory.
Since /srv/www/htdocs is the location for HTTP, I suggest /srv/www-ssl/htdocs for SSL delivered pages. That way you might later consider a /srv/www-ssl/cgi-bin to compliment the /srv/www/cgi-bin (to mirror the architecture and make certain relative pathing easier to deal with depending on how you write applications). But that’s your call. Create some directory to serve SSL pages. The last command creates a little dummy index.html file for testing purposes.

cd /srv
mkdir www-ssl
cd www-ssl
mkdir htdocs
cd htdocs
echo “ssl index page”>index.html
 
(3) Direct Apache to load the ssl module and start up with ssl capability.
Edit /etc/sysconfig/apache2. Add “ssl” to the end of the following list of apache modules to load:

APACHE_MODULES=”access actions alias auth autoindex cgi dir include log_config \
mime negotiation setenvif status userdir asis imap php4 ssl”
Add “SSL” to the Apache startup server flags:

APACHE_SERVER_FLAGS=”SSL”
 
(4) Direct Apache to listen to the right ports.
Edit /etc/apache2/listen.conf. Add your server’s IP or fully qualified domain name (if you have one) to the listen directive for port 80:

Listen xxx.xxx.xxx.xxx:80
Do the same for the SSL port, assuming you’re serving from the standard 443 (scroll down just a bit to the section inside <IfDefine SSL>):

Listen xxx.xxx.xxx.xxx:443
 
(5) Set up a virtual host conf file for the SSL port.
Go to /etc/apache2/vhosts.d. Copy vhost-ssl.template over to vhost-ssl.conf to use as a template:

cp vhost-ssl.template vhost-ssl.conf
Go inside vhost-ssl.conf and make sure the following are set:

<VirtualHost _default_:443>

DocumentRoot “/srv/www-ssl/htdocs”
ServerName xxx.xxx.xxx.xxx:443
ServerAdmin youremail@yoursite.org

Make sure the SSLEngine is on, and the SSLCertificateFile and SSLCertificateKeyFile point to the ssl.crt and ssl.key you created with the openssl commands. If you went with default locations in an earlier step, you shouldn’t have to make any special changes in this regard.

Just before the </VirtualHost> directive is closed, add the following, making tweaks as necessary for your environment. If you don’t make a directory directive, the SSL instance won’t know where to look for the doc root.

<Directory “/srv/www-ssl/htdocs”>
AllowOverride None
Order allow,deny
Allow from all
</Directory>
 
(6) Open up the ports on your firewall.
Go to YaST -> Security & Users -> Firewall -> Allowed Services

Make sure that HTTP and HTTPS are enabled for the External Zone. Note that this mechanism assumes port 80 and port 443 respectively. If you want to set up HTTP or HTTPS on a different port (for instance, 8080 or 444) you need to go to the Advanced screen and manually type in the port number under “TCP Ports” and describe the protocol you’re adding (for example, HTTP or HTTPS) in the last line under “IP Protocols.” If you have a router, it probably carries additional firewall rules. You’ll need to open up the appropriate port(s) there as well. That’s beyond the scope of this document, but should be in the docs that pertain to your hardware.

(7) Restart apache2.
 
cd /etc/init.d
./apache2 restart
Done — test it out.
 

NOKIA Developer Discussion Forum Security Breach

Tuesday, August 30th, 2011

The developer.nokia.com/community discussion forum was offline and under maintenance for sometime now, only for Nokia to officially announce that the forum had had a security breach. I quote :

During our ongoing investigation of the incident we have discovered that
 a database table containing developer forum members' email addresses 
has been accessed, by exploiting a vulnerability in the bulletin board 
software that allowed an SQL Injection attack. Initially we believed 
that only a small number of these forum member records had been 
accessed, but further investigation has identified that the number is 
significantly larger.

The database table records includes members’ email addresses and, for 
fewer than 7% who chose to include them in their public profile, either 
birth dates, homepage URL or usernames for AIM, ICQ, MSN, Skype or 
Yahoo. However, they do not contain sensitive information such as 
passwords or credit card details and so we do not believe the security 
of forum members’ accounts is at risk. Other Nokia accounts are not 
affected.

Official announcement can be found here :

http://www.developer.nokia.com/Community/Discussion/content.php


				

No more Internet Explorer 6

Saturday, March 6th, 2010

As of March 1st, 2010, Google has dropped support for Microsoft longest standing web browser, the IE6. Meaning that Google docs, Google Apps, Gmail and all other Google services will no longer support the ageing browser in an effort to introduce new features to these services.

IE vulnerability exploit code released on the Internet

Saturday, January 16th, 2010

Exploit code for the zero-day hole in Internet Explorer linked to the China-based attacks on Google and other companies has been released on the Internet, Microsoft and McAfee warned on Friday.

Meanwhile, the German federal security agency issued a statement on Friday urging its citizens to use an alternative browser to IE until a patch arrives.

More on this issue here.

Microsoft Security Essentials available for free download

Tuesday, September 29th, 2009

Microsoft Security Essentials provides real-time protection for your home PC that guards against viruses, spyware, and other malicious software.

Now, it’s available for free download at : http://www.microsoft.com/Security_essentials/

Web Browser Market Share Report

Tuesday, September 15th, 2009

According to market research firm Net Applications, Internet Explorer had roughly 67 percent of the worldwide browser market in August, while the Mozilla foundation’s Firefox had 23 percent and Apple Inc’s Safari browser had 4 percent. This was true on Aug 2009.

web-browsers-share1

Using Clam AntiVirus to provide real-time protection for your iFolder 3 Server

Sunday, September 13th, 2009

“Because iFolder is a cross-platform distributed solution, there is a possibility of a virus infection on a platform migrating across the iFolder server to other platforms, and vice versa. You should enforce server-based virus scanning to prevent viruses from entering the corporate network.”

This solution applies for openSuSE 11.1 :

The following packages need to be installed :

clamav
dazuko
postfix

Execute modprobe dazuko (as root)

Run lsmod and check that dazuko is loaded:

Edit /etc/init.d/boot.local

  • Add:
    modprobe dazuko

Edit /etc/clamd.conf

Enable logging by activating :
LogFile /var/log/clamd

* Activate:
# Path to a local socket file the daemon will listen on.
LocalSocket /var/lib/clamav/clamd-socket

* Deactivate:
# TCP port address.
#TCPSocket 3310

* Deactivate:
# TCP address.
#TCPAddr 127.0.0.1

* Activate and edit:
# Execute a command when virus is found.
VirusEvent /bin/echo “iFolder VIRUS ALERT: %v” | /bin/mail -s “ClamAV – iFolder” -r ClamAV@server.domain ToUser@domain

* Deactivate:
# Run as a selected user (clamd must be started by root).
#User vscan

Note:
If not deaktivating “User vscan” you receive the error: “clamuko cannot connect to dazuko” in /var/log/clamd

* Clamuko settings, Activate the following :

ClamukoScanOnAccess yes
ClamukoScanOnOpen yes
ClamukoScanOnClose yes
ClamukoScanOnExec yes
ClamukoIncludePath /YOUR_PATH_TO_IFOLDER/ifolder/simias/SimiasFiles

Change any other settings in the file to reflect your needs (see ClamAV documentation).

Start clamd:
/etc/init.d/clamd start

Check that clamd was started without any errors:
tail -f /var/log/clamd

Download the EICAR test signature from:
http://www.f-secure.com/virus-info/eicar_test_file.shtml

Note!
This is not a real virus.

Run: tail -f /var/log/clamd

Save the test file (eicar.zip and/or eicar.com) in your iFolder and wait for sync.

When the virus pattern is detected you should see this (see below) in the log file
/var/log/clamd.

Check that a mail has been sent: tail /var/log/mail

Update ClamAV:
You can update ClamAV using the command: freshclam

A better way is to use the freshclam daemon for automatic updates.

Settings for freshclam: /etc/freshclam.conf

Edit /etc/freshclam.conf

  • Activate:
    # Path to the log file (make sure it has proper permissions)
    UpdateLogFile /var/log/freshclam.log
  • Activate and provide your country code:
    # Uncomment the following line and replace XY with your country code.
    DatabaseMirror db.se.clamav.net
  • Activate and provide update interval (e.g 24 for every hour):
    # Number of database checks per day.
    Checks 24

Create a log file for freshclam:
touch /var/log/freshclam.log

Set file rights:
chown vscan:vscan /var/log/freshclam.log

Start freshclam:
/etc/init.d/freshclam start

Check the log file:
tail /var/log/freshclam.log

Activate automatic start for clamd, freshclam and postfix from Yast –> System –> System Services (Run Level).

Now you have a real-time anti-virus scanning for your iFolder3 server.

Warning over Michael Jackson email virus

Friday, July 3rd, 2009

Computer security firm Sophos issued a warning about an Internet virus transmitted from a mass email claiming to contain secret songs and photos of Michael Jackson.

The email comes with the subject “Remembering Michael Jackson” and is sent from “sarah@michaeljackson.com”, Sophos said in a statement sent by its Asia office in Singapore.

It tells recipients that an attached file titled “Michael songs and pictures.zip” contains secret songs and photos of the pop music icon, who died of a heart attack in the United States on June 25.

Sophos warned computer users not to open the attachment.

“By opening the attachment, computer users are exposed to infection. Once infected, a computer will begin automatically spreading the worm onto other Internet users,” Sophos said.

“Besides spreading via email, Sophos experts note that the malware is also capable of spreading as an Autorun component on USB memory sticks.”

Graham Cluley, a senior technology consultant at Sophos, said many computer users are likely to be tempted to open the attachment because of the feverish interest in the King of Pop’s sudden death.

“But sensible computer users should by now be well aware that cybercriminals will be quick to exploit news events to spread malware and spam,” he said.

“Anyone who receives this email should delete it immediately to save themselves the embarrassment of infecting their email contacts.”

ESET Smart Security Wins CNET Editors’ Choice Award

Friday, May 8th, 2009

ESET, the leader in proactive threat protection, today announced that it received a CNET Editors’ Choice award for ESET Smart Security 4, the recently updated integrated security solution combining antivirus, anti-spyware and anti-spam functionality with a personal firewall. The coveted CNET Editors’ Choice award recognizes outstanding consumer electronics that represent the best available choice for quality, performance, design, service, value, and its logo is a mark of excellence denoting the best possible investment for consumers.

CNET Editors’ Choice winners are recognized as top products in their respective technology categories, and contribute to the standard by which all future products are judged. A key selection requirement is that it must also change the competitive landscape of its market, whether through innovative features, exceptional value for the price, remarkable ease of use, or a demonstrable boost to the lives of its users.

“ESET Smart Security is surprisingly light, consuming around 50MB of RAM when running, and ESET NOD32 has consistently scored near the top of several independent antivirus testing organization ratings for finding the most malware while encountering fewer false positives than most,” said Seth Rosenblatt, senior associate editor, CNET Downloads. “For getting all your security tools in one box, Smart Security is an effective and well-respected choice.”

“We are very excited about this honor from CNET as their Editors’ Choice award has become the hallmark of technology quality and innovation, and its logo is a symbol consumers know and trust,” said Anton Zajac, CEO, ESET LLC. “This is an exceptional achievement and we are very proud to be recognized for our dedication and commitment to providing users with the most advanced protection from evolving security threats.”

Built on the same engine that powers ESET NOD32 Antivirus, ESET Smart Security 4 also features anti-spam and firewall functionality, both of which received high marks in usability and effectiveness. ESET’s detection and diagnostic features safeguard users from deceptive forms of malware by digging deeper into the operating system, files and encrypted browser traffic to identify and eliminate hidden malware threats. ESET Smart Security 4 proactively blocks most new malware attacks before they can compromise systems or steal data.

For information on ESET Smart Security 4 and the CNET Editors’ Choice award, please visit http://www.cnet.com/editors-choice


ADAOX Launches ESET Smart Security 4 and ESET NOD32 4 In The Middle East

Friday, March 6th, 2009

ADAOX Middle East, the regional business development centre of ESET NOD32 Antivirus, today announced the launch of the latest versions of ESET’s award-winning security solutions – ESET Smart Security 4 and ESET NOD32 Antivirus 4 in the Middle East region. ESET’s new generation security solutions deliver its most effective protection against emerging threats. Built on the unique and time-tested ThreatSense technology that has made ESET into a leader in proactive protection – ESET Smart Security 4 and ESET NOD32 Antivirus 4 – were optimized for even greater protection and enhanced usability, while retaining their signature small system footprint.

“We are delighted to launch ESET Smart Security 4 and ESET NOD32 Antivirus 4 to our customers in the Middle East, who have come to trust ESET’s proactive protection immensely. Version 4 of these security solutions surpasses all previous versions and is the most effective software to combat malware and emerging threats.We are confident these new security solutions will be well received by our customers and partners in this region,” said Neo Neophytou, Managing Director of ADAOX Middle East.

Key benefits:

o Protection from the Unknown – Award-winning ThreatSense technology delivers the most effective protection against new attacks on the market.
o Built for Speed – ESET’s solutions are lightning fast, delivering superior scanning performance.
o Easy on System Resources – ESET typically uses only 35-40MB of system memory, a fraction of what other products consume. Laptop users will welcome the new automatic energy-conserving battery mode.
o Easy on You – more user friendly than ever before – from the compact and intuitive interface, the minimal use of alerts, to self-training firewall – you will be up and running in a snap, hardly noticing the solution quietly working in the background.

Users at home, but especially in SMB and large enterprises will come to appreciate dozens of useful new features and improvements in usability. On top of being faster and lighter, in ESET Smart Security 4 and ESET NOD32 Antivirus 4 include the following:

Self-Defense – a built-in technology to prevent malicious software from corrupting or disabling the system’s security.
SysRescue – allows user to create computer recovery medium on a CD and USB key for system boot-up.
Portable media access control, including USB, CD, flash disc, closing this vector of potential malware infiltration.
Encrypted communication – developed for Windows XP and Windows Vista to scan HTTPs and POP3s protocols for malware. Included is also the so-called “learning mode,” for the state-of-the-art firewall, affording even greater level of protection.
Support of More E-mail clients, including Windows Mail, Windows Live Mail and Mozilla Thunderbird
Non-Graphical User Interface with the option to switch automatically to high contrast mode when in Windows.
Smart Optimalization – function permitting increase in the scanning speed
Integrated ESET SysInspector – a powerful diagnostic tool for in-depth analysis of the operating system, including running processes, registry content, startup items and network connections.
Integrated Anti-Stealth – advanced technology to protect against rootkits
Support for CISCO Network Admission Control

“ESET Smart Security 4 is the result of ESET´s continuous quest for perfection in PC security. We´ve in essence created artificial intelligence that is incredibly efficient and fast in recognizing malware,” Miroslav Trnka, CEO of ESET.
ESET Smart Security 4 was developed as a highly streamlined solution integrating 4 functionalities: antivirus, antispyware, antispam, and a personal firewall.

ESET Smart Security 4 Business Edition includes a Remote Administrator and a LAN update “mirror” function to easily monitor and update workstations across large networks.

ESET NOD32 Antivirus 4 is the company’s flagship solution incorporating antivirus and antispyware functionalities.

ESET NOD32 Antivirus 4 Business Edition includes a Remote Administrator and a LAN update “mirror” to easily monitor and update workstations.

The Latest, 4th generation of ESET Smart Security and ESET NOD32 will be available starting March 2nd, 2009. License holders of previous versions can take advantage of a free update.

Please refer to the following URL for your free trial product download :
http://www.am4computers.com/main/viewProducts.php?Category=106