Tuesday, February 3, 2015

Best Practice deployment SSL / TLS

Share transfer of useful articles on how to properly deploy SSL / TLS on your site. Today - the theory, the second (practical) part will be after launch.

introduction

SSL / TLS is deceptively seems simple technology. It is simple to deploy, and then it just works, without providing an adequate level of security. But the main problem lies in the fact that SSL / TLS are not easy to deploy. To TLS provides the necessary security, system administrators and developers should make an extra effort to set up their own servers and application development.

In 2009, Qualys SSL Labs began work with SSL. They wanted to understand how to use TLS, and to remedy the lack of easy-to-use tools TLS, as well as their documentation. With global research use TLS, as well as through online assessment tools Qualys SSL Labs has made some of its goals. But the lack of documentation is still making itself felt. This document is a step towards addressing this problem.

1. The private key and certificate

The quality of protection provided by TLS depends entirely on the secret key, laying the groundwork security, and a certificate of authenticity that tells the server to its visitors.

1.1 Use a 2048-bit private keys

Use a 2048-bit RSA and 256-bit ECDSA private key for all your servers. The keys of this strength are safe and will remain safe for a significant period of time. If you have a 1024-bit RSA keys, you should replace them with stronger keys as soon as possible.

1.2 Protection of the private key

Treat your private keys as an important asset, providing access to the lowest possible group of employees. Recommended action:

• Generate private keys and certificate requests (CSRs) on a trusted computer. Some offer a CA key generation and CSRs for you, but it is impractical.

• Use password protection for private keys, to prevent compromise in cases where they are stored on the backup system. Password protection for the private key does not work on the production server, because an attacker can get the keys from the process of memory. There are hardware devices that can protect the secret key, even if the server is compromised, but they are expensive and thus, only justified in organizations with high security requirements.

• After the compromise revoke old certificates and generate new keys.

• Update certificates every year and always with the new private key.

1.3 Ensure coverage of all used domain names

Make sure that your certificates cover all the domain names that you want to use on the site. For example, you have a primary domain www.example.com, but you are also using a domain www.example.net. Your goal - to avoid warnings about invalid certificates, which will confuse your users and weaken their confidence.

Even when the server is configured, only one domain name, you need to keep in mind that you can not control how users come to your site or any links to his point. In most cases, you should make sure that the certificate works with and without WWW (for example, for example.com and www.example.com). Secure Web server must have a certificate that is valid for each configured domain name. Certificates for the entire domain (Wildcard) have the advantage, but should be avoided if their use is to provide the private key large group of people, such as system administrators to different organizations. Also, keep in mind that Wildcard certificates can be used by attackers to transmit vulnerability from one web site to all other sites that use the same certificate.

1.4. Purchase certificates from a trusted Certification Authority

Choose a reputable certification authority (CA), who take care of their business and security. Consider the following criteria when choosing CA:

Related to safety

All CA pass regular audits (otherwise they would not have the right to act as a CA), but some are more serious about security than others. Find out which one is better in this respect is not easy, but one way is to study the history of their security incidents and to identify how they react to compromise and security incidents and whether they studied their mistakes.
The main activity

CA, in which the issue of certificates is the main activity, will lose business if they do something horribly wrong, and they probably will not be neglected division of certificates, pursuing potentially more lucrative opportunities elsewhere.

services offered

As a minimum, the selected CA should provide support for Certificate Revocation List (CRL) and Protocol OCSP.

Tools for managing certificates

If you need a large number of certificates, select the CA that will give you good tools to manage them.

support

Select the CA that provides good support when you need it.

1.5. Use reliable algorithms to sign the certificate

Security certificate depends on the length and strength of the private key used by the hash function. Today, most of the certificates used algorithm SHA1, which is considered weak.

You need to immediately replace all of your certificates using the algorithm SHA1, if they expire after 2015.

XSS on sites using the Instagram API

Developing an application using Instagram API, I've noticed that I do not come converted tags. Of course, this problem is solved in a couple of lines of code. But I thought, what if not all developers convert tags in effect when displayed on the page, trusting API. Who would expect that in the description page Instagram is JS script instead of text?

I found these sites.

