So it occurred to me that being a defender is twice as hard as being an attacker (at least). I don't mean that in an absolute or measurable sense of course, just in some sense that will become obvious. I also will limit the context of that claim to applications although it may apply to other areas of security as well.
The goal of an attacker is to find vulnerabilities in an application. An application is protected by defenders who design vulnerability mitigations and developers who implement functionality. Of course an attacker only needs to find a single weakness and a defender needs to try to protect against all attacks, which itself would probably support my claim, but it's not what my point is going to be.
Conversely, a defender's goal is to minimise the number of vulnerabilities in an application. Defenders attempt to realise this goal by designing defenses that both limit what the attacker can do and limit the flexibility the developer has. However, it is not only attackers that will hack away at a defenders defenses, it's also the developer. The point of this blog post is that developers show surprisingly similar characteristics to attackers when they create novel ways to circumvent the defense mechanisms defenders put in place. After all developers have the goal of implementing functionality with the minimum amount of effort as possible, and defenses often make that more difficult (even if only marginally more difficult).
Clearly the motivations are entirely different in the attackers and developers case, but at the end of the day the defenders are being attacked on twin fronts; by the attackers looking to get in and by the developers looking to break out.
Saturday, 28 April 2012
Monday, 23 April 2012
CVSS doesn't measure up.
I was doing some basic research into software metrics the other day and I came across something that I was probably taught once but had long since forgotten. It was to do with the way we measure things and is covered in the Wikipedia article on Level of Measurement.
Basically there are 4 different scales which are available to measure things:
Sometimes we have an Ordinal scale that looks like an Interval or Ratio scale, for instance when we assign a numeric value to the levels e.g. ask people how much they like something on a scale of 1 to 5. But this is still an Ordinal scale, and although we can assume that the difference between each level is a constant amount, nothing actually makes that true. Thus calculating the average amount that people like something e.g. 2.2, is often a meaningless number.
When reading about this I was reminded of the way vulnerabilities are categorised and how we would so dearly like to be able to assign numbers to them so we can do some math and reach some greater insight into the nature of the vulnerabilities we have to deal with. The Common Vulnerability Scoring System (CVSS) suffers essentially from this problem; vulnerabilities are assigned attributes from certain (ordered) categories, and then a complicated formula is used to derive a number in a range from 1 to 10. It is basically optimistic to think that a complicated formula can bridge the theoretical problem of doing math on values from an Ordinal scale. I wouldn't necessarily go to the other extreme and say it makes CVSS totally without merit - just that it's not the metric you likely wish it was.
Basically there are 4 different scales which are available to measure things:
- Nominal scale - Assigning data to named categories or levels.
- Ordinal scale - A Nominal scale but the levels have a defined order.
- Interval scale - An Ordinal scale but the difference between, or units, of each level are well defined.
- Ratio scale - An Interval scale but with a non-arbitrary zero-point.
Sometimes we have an Ordinal scale that looks like an Interval or Ratio scale, for instance when we assign a numeric value to the levels e.g. ask people how much they like something on a scale of 1 to 5. But this is still an Ordinal scale, and although we can assume that the difference between each level is a constant amount, nothing actually makes that true. Thus calculating the average amount that people like something e.g. 2.2, is often a meaningless number.
When reading about this I was reminded of the way vulnerabilities are categorised and how we would so dearly like to be able to assign numbers to them so we can do some math and reach some greater insight into the nature of the vulnerabilities we have to deal with. The Common Vulnerability Scoring System (CVSS) suffers essentially from this problem; vulnerabilities are assigned attributes from certain (ordered) categories, and then a complicated formula is used to derive a number in a range from 1 to 10. It is basically optimistic to think that a complicated formula can bridge the theoretical problem of doing math on values from an Ordinal scale. I wouldn't necessarily go to the other extreme and say it makes CVSS totally without merit - just that it's not the metric you likely wish it was.
Sunday, 15 April 2012
An idea for adding privacy to social media
It would be great if all the media that people upload to social media sites was still under the control of the owner and we didn't have to place complete trust in the social media site. Initially I thought that maybe OAuth might offer part of a solution, but really it isn't designed to solve this problem, it just allows you to share a resource on one web site with another web site. What we really want is to allow a user, the resource owner, to retain some control over their resources and not delegate all security to the social media site (to protect the innocent I'll reference a fictitious social media site called PinFaceTwitPlus).
Of course one way to protect a photo or video (a resource) that you upload is to encrypt it, but then you have 2 problems; where to put the encryption key and how to let people you share with decrypt the resource. Obviously PinFaceTwitPlus can't have the key or we haven't gained anything, and you yourself can't store the key since you would have to run your own server. So the solution would seem to be another service that was responsible for handing out decryption keys to those privileged few you have authorised to view your resource. Let's call this service PrivacyPoint.
Here is how I see this working from the point of view of adding a new resource to PinFaceTwitPlus. You go to PrivacyPoint in your browser, you select a locally stored photo and ask PrivacyPoint to protect it. In your browser PrivacyPoint encrypts the photo and embeds an encrypted key that can be used to decrypt the photo (the key is randomly generated and encrypted to a key unique to you), and also a reference to PrivacyPoint. You then upload the encrypted photo to PinFaceTwitPlus and share it with whoever amongst your friends is worthy.
How this works from a friends point of view is that when PinFaceTwitPlus wants to show them the photo, the encrypted version gets downloaded to their browser and the page determines that it needs to decrypt the photo, so using the embedded link to PrivacyPoint, it sends an identifier for the friend and the encrypted key to PrivacyPoint. Using the friends identifier PrivacyPoint asks PinFaceTwitPlus if the friend is allowed to view the photo, if they are PrivacyPoint decrypts the key and returns it to the friend whose browser can now locally decrypt the photo and display it.
The desirable properties of this system are these:
Clearly I have left out vast amounts of detail (lots of which would need to be thought through more thoroughly) as it's difficult to express it all in a blog post.
To be honest I wouldn't give this design high practicality points as it requires a fairly substantial infrastructure in order to work. Still, any practical system often starts out as something that's possible and evolves into something that's probable.
Of course one way to protect a photo or video (a resource) that you upload is to encrypt it, but then you have 2 problems; where to put the encryption key and how to let people you share with decrypt the resource. Obviously PinFaceTwitPlus can't have the key or we haven't gained anything, and you yourself can't store the key since you would have to run your own server. So the solution would seem to be another service that was responsible for handing out decryption keys to those privileged few you have authorised to view your resource. Let's call this service PrivacyPoint.
Here is how I see this working from the point of view of adding a new resource to PinFaceTwitPlus. You go to PrivacyPoint in your browser, you select a locally stored photo and ask PrivacyPoint to protect it. In your browser PrivacyPoint encrypts the photo and embeds an encrypted key that can be used to decrypt the photo (the key is randomly generated and encrypted to a key unique to you), and also a reference to PrivacyPoint. You then upload the encrypted photo to PinFaceTwitPlus and share it with whoever amongst your friends is worthy.
How this works from a friends point of view is that when PinFaceTwitPlus wants to show them the photo, the encrypted version gets downloaded to their browser and the page determines that it needs to decrypt the photo, so using the embedded link to PrivacyPoint, it sends an identifier for the friend and the encrypted key to PrivacyPoint. Using the friends identifier PrivacyPoint asks PinFaceTwitPlus if the friend is allowed to view the photo, if they are PrivacyPoint decrypts the key and returns it to the friend whose browser can now locally decrypt the photo and display it.
The desirable properties of this system are these:
- PinFaceTwitPlus does not have (direct) access to your resources - a vulnerability in PinFaceTwitPlus would not immediately leak user resources.
- Your resources do not pass through PrivacyPoint, even though PrivacyPoint could decrypt them - a vulnerability in PrivacyPoint would not immediately leak user resources.
- PinFaceTwitPlus is acting as a decision point for which of your friends can see which of your resources. This means it could add itself to your list of friends and grant itself access to your resources. What makes this issue potentially tolerable is that to access your resources it must ask PrivacyPoint for the decryption key, which means PrivacyPoint has a record of it asking; a record that would be viewable by you to audit who accesses your resources.
- PinFaceTwitPlus can impersonate any of your friends though, so in any access audit log it would just appear as a friend viewed your resource. I don't see a (sensible) technical solution to this, but I suspect there is pressure on PinFaceTwitPlus to not allow it's employees to impersonate it's users due to the negative business impact.
Clearly I have left out vast amounts of detail (lots of which would need to be thought through more thoroughly) as it's difficult to express it all in a blog post.
To be honest I wouldn't give this design high practicality points as it requires a fairly substantial infrastructure in order to work. Still, any practical system often starts out as something that's possible and evolves into something that's probable.
Monday, 9 April 2012
Good password paper
So I have just been reading A Research Agenda Acknowledging the Persistence of Passwords (I actually read it in the Jan/Feb 2012 issue of IEEE Security & Privacy) and I wanted to make a quick post about it so I would have a record to reference in the future and because I thought it was an excellent read that challenges the perceived wisdom of "passwords are bad, mmmkay". The point of the article is that is doesn't stand and up and say passwords are either good or bad, but that we lack the information to know that answer currently and that since there is no clear emerging solution on the horizon we have to take a more pragmatic approach to how we should be using passwords as a security solution.
Sunday, 1 April 2012
OWASP Web Defence Presentation
I went to the OWASP London meeting last Thursday where I watched the excellent Jim Manico give a presentation on the state of the art in web defences (presentation available here).
The talk was largely focused on the most common web app vulnerabilities and how to defend against them. If I was to over-simplify the message of the presentation I would say that it focused on training developers and giving them libraries to help mitigate the threats.
Whilst I agreed with everything that was said, and I fundamentally believe that training developers is an essential part of any SDLC, I would have liked to see the main emphasis be on developing frameworks that either virtually eliminate the vulnerability or allow for ease of auditing that developers are doing the right thing.
I actually had a chat with Jim in the pub after the presentation and asked him about the focus of his talk; it turns out we actually pretty much agree that web defences need to be part of a framework (and he was clearly better informed than I am about the state of the art in that department). His talk it seems was focused on the practical things that can be done today.
If I was going to give a similar presentation I think I would feel the need to focus on where we need to get to. To my mind vulnerabilities of all types, in any piece of software, are basically impossible to eliminate via training; this does not make training useless, training is still necessary, I just don't think it's sufficient.
We need to make our web applications secure by design, secure by default and security auditable. The first 2 principles are commonly understood, the last I think is something that I don't see people talking about and I think it is the direction we need to move in. Any framework will have the ability to bypass the default and do something insecure, and that's fine as that kind of flexibility is usually essential. What we need is the ability to easily find deviations from security best practice and focus our review efforts on those areas. Unless we can identify the weak links in our security chain we will never be able to get the kind of security assurance we want.
The talk was largely focused on the most common web app vulnerabilities and how to defend against them. If I was to over-simplify the message of the presentation I would say that it focused on training developers and giving them libraries to help mitigate the threats.
Whilst I agreed with everything that was said, and I fundamentally believe that training developers is an essential part of any SDLC, I would have liked to see the main emphasis be on developing frameworks that either virtually eliminate the vulnerability or allow for ease of auditing that developers are doing the right thing.
I actually had a chat with Jim in the pub after the presentation and asked him about the focus of his talk; it turns out we actually pretty much agree that web defences need to be part of a framework (and he was clearly better informed than I am about the state of the art in that department). His talk it seems was focused on the practical things that can be done today.
If I was going to give a similar presentation I think I would feel the need to focus on where we need to get to. To my mind vulnerabilities of all types, in any piece of software, are basically impossible to eliminate via training; this does not make training useless, training is still necessary, I just don't think it's sufficient.
We need to make our web applications secure by design, secure by default and security auditable. The first 2 principles are commonly understood, the last I think is something that I don't see people talking about and I think it is the direction we need to move in. Any framework will have the ability to bypass the default and do something insecure, and that's fine as that kind of flexibility is usually essential. What we need is the ability to easily find deviations from security best practice and focus our review efforts on those areas. Unless we can identify the weak links in our security chain we will never be able to get the kind of security assurance we want.
Wednesday, 14 March 2012
How to become a Certificate Authority
CAs - there are certainly a lot of them, but where do they come from?, how are they made? First of all don't believe anything I have to say on the matter; I have never gone through the process and anything you read here is speculation and incomplete information.
However, if you were to start looking around the internet for how to become a CA's, here is some of the information you may find, some of which you may find interesting.
So any business can become a CA but it's pointless unless you get your root certificate into a browser. To do this you first need to ensure you meet the requirements of the various browser certificate programs. These are:
Microsoft Root Certificate Program
Mozilla CA Certificate Policy (Version 2.0)
Apple Root Certificate Program
Google appears to use the underlying OS certificate store. So on Windows this will be the same as what IE uses, however on Linux, the different distributions seem to use the ca-certificates package. It is interesting to note it's description:
The ca-certificates seems to include mostly Mozilla certificates, although a few others as well. The ca-certificates package also seems to power the Java key store as well.
According to the above certificate programs, any of the following standards is sufficient to convince the browsers (depending on the browser maker) to include you as a CA.
*Actually Apple may accept more, but you have to prove equivalence.
The ANSI and ISO organisations should be familiar to most people, but what about ETSI and WebTrust? Well ETSI is the European Telecommunications Standards Institute and WebTrust is made up of the American Institute of Certified Public Accountants (AICPA) and the Canadian Institute of Chartered Accounts (CICA).
The 2002 ETSI standard actually only applies to CAs that want to create certificates for digital signatures.
The version 2.0 WebTrust (AICPA/CICA) standards (linked above) were created by some folk from the big accountancy firms (Deloitte & Touche, Ernst & Young, KPMG) but declares that it is based on ISO 21188, and is consistent with ANSI and IETF (the RFCs) standards.
Although I didn't have access to the ISO 21188 (2006) document, I found a couple of references that implied it was based on the ANSI X9.79 (from either 2000 or the X9.79-1 from 2001) standard. Again, I didn't have access to the ANSI document, but I found this Mozilla mail threat from 2005 which seem to indicate that the ANSI document shared a lot in common with the v1.0 WebTrust standard (from August 2000).
The ANSI X9.79 standard, according to these presentations, here and here, draw the criteria that CA's must reach from several other ANSI, BS, FIPS, IETF and ISO standards. It does seem to be the granddaddy for all the other CA standards.
Standards are one thing, but all the CA Certificate programs call for an independent audit against one of the standards. It seems that the WebTrust is the most used standard nowadays and even comes with a draft report that auditors can give to a prospective CA indicating hat passed the audit. A choice quote from that draft is (where ABC is the name of the CA):
So how does this change your perception of how a CA becomes a CA? Well for me there aren't a lot of real surprises here, but I would be very interested to see the actual audit reports produced by the independent auditors. I think there is a real argument that since the public is putting so much trust in the CAs then they should make their audit reports publicly available, or at least release substantial parts of it.
However, if you were to start looking around the internet for how to become a CA's, here is some of the information you may find, some of which you may find interesting.
So any business can become a CA but it's pointless unless you get your root certificate into a browser. To do this you first need to ensure you meet the requirements of the various browser certificate programs. These are:
Microsoft Root Certificate Program
Mozilla CA Certificate Policy (Version 2.0)
Apple Root Certificate Program
Google appears to use the underlying OS certificate store. So on Windows this will be the same as what IE uses, however on Linux, the different distributions seem to use the ca-certificates package. It is interesting to note it's description:
$apt-cache show ca-certificates Package: ca-certificates ... Description-en: Common CA certificates This package includes PEM files of CA certificates to allow SSL-based applications to check for the authenticity of SSL connections. . It includes, among others, certificate authorities used by the Debian infrastructure and those shipped with Mozilla's browsers. . Please note that certificate authorities whose certificates are included in this package are not in any way audited for trustworthiness and RFC 3647 compliance, and that full responsibility to assess them belongs to the local system administrator. ...
The ca-certificates seems to include mostly Mozilla certificates, although a few others as well. The ca-certificates package also seems to power the Java key store as well.
According to the above certificate programs, any of the following standards is sufficient to convince the browsers (depending on the browser maker) to include you as a CA.
| Microsoft | Mozilla | Apple* | |
| ANSI X9.79-1:2001 | N | Y | N |
| ETSI TS 101 456 V1.2.1 (2002-04) or later version | Y | Y | N |
| ETSI TS 102 042 V2.1.2 (2010-04) or later version | Y | Y | N |
| ISO 21188:2006 | Y | Y | N |
| WebTrust Principles and Criteria for Certification Authorities | Y | Y | Y |
| WebTrust for Certification Authorities—Extended Validation Audit Criteria | Y | Y | Y |
The ANSI and ISO organisations should be familiar to most people, but what about ETSI and WebTrust? Well ETSI is the European Telecommunications Standards Institute and WebTrust is made up of the American Institute of Certified Public Accountants (AICPA) and the Canadian Institute of Chartered Accounts (CICA).
The 2002 ETSI standard actually only applies to CAs that want to create certificates for digital signatures.
"These policy requirements are specifically aimed at qualified certificates issued to the public, and used in support of qualified electronic signatures ..." (Section 1)As a standard it is based on:
"The present document makes use of the principles defined in IETF RFC 2527 [2] and the framework defined in ANSI X9.79 (see bibliography). The aim of the present document is to achieve best possible harmonization with the principles and requirements of those documents." (section 5.1 NOTE 2)The later ETSI standard (which linked above is from 2011-12) is based on the earlier 2002 ETSI and covers the full range of CA activities. The later standard also references RFC 3647 (from 2003), which obsoleted RFC 2527 (1999). RFC 3647 is itself based on an American Bar Association document "PKI Assessment Guidelines, v0.30, Public Draft for Comment, June 2001", which references the WebTrust standard (at the time, which was v1.0 issued in August 2000 and was a licensed document).
The version 2.0 WebTrust (AICPA/CICA) standards (linked above) were created by some folk from the big accountancy firms (Deloitte & Touche, Ernst & Young, KPMG) but declares that it is based on ISO 21188, and is consistent with ANSI and IETF (the RFCs) standards.
"This document was developed by a CICA/AICPA Task Force using ISO 21188 “Public Key Policy and Practices Framework” and Version 1.0 of the AICPA/CICA WebTrust Program for Certification Authorities."
"The Principles and Criteria for Certification Authorities are consistent with standards developed by the American National Standards Institute (ANSI), International Organization for Standardization (ISO), and Internet Engineering Task Force (IETF). The Principles and Criteria are also consistent with the practices established by the CA Browser Forum (see www.cabforum.org)." (Page 6)
Although I didn't have access to the ISO 21188 (2006) document, I found a couple of references that implied it was based on the ANSI X9.79 (from either 2000 or the X9.79-1 from 2001) standard. Again, I didn't have access to the ANSI document, but I found this Mozilla mail threat from 2005 which seem to indicate that the ANSI document shared a lot in common with the v1.0 WebTrust standard (from August 2000).
The ANSI X9.79 standard, according to these presentations, here and here, draw the criteria that CA's must reach from several other ANSI, BS, FIPS, IETF and ISO standards. It does seem to be the granddaddy for all the other CA standards.
Standards are one thing, but all the CA Certificate programs call for an independent audit against one of the standards. It seems that the WebTrust is the most used standard nowadays and even comes with a draft report that auditors can give to a prospective CA indicating hat passed the audit. A choice quote from that draft is (where ABC is the name of the CA):
"ABC-CA’s management is responsible for its assertion. Our responsibility is to express an opinion on management’s assertion based on our examination."So basically the CA is audited against what they assert and not a list of mandated requirements. This is not necessarily a bad thing, but it does make you wonder about the relationship between auditors and auditees when the later is paying the former. Admittedly that is a problem for auditors regardless of what they are auditing against.
So how does this change your perception of how a CA becomes a CA? Well for me there aren't a lot of real surprises here, but I would be very interested to see the actual audit reports produced by the independent auditors. I think there is a real argument that since the public is putting so much trust in the CAs then they should make their audit reports publicly available, or at least release substantial parts of it.
Labels:
CA,
certificate authority
Thursday, 1 March 2012
Trust CAs? Yes. No. Probably.
So this was an interesting read on the various proposals to change the way CA based PKI works. This lead me to want to learn more about some of the proposals, including Convergence by Moxie Marlinspkie (youtube talk here)
The Moxie talk was interesting as he talks a lot about where the trust in the CA system is and where it should be. I think we can go even further in the analysis of the trust.
For starters the root of trust is not just the CAs, but also where the CA root certificates are stored, the browser/OS certificate store. We also need to trust how they get in the store as well. This is interesting as the root CA certificates would be updated (I assume) over an HTTPS connection which is ironic since we are relying of the trust-worthiness of the CA system in order to update the trust-worthiness of the CA system. This is fine, unless there are issues with the CA system, which I think the current zeitgeist indicates there is.
There is also the browsers themselves, as if they were compromised in any way then the trust in the CA system would be broken. I don't think people consider this to be high risk, but let's not forget that companies like Microsoft or Google are not immune from political pressure and certainly not economic pressure, especially when applied from a nation state.
To me that is the major design criteria that the CA system needs to achieve; protect people from the most powerful adversary, the government of their country. There are other powerful adversaries, but they seem to have balancing forces; organised crime have international police forces, untrustworthy CAs have the browser vendors and economic pressures. The government of your country does not have a balancing force (this is less so in a democratic country, but still not sufficiently balancing in my opinion).
If you really wanted to be paranoid about trust you could include the implementation and design of the algorithms used in the code that implement the cryptography. However it's fairly easy to test that they work as expected and they can also be reverse engineered.
Moxie also mentions that any authenticity system needs to worry about who you need to trust and for how long. I think the current CA system is not terribly broken in this way. We can and do revoke root CA certificates, so we don't trust CAs forever and although people can argue that we shouldn't be trusting them at all, well we have for the past 20 years and the Internet hasn't broken, by in large it all works fairly well. It's unreasonable to expect that CAs will never be bad, so as long as we have balancing forces (browser and economic pressures) then the current system works well enough. Saying that, I would like to see the problem of any CA being able to certify any domain be solved, I think that is a glaring vulnerability in the system.
Fundamentally, users are not in a position to make a trust decision, and allowing them to choose might feel like empowering them, but in the end they will always choose the path of least resistance. This just leaves the option of having watchers watch the system and react to problems, which obviously makes it a reactive rather than a proactive system. So there will always be a certain amount of fraud or insecurity as a result. Until that escalates to a point where the cost out-weighs the benefits, the current solution of a CA-based PKI is likely to remain (largely) unchanged.
The Moxie talk was interesting as he talks a lot about where the trust in the CA system is and where it should be. I think we can go even further in the analysis of the trust.
For starters the root of trust is not just the CAs, but also where the CA root certificates are stored, the browser/OS certificate store. We also need to trust how they get in the store as well. This is interesting as the root CA certificates would be updated (I assume) over an HTTPS connection which is ironic since we are relying of the trust-worthiness of the CA system in order to update the trust-worthiness of the CA system. This is fine, unless there are issues with the CA system, which I think the current zeitgeist indicates there is.
There is also the browsers themselves, as if they were compromised in any way then the trust in the CA system would be broken. I don't think people consider this to be high risk, but let's not forget that companies like Microsoft or Google are not immune from political pressure and certainly not economic pressure, especially when applied from a nation state.
To me that is the major design criteria that the CA system needs to achieve; protect people from the most powerful adversary, the government of their country. There are other powerful adversaries, but they seem to have balancing forces; organised crime have international police forces, untrustworthy CAs have the browser vendors and economic pressures. The government of your country does not have a balancing force (this is less so in a democratic country, but still not sufficiently balancing in my opinion).
If you really wanted to be paranoid about trust you could include the implementation and design of the algorithms used in the code that implement the cryptography. However it's fairly easy to test that they work as expected and they can also be reverse engineered.
Moxie also mentions that any authenticity system needs to worry about who you need to trust and for how long. I think the current CA system is not terribly broken in this way. We can and do revoke root CA certificates, so we don't trust CAs forever and although people can argue that we shouldn't be trusting them at all, well we have for the past 20 years and the Internet hasn't broken, by in large it all works fairly well. It's unreasonable to expect that CAs will never be bad, so as long as we have balancing forces (browser and economic pressures) then the current system works well enough. Saying that, I would like to see the problem of any CA being able to certify any domain be solved, I think that is a glaring vulnerability in the system.
Fundamentally, users are not in a position to make a trust decision, and allowing them to choose might feel like empowering them, but in the end they will always choose the path of least resistance. This just leaves the option of having watchers watch the system and react to problems, which obviously makes it a reactive rather than a proactive system. So there will always be a certain amount of fraud or insecurity as a result. Until that escalates to a point where the cost out-weighs the benefits, the current solution of a CA-based PKI is likely to remain (largely) unchanged.
Subscribe to:
Posts (Atom)