Senin, 05 Desember 2005

Tools Used in USENIX Day One Class

I'm teaching Network Security Monitoring in about 12 hours here at USENIX LISA 2005. If any of you attendees would like to try the tools in the slides, I'm posting links to their home pages. You can download them to your machines if you like!


Here are the traces sf0.lpc and em0.lpc.

Sabtu, 03 Desember 2005

Adding Multiple Users and Setting Quotas on FreeBSD

I am setting up a VM for students in my USENIX LISA classes next week. While I would prefer students to use tools on their own laptops to analyze packet traces I provide, I realize some may not be able to get all of the requisite software working. Rather than leave them stranded, I am deploying a FreeBSD 6.0 VM that will run on my laptop. Students can SSH to the VM and analyze traces there. Alternatively, I plan to create a simple VM that students can run in VMware Player.

I decided I would create 33 student accounts, named student0 - student32. I would perform demos as student0. I was not about to run adduser 33 times to create the necessary accounts, so the following shows how I added those accounts using a simple shell script.

First I created a default configuration file using the -C switch.

samsonov:/root# adduser -C
Login group []:
Enter additional groups []:
Login class [default]:
Shell (sh csh tcsh bash nologin) [sh]: bash
Home directory [/home/]:
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]:
Lock out the account after creation? [no]:
Pass Type : yes
Class :
Groups :
Home : /home/
Shell : /usr/local/bin/bash
Locked : no
OK? (yes/no): yes
Re-edit the default configuration? (yes/no): no
Goodbye!