First, add a description of the profile of a dial script js, and in the description of some photos of the line
<script> alert (document.cookie); </ script>
and several hashtags, including #instagramapi.

The first site that I found - it Iconosquare.

IconoSquare - a useful application for analyzing and managing your account in Instagram. User-friendly web interface will save time and help in communicating with subscribers. IconoSquare can browse through profiles and search for the hashtag


On this site I decided to look for your picture on the hashtag #instagramapi, in my case it was a picture of a cat.

When you click on a photo of me and burn to a page that contains the description of the photo, but Iconosquare forgotten convert html-tags in essence. This enabled the implementation of XSS.

View image
Opening the source code of the page, once it became clear that they had forgotten to convert tags in the meta description of the page.

View image
On the page, they do not resolve the name and description of the profile Instagram - and here's the result.

View image
The next site that I found - it facegram.io.

As I understand it, facegram.io - is another Instagram Web Viewer. The service has about 50,000 subscribers on Facebook, so I think it can be considered popular.

Here we are also looking for hashtag #instagramapi and here is the result:

View image
Similarly, on the user page.

In fact, I found 27 sites where you can spend XSS-attack. I think it is not necessary to paint them all, here are links to pages with XSS.

A list of all sites
I tried to write in Iconosquare and in support of a few other sites, but they did not react. Maybe someone of you can tell the developers of these sites about the vulnerability.

P.S. This article is written to tell developers that do not cost the trust received from the Instagram API data.

Two-factor authentication, which is convenient to use

Rare blog post Yandex, especially regarding security, without mentioning two-factor authentication. We thought long and hard how to strengthen the protection of user accounts, and even so that it could be used without all the inconveniences, which include the most common current implementation. But, alas, they are inconvenient. According to some reports, many major sites share of users, including additional means of authentication, does not exceed 0.1%.

It seems that this is because the common two-factor authentication scheme is too complicated and inconvenient. We have tried to think of a way that would be more convenient without losing the level of protection, and today we present its beta version.

Hopefully he will get more widespread. For our part we are ready to work on improving it and subsequent standardization.



After you enable two-factor authentication in the Data Sheet you will need to install the application Yandeks.Klyuch in App Store or Google Play. In the login form on the main page of Yandex, a mail and passport will be QR-code. To enter the account must be read QR-code through the app - and all. If we assume QR-code does not work, does not work like camera or smartphone does not have access to the internet, the application will create a one-time password, which will operate a total of 30 seconds.

I'll tell you why we decided not to use such "standard" mechanisms such as RFC 6238 and RFC 4226. How do the two-factor authentication schemes common? They are two-stage. The first stage ─ common authentication username and password. If it succeeds, the site checks "like" him this user session or not. And if the "do not like", asks the user "doautentifitsirovatsya." Common methods "doautentifikatsii" two: sending an SMS to your account tied to a phone number and password to the second generation smartphone. Mainly for generating a second password is used for TOTP RFC 6238. If the user has entered the second password is correct, the session is considered fully authenticated, and if not, the session loses and "provisional" authentication.

Both methods ─ SMS sending and password generation ─ proof of owning the phone and are therefore factor presence. The password entered in the first stage, ─ factor knowledge. Therefore, this authentication scheme ─ not only the two-stage, but also two-factor.

What struck us as problematic in this scheme?

Let's start with the fact that the computer the average user can not always be called a model of security: there are updates off Windows, and a pirate copy without modern antivirus signatures and software of dubious origin ─ all of this does not increase the level of protection. We estimate that compromise the user's computer ─ the most popular way of "stealing" accounts (and recently that was another confirmation) from it in the first place and wants to protect. In the case of a two-step authentication, if we assume that the user's computer is compromised, the password on it compromises the password itself, which is the first factor. This means that an attacker only needs to pick up the second factor. In the case of common implementations of RFC 6238 ─ second factor is 6 decimal digits (and the maximum prescribed specification, ─ 8 digits). According to the calculator bruteforce for OTP, three days attacker is able to pick up the second factor, if it somehow came to be known first. Not clear that the service can counter this attack without disturbing the normal operation of the user. The only possible proof of work ─ CAPTCHA that, in our view, is the last resort.

