Tuesday, December 16, 2014

Security: IT's Chronic Disease

Technology has a chronic disease.  If IT were a patient, it would be covered in lesions and leaking out of every orifice.  This disease is how your credit cards are stolen, your private pictures are proliferated, your favorite website taken down -- by hackers using malicious software (malware) that's crippled IT.  These tidbits aren't newsworthy if you're a cynic because they've been plaguing us for decades.  I'm an optimistic technologist who thinks being more forthcoming the diagnosis and treatment of IT security will reveal -- not a cure -- a healthier.

Immune System

Technologists do have systems for diagnosing and treating software "diseases" at a global scale.  I'm not talking about installing anti-virus on your laptop.  I mean something on par with the WHO or CDC for computers.  There are technical institutions that take the lead in identifying, squelching, fixing, and tracking software vulnerabilities.  The most notable institutions are the MITRE quasi-government corporation and the SANS Institute, the infamous Open Software Foundation (OSF); yet the public's probably heard of none of these institutions.  (See IEEE resources on cybersecurity).  The public only hears about are the hacks themselves, and the typical mantra of "change your password" and "install anti-virus"!  Technologists should be our own advocates when it comes to best practices in actually securing legitimat, online use.  MITRE, for example, maintains the list of known malware but has only a limited capacity for informing the mass public about avoidance measures.  Technologists merely use their "disease coding" system (called CVE) much like doctors and insurers use to identify and catalog malware.  Technology can have more "doctors" and "vaccinations" for these malwares and we've made progress on getting cures out to prevent computer infections, such as integrating automated update and patching solutions.  The biggest producers of consumer software -- Microsoft, Apple, and Google -- (can) push these vaccinations to our laptops, smartphones, and tablets.

What technologists do not have is a computer immune system.  This is a critical need because anything online is under constant attack.  Securing technology has shifted from reactive to proactive because of the increased risks with the Internet of Things (IoT).  We seldom implement automated security systems that are on par with our more robust, biological immune systems.  Technologists might install some "skin" in the form of a firewall that protects the outer shell of technology, and we probably install a baby's "newborn white cells" in the form of immature anti-virus scanners, and hopefully we will throw in a basic "diary" that logs a glimpse of what computers are exposed to, but we don't implement mature, robust IT security.  This immature, computer immune bandaid is the reason websites are still hacked, your pictures stolen, and fraudulent purchases appear on your credits cards.  Technologists, however, have the potential to be more effective than human doctors in treating this disease.

Security (Mis)persception

As constant consumers of technology, we can be more informed and educated about modern IT security needs.  IT security had been, in my experience, the purview of computer networking teams instead of application or DevOps teams.  The upside to a preoccupation with network security is a relatively better defense at the lower levels of the OSI model, including the risks from physical access and operation.  The immunity gap is at the upper OSI layers where online applications sit.  I've been watching the MITRE/SANS reports on software security, in addition to the OSVDB (Open Software Vulnerability DataBase) and noticed these reports mimic some of the headlines of hacks.  Dangerous file uploads, session hijackings, SQL injection -- these headlines are in the top computer software "diseases".  OSVDB's trends upto 2014 give a quick view of vulnerabilities that mimic those listed in the MITRE/SANs report of 2011 (which itself changed little from the 2010 and 2009 reports).  This indicates to me that application vulnerabilities are a primary culprit in modern, IT insecurity.  Also, an analysis of software libraries in 2012 indicated that the increasing dependency on programming frameworks further exacerbates the "infection" beyond your own code or operating container.  When I subscribe to a security fix mailing list for one those big producers of consumer software, I notice a lot of libraries showing up that are dependencies of services and application containers.  So the elephant in the room is technologist's and consumer's (mis)perception of what is most at risk for modern technology.

I went back to the catalog of software vulnerabilities and reduced the CVE type lists to just the Top 10 "Cures" that will change our perceptions of security risks.  The list is devoid of what technologists typically discuss during security debates: denying remote access (via network firewalls), difficult passwords that rotate (via password policies), anti-virus scanning, etc.  Nada.  Instead, these vulnerabilities are found in higher layers of the OSI model, like the application itself or application server:
  1. use DB frameworks and static queries, do not make direct SQL calls or dynamic queries
  2. use jailboxes and programmatic interfaces, do not call the system directly
  3. validate all data input and verify buffers at build time, do not assume you'll get normal stuff
  4. do force document encoding and compliance, do not assume you'll get normal documents
  5. use authentication and authorization frameworks including roles, do not flatten or hard code credentials
  6. same as #5; mandatory access controls that deny everything by default are tedious and the most secure
  7. same as #6, do not embed passwords in code or configuration
  8. do use data encryption libraries, do not assume authentication or authorization will secure privacy
  9. same as #3 including file MIME type too, do not assume you'll get a normal file 
  10. do favor stateless sessions and verify state changes, do not trust stateful user sessions
To detect these top vulnerabilities in applications already running, proactive testing of the operating environment from which applications are running is needed.  In other words, we need more White Hats.  To prevent these vulnerabilities from appearing _before_ applications are brought online, we need due diligence during development.

Behavior Change

As I release my next application, I'm going to try a White Hat approach with due diligence.  Some tools to use during development are cross-referencing MITRE's mitigations and the above guideline Cures to see how often these vulnerabilities appear while I'm coding.  Here's the full MITRE/SANS List 2014:

RankScoreIDName
[1]93.8CWE-89Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
[2]83.3CWE-78Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
[3]79.0CWE-120Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
[4]77.7CWE-79Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
[5]76.9CWE-306Missing Authentication for Critical Function
[6]76.8CWE-862Missing Authorization
[7]75.0CWE-798Use of Hard-coded Credentials
[8]75.0CWE-311Missing Encryption of Sensitive Data
[9]74.0CWE-434Unrestricted Upload of File with Dangerous Type
[10]73.8CWE-807Reliance on Untrusted Inputs in a Security Decision
[11]73.1CWE-250Execution with Unnecessary Privileges
[12]70.1CWE-352Cross-Site Request Forgery (CSRF)
[13]69.3CWE-22Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
[14]68.5CWE-494Download of Code Without Integrity Check
[15]67.8CWE-863Incorrect Authorization
[16]66.0CWE-829Inclusion of Functionality from Untrusted Control Sphere
[17]65.5CWE-732Incorrect Permission Assignment for Critical Resource
[18]64.6CWE-676Use of Potentially Dangerous Function
[19]64.1CWE-327Use of a Broken or Risky Cryptographic Algorithm
[20]62.4CWE-131Incorrect Calculation of Buffer Size
[21]61.5CWE-307Improper Restriction of Excessive Authentication Attempts
[22]61.1CWE-601URL Redirection to Untrusted Site ('Open Redirect')
[23]61.0CWE-134Uncontrolled Format String
[24]60.3CWE-190Integer Overflow or Wraparound
[25]59.9CWE-759Use of a One-Way Hash without a Salt

No comments:

Post a Comment