Next I tested out creating the student0 account using the pw command. The syntax says add user student0, with password same as the username (-w yes), create the home directory /home/student0, and set student0 as the GECOS field. (Obviously a student0/student0 username/password combination is not suitable in production, but it's just what I want in the classroom.)

samsonov:/root# pw useradd student0 -w yes -m -c student0

Now I test to see that the process worked by checking for a new /etc/passwd entry and the appropriate home directory.

samsonov:/root# grep student0 /etc/passwd
student0:*:1002:1002:student0:/home/student0:/bin/sh
samsonov:/root# ls -al /home/student0/
total 20
drwxr-xr-x 2 student0 student0 512 Dec 3 21:00 .
drwxr-xr-x 5 root wheel 512 Dec 3 21:00 ..
-rw-r--r-- 1 student0 student0 767 Dec 3 21:00 .cshrc
-rw-r--r-- 1 student0 student0 248 Dec 3 21:00 .login
-rw-r--r-- 1 student0 student0 158 Dec 3 21:00 .login_conf
-rw------- 1 student0 student0 373 Dec 3 21:00 .mail_aliases
-rw-r--r-- 1 student0 student0 331 Dec 3 21:00 .mailrc
-rw-r--r-- 1 student0 student0 797 Dec 3 21:00 .profile
-rw------- 1 student0 student0 276 Dec 3 21:00 .rhosts
-rw-r--r-- 1 student0 student0 975 Dec 3 21:00 .shrc

It looks like pw worked as advertised. Next I write a simple while loop shell script to create users student1-student32.

samsonov:/root# cat add_multiple_users.sh
#!/usr/local/bin/bash
i=1
while [ $i -lt 33 ]
do
pw useradd student$i -w yes -m -c student$i
i=$[$i+1]
done

After running the script, I see my new users are added.

samsonov:/root# tail /etc/passwd
student23:*:1025:1025:student23:/home/student23:/bin/sh
student24:*:1026:1026:student24:/home/student24:/bin/sh
student25:*:1027:1027:student25:/home/student25:/bin/sh
student26:*:1028:1028:student26:/home/student26:/bin/sh
student27:*:1029:1029:student27:/home/student27:/bin/sh
student28:*:1030:1030:student28:/home/student28:/bin/sh
student29:*:1031:1031:student29:/home/student29:/bin/sh
student30:*:1032:1032:student30:/home/student30:/bin/sh
student31:*:1033:1033:student31:/home/student31:/bin/sh
student32:*:1034:1034:student32:/home/student32:/bin/sh

samsonov:/root# ls /home/
.snap student13 student2 student26 student32
richard student14 student20 student27 student4
student0 student15 student21 student28 student5
student1 student16 student22 student29 student6
student10 student17 student23 student3 student7
student11 student18 student24 student30 student8
student12 student19 student25 student31 student9

At this point I have my users. Now I turn to setting up per-user quotas. I do not want a rogue user to decide to use up all of /home, so I need a mechanism to enfore a per-user disk usage quota. I do that with file system quotas.

I have to add 'options QUOTA' to my kernel configuration file, and then rebuild the kernel to enforce quotas. I also need to add the following to /etc/rc.conf:

enable_quotas="YES"
check_quotas="NO"

After rebooting, quotas are enabled.

samsonov:/root# quota -v
quota: /home/quota.user: No such file or directory
Disk quotas for user root (uid 0): none

Now I can set a quota for student0. I set a soft limit of 100MB and a hard limit of 120MB.

samsonov:/root# edquota -u student0
edquota: creating quota file /home/quota.user

Quotas for user student0:
/home: kbytes in use: 0, limits (soft = 100000, hard = 120000)
inodes in use: 0, limits (soft = 0, hard = 0)

Checking the quotas, I see they are working.

samsonov:/root# quota -v student0
Disk quotas for user student0 (uid 1002):
Filesystem usage quota limit grace files quota limit grace
/home 0 100000 120000 0 0 0

The easiest way to set the same quotas for students1-32 is to use the -p option to specify a user whose quota one wants to duplicate, followed by the UIDs of the users to which the new quota will be applied.

samsonov:/root# edquota -p student0 1002-1034

Now I check to see if student1 has the same quotas as student0.

samsonov:/root# quota -v student1
Disk quotas for user student1 (uid 1003):
Filesystem usage quota limit grace files quota limit grace
/home 0 100000 120000 0 0 0

All done!

Kamis, 01 Desember 2005

Should I Accept New ISC(2) Certification Agreement?

Today I received an email from the International Information Systems Security Certification Consortium, Inc., ISC(2), that read, in part:

"The purpose of this notice is to provide information regarding the status of your (ISC)² certification.

Our records indicate that your anniversary date is near and your Annual Maintenance Fees are current. As you are aware, a total of 120 Continuing Professional Education (CPE) credits, of which at least 80 must be Type 'A' credits, are required to be submitted during each three year certification period in order to maintain your credential. Our records indicate that, based upon your CPE submissions to date, you are not on track to meet your recertification requirements at the end of the three year period. We urge you to pay close attention to this matter to avoid the expiration of your CISSP credential."

OH NO! Time for me to log in to the ISC(2) Web site to record in some of the hundreds of CPEs I haven't logged. However, as soon as I entered my credentials, I see this:


Certification Agreement

IT IS IMPERATIVE THAT YOU CAREFULLY READ THE FOLLOWING TERMS AND CONDITIONS. IF YOU ACCEPT ALL OF THE TERMS AND CONDITIONS CONTAINED IN THIS AGREEMENT, INDICATE BY SELECTING THE "ACCEPT" BUTTON AT THE BOTTOM OF THIS AGREEMENT. IF YOU DO NOT ACCEPT ALL OF THE TERMS AND CONDITIONS CONTAINED HEREIN, INDICATE BY SELECTING "DECLINE". IF YOU DO NOT ACCEPT THE TERMS OF THIS AGREEMENT, YOU SHALL NOT OBTAIN CERTIFICATION AND YOU MAY NOT USE THE CISSP, SSCP or CAP LOGOS.

This Certification Agreement ("Certification Agreement") is entered into as of the date set forth ("Effective Date") on the Application Agreement ("Application Agreement") by and between the undersigned ("Certification Candidate") and the International Information Systems Security Certification Consortium, Inc. "(ISC)²".



This doesn't look so great. As I read through the text (which you can retrieve as a .pdf here, I find this section (all emphasis additions are mine):



6. CONFIDENTIALITY.

6.1 Certification Candidate agrees that to the extent (ISC)² previously disclosed or currently or subsequently discloses to the Certification Candidate, or the Certification Candidate learns from (ISC)², information relating to (ISC)²'s Exams, products or sensitive aspects of (ISC)²'s business (including without limitation, computer programs, names and expertise of employees and consultants, know-how, business, financial, customer and product development plans, forecasts, questions, answers, worksheets, computations, drawings, diagrams, length and/or number of Exam segments and/or questions, or any communication, including verbal communication regarding or related to the Exam, the identity of Exam administrators, and other Exam takers, price and cost data, price and fee amounts, pricing and billing policies, marketing techniques, future plans and potential strategies of (ISC)² which have been or are being discussed), such information shall be deemed the confidential property of (ISC)² ("Proprietary Information"). Certification Candidate recognizes and acknowledges that (ISC)²'s Proprietary Information (and the confidential nature thereof) is critical to (ISC)²'s business and that (ISC)² would not enter into this Agreement without assurance that its Proprietary Information and the value thereof will be protected as provided in this Section and elsewhere in this Agreement.

6.2 Certification Candidate agrees (i) to hold (ISC)²'s Proprietary Information in confidence as a fiduciary and to take all reasonable precautions to protect such Proprietary Information, (ii) not to use such Proprietary Information at any time during or following the term of this Agreement, except as contemplated by this Agreement, and (iii) that to not disclose, publish, disclose, reproduce or transmit any Proprietary Information to any third party, in any form, including without limitation, verbal, written, electronic or any other means for any purpose.

Are they serious? What am I supposed to do with this confidential and proprietary information from the front matter of the CISSP Prep Guide?

"The Examination The examination questions are from the CBK and aim at the level of a three to five-year practitioner in the field. It consists of 250 English language questions, of which 25 are not counted..."

I am honestly considering clicking the "do not accept" button. I wonder if this blog post will upset ISC(2) enough to revoke my CISSP anyway?



2.2 Certification Revocation. (ISC)² may, at its sole discretion, revoke a Certification Candidate's certification under the following circumstances:
...edited...
2.2.5 Upon (ISC)²'s determination at its sole discretion that Certification Candidate has acted in any manner contradicting the (ISC)² Code of Ethics, that sullies or reflects poorly on the Mark, or involves any form of dishonesty or the giving of a false statement...



What should I do? Have you accepted this new "agreement?"

Sguil 0.6.0 Released

Today Bamm Visscher released Sguil 0.6.0. I am still working on an updated Sguil Installation Guide for Sguil 0.6.0 on FreeBSD 6.0. I am working on a VM that is a self-contained Sguil installation suitable for running as a demo in VMware Player. Perhaps while I am teaching at USENIX LISA next week I will have a chance to finish it.

Speaking of VMs, VMware Workstation 5.5 was released today too.

Visit to Fidelis Security Systems

Over two years ago I mentioned an extrusion prevention product by Fidelis Security Systems called DataSafe (TM). This week I got a call from Tim Sullivan, CEO of Fidelis, who had a copy of my new Extrusion Detection book on his desk. We had exchanged emails months before the book was published, but I never got a chance to look at his company until today. Tim invited me to lunch with some of his team, so I visited his Bethesda, MD offices and got a look at DataSafe.

In brief, I was very impressed by what I saw. DataSafe is an extrusion prevention product that sits either inline or off a tap or SPAN port. The product is software that is installed on Red Hat Enterprise Linux, watching outbound traffic for content deemed to be in violation of a security policy. It can make alert, block, or TCP kill decisions based on its configuration and deployment mode. The following graphic from the architecture page hints at some of DataSafe's capabilities. The four items are not really "steps" in a process. Rather, they are different ways DataSafe can decide if content leaving the network should be passed or blocked. DataSafe implements port-neutral inspection methods (e.g., Web inspection is not tied only to well-known HTTP ports) to identify content. The examples I saw were fairly interesting, such as detecting HTTP -> Google Mail -> MIME encoded attachement -> Zipped file -> Word document -> sensitive account data.

As an analyst I am always sensitive to the amount of data provided to the product operator. Is there enough information given to make a decision, or does the analyst see only an alert with little supporting evidence? I was very pleased to see DataSafe provide guidance on why it alerted (regular expressions, etc.) and what it found. In other words, I could see the sensitive information in the alert itself.

Incidentally, Gene Savchuk, the original author of the Mudpit unified output reader for Snort, and the SNORTRAN (.pdf) optimizing compiler for Snort rules, is the main developer of DataSafe.

If you're looking for a way to identify outbound traffic, and control what leaves your network, I recommend contacting Fidelis.

Engineering Disasters in Information Security Magazine

The December 2005 issue of Information Security magazine features an article I wrote titled History Lessons with the subtitle "Digital security could learn a lot from engineering's great disasters." It is based on this blog entry describing analog engineering disasters like the 1931 Yangze River damn failure, the 1944 Cleveland LNG tank fire, the 1981 Kansas City Hyatt Regency hotel walkway collapse, and the 1933 Atlanta Marriott parking lot sink hole.

I am considering expanding this topic of digital security disasters to encompass a new book. I would like to take a historical and technical look at digital security failures on a case-by-case basis. Ideally the cases would be based on testimony from witnesses or participants wishing to (anonymously) share lessons with their colleagues.

My concept is simple: when a bridge fails in the "analog" world, everyone knows about it. The disaster is visible, and engineers can analyze and learn from the event. The lessons they take away make future bridges stronger and safer. I do not see this happening in the digital world. Organizations suffer disasters all the time due to poor techniques, tools, configuration, management decisions, and so on. Unfortunately, few people ever hear about these problems, so they are repeated elsewhere. The only parties to benefit are intruders. Security engineers never get to learn from the mistakes of others.

What would a sample story look like? As a simple example, I know of an ISP who suffered a two hour router ACL drop that allowed remote intruders to exploit their development network. The ISP suffered a major compromise by Russian intruders that required a dedicated multi-week, guerilla-warfare incident response effort. Several lessons can be learned: (1) a router with an ACL is not a firewall, especially when you can attack any high port using source port 20 TCP; (2) development networks with unpatched machines should not bear publicly routable IP addresses and be Internet facing; and (3) there is value in monitoring to detect when your defensive measures fail.

Would any of you be willing to share your stories with me? I would be willing to communicate in any reasonable manner you wish to preserve your identities and sensitivities. The goal of the book is to provide real-world cases that can teach lessons to fellow security engineers. I am not trying to embarrass or humiliate anyone. I do not expect to hear any company or personal names, and if you still provide them I will not repeat them in the book. I am most interested in stories that have plenty of technical details.

Please email your thoughts to richard at taosecurity dot com. Thank you.

Organizations Don't Remediate Threats

I noticed the following in a Qualys press release cited by SC Magazine:

"'The Laws of Vulnerabilities research gives security managers and executives clear, statistical information that helps them make better informed decisions,' said Howard A. Schmidt, former cyber security advisor to the President.

'With automated attacks creating 85 percent of their damage within the first fifteen days, it is even more critical that organizations act quickly to identify and remediate threats.'" (emphasis added)

Mr. Schmidt is not using the term threat properly here. "Organizations" cannot remediate "threats". The definition of remediate is "set straight or right; 'remedy these deficiencies'". The word "deficiencies" in the sample usage is a direct reference to vulnerabilities.

The only way to remediate a threat would be to capture and/or incapacitate the party exploiting an asset. Assuming we can accept this stretch of the term, only law enforcement or the military could act against threats in this manner. Hence, (civilian) organizations don't "remediate threats."