The second problem ─ opacity judgments about the quality of the service user's session and decide on the need to "doautentifikatsii." To make matters worse, the service is not interested in what would make the process transparent, ─ because here actually works security by obscurity. If an attacker knows, based on which service decides on the legitimacy of the session, it may attempt to forge the data. From general considerations it can be concluded that the judgment is based on the history of user authentication based on IP-addresses (and its derivatives autonomous system number that identifies the provider, and location-based geodatabase) and browser data, such as User Agent header and a set of cookies, flash lso and html local storage. This means that if an attacker controls a user's computer, it has the ability to not only steal all the necessary data, but also to take advantage of IP-address of the victim. Moreover, if the decision is made on the basis of ASN, then any authentication of public Wi-Fi at a coffee shop could lead to "poison" in terms of security (and whitewash in terms of service) provider of coffee, for example, whitewash all coffee in town . We talked about the system anomaly detection, and it can be applied, but the time between the first and second stage of authentication may not be sufficient for certain judgments about the anomaly. In addition, this same argument destroys the idea of "trusted" computers: an attacker can steal any information that affects the judgment of the proxy.

Finally, a two-step authentication simply uncomfortable: our usability-studies show that there is nothing that irritates users as an intermediate screen, additional button press and other "unimportant", from his point of view action.
For this reason, we decided that authentication should be single-stage space and passwords should be much more than can be done within the framework of "pure» RFC 6238.
At the same time we would like if possible to save two-factor authentication.

Multifactor authentication to determine whether a hedged items authentication (in fact, they are called factors) into one of three categories:
Factors knowledge (that traditional passwords, PIN codes, and all that like them);
Factors ownership (used in the OTP-schemes, as a rule, this is a smartphone, but it could be a hardware token);
Biometric factors (fingerprint ─ the most common now, although someone will remember the episode with the hero Wesley Snipes in the movie Demolition Man).

The development of our system

When we began to address the problem of two-factor authentication (the first page of the corporate wiki on this issue relate to 2012, but behind the scenes it was discussed earlier), the first idea was to take the standard authentication methods and apply them in our country. We understand that you can not count on the fact that millions of our customers buy hardware token, so this option is postponed to some exotic cases (although we totally do not refuse him, maybe we can come up with something interesting). Way with SMS too, could not be massive: it is a very unreliable way of delivery (at the crucial moment SMS may be delayed or does not reach) and sending SMS costs money (and operators have begun to increase their prices). We decided that the use of SMS ─ inheritance banks and other non-technological companies, our customers want to offer something more comfortable. In general, there was little choice: use your smartphone and program it as a second factor.

Widespread this form of one-step authentication: the user to remember the PIN code (the first factor), has on hand a hardware or software (smartphone) token generated OTP (second factor). In the password field, he enters the PIN and the current value of the OTP.

Professional development in information security

Again, the article on Infobezopasnosti, more precisely about how to become a certified specialist in information security: How and where to learn? What are the challenges to become a specialist in the field of information security? How to get a certificate for the IB recognized worldwide? The answers to all these questions in the review of our instructor CA - Kuzma Pashkov

Due to the rapid development of information technology in general and information security (IS), as a science, in particular, a specialist in information security is necessary to solve the problem of maintaining their skills. This is true for more than a decade, but nowadays the following conclusions from it about solving this problem are significantly different from those that were relevant 10 years ago. One of the main reasons for these differences is to complete the transition to a risk-based approach to the construction of automated systems in the protected execution to the normative. There are two versions of approaches:

• The risk-based approach
• Normative Approach

In an era of risk-based approach focused on building a business model and identify the necessary and sufficient conditions for meeting the requirements of security policy.

A system of protection were piece goods that are in demand mainly government agencies and large commercial organizations. To complete the work in the field of information security specialist was enough to have developed mathematical apparatus, which is produced in higher vocational education students from leading technical universities.

With all the variety of business models and established safety policy terms of their performance in the majority of cases are the same. This fact is due to let go to the normative approach of building security systems, where the focus of information security specialist devotes search, analysis and adaptation of a suitable family of open security standards. Also coated version of the automated systems become widely-popular service for all spheres of human activity.

Education IB

Thus specialist IB necessarily need to specialize in some of the following areas:

• implementation of the requirements of national laws and / or regulators (eg, access to state or commercial secrets)
• The use of certified information security specific vendors / manufacturers (engineering, commissioning, etc.).
• internationally recognized certification vendornezavisimye

Training of specialists in the first two areas spends a lot of educational institutions, both in the higher and additional vocational training. It should be understood that these areas are tied to professional employers in a particular country, but rather allow it to conduct its activities almost exclusively in the framework of national legislation and standards.



The advantages of international certification

The third area is initially focused on international open standards and methodology for information security in the hope that the developed / developing countries seek to harmonize their national legislation with international standards and in connection with the fundamental advantages of the latter. Specialist with internationally recognized certifications in the field of information security is ready to adapt their experience to work in any country, and most importantly to confirm their qualification to any employer that all else being equal gives him an advantage over other candidates for the vacancy.

Due to a number of reasons, primarily historical and political, in our country with a significant delay are adopted international standards of information security, and national legislation in this field is harmonized with the international even slower. But accelerating progress of globalization will inevitably lead us to a natural result, so an increasing number of professionals looking for IB confirm its expertise in international recognized certification.

IBM Research announced the launch of an innovative cloud technology to protect personal data

IBM researchers today announced the launch of a new cloud-based technologies that will help customers enhance the protection of their personal data on the Internet.

Technology called Identity Mixer uses a cryptographic algorithm to encrypt these confirmed the identity of the user, as his age, nationality, address and credit card number. Through the use of this technology, the user will be able to transfer to a third party only the necessary amount of personal information. Identity Mixer can be used in the electronic purse in which there is an account that is confirmed by a trusted third party, such as information from the electronic identity cards. It is important to note that the party issuing the document, receives no information about how and when the data is used.

«Identity Mixer enables users to choose what data should be provided and to whom - said Christine Petersen, director of IBM in the protection of confidential information. - Thanks to this technology, web service providers can reduce their risks and increase the confidence of customers to the resource. Furthermore, the new solution is in the cloud, which greatly facilitates the process of programming developers ".

According to comScore, the average person spends on the Internet about 25 hours per month *, with access to dozens of different Internet services, including: social networking, banking and shopping online site. For almost every site you want to create your profile with username and password or with a cryptographic key for added security. Despite the fact that these tools provide a sufficient level of safety in solving many problems, they usually do not guarantee the protection of confidential data, which leads to the disclosure of excessive amount of personal information getting into the wrong hands which is fraught with serious consequences.



As an example, consider a video streaming service that offers movies, with an age restriction. In order to see the film, recommended for persons older than 12 years, Alice needed to confirm that she is already 12 years old, and she lives in a particular region. To perform this task in the usual way Alice will need to enter the full date of birth and all the details of his address, but it will lead to the disclosure of a large amount of personal information. Identity Mixer is able to confirm that Alice is already 12 years old, without disclosing the month, date and year of birth, and to show that she is living in the region where the services are services available. Furthermore, even if the service is hacked, the personal data will be safe Alice.
If Alice is necessary to use a credit card to buy the film, video streaming service in the same way can only know that the card is valid Alice, and with it you can make a payment. Full card number and expiration date of its action is not disclosed.



Identity Mixer, previously available for download and runs on smart cards are now presented to developers as a convenient web service platform IBM Bluemix - open cloud solutions such as PaaS, combining the strengths of the software IBM, third-party and open source technologies. Since the spring, subscribers can take advantage of BlueMix Identity Mixer to optimize their applications and Web services. With a convenient drop-down menu, developers can select the types of data they want to protect, and BlueMix in turn will provide a code that can then be integrated into their life.
«Identity Mixer - the result of more than ten years of research, whose main purpose is to minimize the disclosure of identity. At the moment, this solution is ready for use when performing operations on the PC and on mobile devices, "- said Dr. Jan Kamenish, cryptographer at IBM Research and co-author of Identity Mixer.

"We wanted to ensure that every user could control the amount of personal information that he wants to give of himself, - said Dr. Anna Lisyanskii, co-author of Identity Mixer and Professor of the Department of Computer Science at Brown University. - The new cloud solution developers have at their disposal a powerful tool for cryptographic protection of personal data. Identity Mixer - a piece of software that can be built into the system Identity management in order to eliminate the possibility of breaches of confidentiality of information. "

European and Australian pilot projects to demonstrate the capabilities of Identity Mixer


To demonstrate the capabilities of the new cloud-based version of Identity Mixer, IBM scientists with academic and industrial partners in Europe and Australia are implementing a pilot project called the Authentication and Authorization for Entrusted Unions (AU2EU). During the two years of the program, worth 8.6 million. Euro Identity Mixer scientists will test two versions of application: the German Red Cross in the Commonwealth Scientific and Industrial Research Organisation (national scientific agency of Australia).

The German Red Cross is the main center for emergency assistance by telephone and social services to citizens in the regions of Germany, around the clock providing specialized services to the population, in particular conduct rescue operations, assistance with mobility, housekeeping and medical treatment. The organization employs about four million volunteers and professional staff in 52 hospitals and more than 500 nursing homes around the world.

As part of the pilot program, 20 patients of the Red Cross in the south-west of Germany were granted aid domestic activity and health monitoring and health indicators. Data collected from these devices, transferred to a dedicated cloud server, where the information is analyzed to determine the type of assistance required. In addition, representatives of the Red Cross received mobile devices for data collection and registration of confidential customer data, including information, medical records, information about medicines taken and contact relatives to the subsequent conclusion of a service contract. To protect the confidentiality of personal information will be used by Identity Mixer. The project was implemented jointly with NEC Europe and Tunstall Healthcare. **



"Our main objective for the past 150 years, is to help the victims of conflict and natural disasters, as well as other vulnerable populations, including support for people when they are sick at home, while traveling and transportation. New technologies are playing an increasingly important role in achieving this goal, especially in home alarm systems - said Carolyn Greiner, regional manager of the German Red Cross in the Rhein-Neckar and Heidelberg. - Here we offer services to senior citizens, so that they can stay at home in a comfortable and familiar environment for them. Tested technology during the project to ensure the confidentiality must guarantee to provide the most professional assistance and to ensure protection of personal data of our clients at the highest level. Only taking measures to strengthen the protection of personal information, we can maintain the trust of the people we serve around the world. "

The second pilot project aims to improve agricultural productivity and increase in Australia's export trade of relevant products without viral infections, especially in animals. To prevent the spread of viruses and the Australian Government in collaboration with key partners, has developed an emergency plan for rapid response when it detects an outbreak. This plan involves the combined efforts of government, academic and other research organizations, and industry partners to create a safe, secure and interactive environment for decision-making. Identity Mixer will ensure the timely exchange of confidential information between collaborating partners, regardless of the distance between them.

"The speed of response to human cases plays an important role in saving the lives of people or animals, - says John Zeke, chief researcher at CSIRO. - Through the use of modern technologies in the framework of this project, we are looking forward more quickly to deal with new challenges, while maintaining high levels of security, privacy and trust necessary for efficient operation. "

«Identity Mixer - a great example of how existing legislation on the protection of personal data across the world should not stop innovation. New solutions can enhance the protection of privacy by using the tools that are easier to use and accessible to providers "- adds Peters.

Test the system in demo mode here.

AU2EU - the union of industrial and academic partner organizations across Europe, and Australia, including the Technical University of Eindhoven, Philips Electronics Nederland BV, Bicore Services BV, NEC Europe Ltd, Research Center of IBM Research, German Red Cross, Thales Communications & Security SAS, State Association scientific and Industrial Research, Edith Cowan University, royal Melbourne University of Technology, University of New South Wales and Macquarie University. Further information can be found here: www.au2eu.eu.

Watch the debate about Identity Mixer, which involves IBM scientists and scientific experts to Twitter, using the hashtag #identitymixer

* Source: ComScore MMX, in December 2012 the World. Age 15+.
** Tunstall Healthcare is not part AU2EU, but ensures the implementation of telemedicine consultations for the Deutsches Rotes Kreuz.