A Container Based Tool to Perform Security Risk Assessment for ELF Binaries
Total Page:16
File Type:pdf, Size:1020Kb
TED: A Container based Tool to Perform Security Risk Assessment for ELF Binaries Daniele Mucci1 and Bernhards Blumbergs1;2 1Centre for Digital Forensics and Cyber Security, Tallinn University of Technology, Estonia 2CERT.LV, IMCS University of Latvia, Latvia Keywords: ELF Binary Analysis, GNU/Linux System Hardening, Vulnerability Assessment, Software Containers. Abstract: Attacks against binaries, including novel hardware based attacks (e.g., Meltdown), are still very common, with hundreds of vulnerabilities discovered every year. This paper presents TED, an auditing tool which acts from the defense perspective and verifies whether proper defenses are in place for the GNU/Linux system and for each ELF binary in it. Unlike other solutions proposed, TED aims to integrate several tools and techniques by the use of software containers; this choice created the necessity to compare and analyze the most popular container platforms to determine the most suitable for this use case. The containerization approach allows to reduce complexity, gain flexibility and extensibility at the cost of a negligible performance loss, while significantly reducing the dependencies needed. Performance and functionality tests, both in lab and real- world environments, showed the feasibility of a container-based approach and the usefulness of TED in several use cases. 1 MOTIVATION FOR THE commonly used and deployed. This set includes de- PROJECT fenses such as Address Space Layout Randomization (ASLR), Data Execution Prevention (DEP, NX/XD), Stack Smashing Protector (SSP) or Stack canaries. From the 1st of January 2017, around 150 differ- For the most recent Linux kernels, this set can be ent vulnerabilities involving stack or heap overflows extended with the microcode to protect against some and format string bugs have been reported (NIST, Spectre variants (e.g., Meltdown). On the other hand, 2018). In addition, during this period several hard- verifying whether all these measures are in place is ware vulnerabilities which also involved binaries usually done either manually or by the aid of some have been found (e.g., Spectre/Meltdown, Throw- tools (e.g., Radare2, Lynis). This action has to be /NetHammer). Also reverse engineering should al- performed separately for each tool used or individu- ways be considered as a possible option for target- ally for each binary, making it time consuming, error- ing binaries, especially where intellectual property prone and inefficient. Moreover, low-level tools of- is involved. Considering the enormous diffusion of ten require specific dependencies for libraries or other GNU/Linux based systems, it is clear that protecting tools, which might not always be possible to satisfy or ELF binaries in such environment is of critical impor- whose installation might require additional time and tance, and therefore this is the primary purpose of this effort. project. The solution proposed in this paper consists of using software containers to address the issues men- tioned, specifically to integrate and orchestrate multi- 2 INTRODUCTION ple tools, to collect and process the different results, and most of all to greatly reduce the dependencies Many tools and techniques exist to protect systems required, allowing to individually pack the needed or binaries from a wide range of attacks, and many tools with their dependencies, thus eliminating possi- more are continuously developed. However, despite ble conflicts and the need for their installation. Given the large number of protection mechanisms designed, the fact that software containers are still rarely used a relatively small and consolidated set of features is outside cloud environments, a significant amount of 361 Mucci, D. and Blumbergs, B. TED: A Container based Tool to Perform Security Risk Assessment for ELF Binaries. DOI: 10.5220/0007371603610369 In Proceedings of the 5th International Conference on Information Systems Security and Privacy (ICISSP 2019), pages 361-369 ISBN: 978-989-758-359-9 Copyright c 2019 by SCITEPRESS – Science and Technology Publications, Lda. All rights reserved ICISSP 2019 - 5th International Conference on Information Systems Security and Privacy work consisted in analyzing and comparing the vari- vulnerabilities or detecting exploitation at runtime. To ous available container engines to select the one that perform its analysis, DBA uses QEMU virtual ma- provided the needed functionalities and at the same chine to emulate the execution environment for a sin- time did not represent a heavy dependency itself. The gle binary. TEASER by Ulrich (Ulrich, 2017) is a tool here presented, TED, implements such solution system, which aims to assess the exploitability of bi- using Docker containers to perform all the necessary naries, performing a vulnerability assessment from tests aimed to verify whether a selected set of defense the perspective of an attacker. TEASER is limited measures are in place, and to consequently assess the to identifying memory corruption vulnerabilities and risk associated with each binary present in the system. is meant to ease the process of detecting bugs which Proposed solution would be practically applicable to might lead to exploits. It is built on top of other the cyber security areas such as, vulnerability assess- tools, such as Valgrind, PANDA, ASan and LLVM, and ment, incident response, system triaging, and security uses QEMU emulation for some steps of its execu- baseline establishment. tion. Tang et al. (Feng-Yi et al., 2016) and Wang et This paper provides the following contributions: al. (Wang et al., 2017) in their projects focused on 1. discussion of software containers as execution en- binary security analysis in terms of performing a di- vironment and evaluation of the different con- agnosis of memory vulnerabilities. The two projects checksec.sh 1 tainer engine platforms in the context of vulner- which can be compared with TED are 2 Bash ability assessment; and and Lynis . The first is a shell script, which shows technical information, including whether some 2. container technology implementation for ELF bi- security measures are applied, regarding a binary, a nary security assessment in an open-source tool- loaded library or the kernel. The main script is not set TED. maintained anymore, but a forked and maintained ver- 3 This paper is organized as follows: Section 3 gives sion exists. Lynis, on the other hand, is a software an overview of related work; Section 4 describes the aimed to audit, hardening and testing for compliance container engine selection process, the design and the Unix systems. The software runs a wide range of tests implementation of TED; Section 5 provides the result according to what tools are available on the system, of the evaluation process; Section 6 concludes this pa- and it is publicly available. per. In addition to the presented tools, there is a con- spicuous number of proposals to protect binaries from a wide range of attacks, however, an evident gap be- tween the academia and the industry emerged. This 3 RELATED WORK means that virtually all the novel tools or techniques, such as (Marco-Gisbert and Ripoll, 2013; Solanki Extensive research already exists on binary security, et al., 2014; Younan et al., 2006; Chen et al., 2017; both from the attack and from the defense perspective. Novark and Berger, 2010), developed in the academic However, very few projects, with a purpose similar to environment, independently by their efficacy and se- the one presented in this paper, were found. curity impact, are either unused or extremely rarely BitBlaze is a platform developed by Song et deployed in the production environments. al. (Song et al., 2008) which uses both static and dy- In the related work, multiple limitations and draw- namic analysis to extract a wide range of security in- backs have been identified, such as, the need for spe- formation from a program, without taking into con- cific and numerous dependencies, the use of heavy sideration the defense measures applied and relying virtualization technologies (e.g., KVM/QEMU) and on custom techniques. The main purpose of Bit- their configuration, the support only for Windows bi- Blaze is to detect possible vulnerabilities in the pro- naries or for 32-bit architectures, the focus on sin- gram and to identify their root cause, rather than de- gle binaries rather than on the whole system, the termining what security measures are applied. Bit- lack of automation and the need of user interaction Blaze has several components, in particular a static and finally the use of technologies that make the tool analysis tool (VINE, available and not maintained for not portable, not easily extensible or not suitable for 4 years) and a dynamic analysis component (TEMU, cloud environments. TED aims to address all the gaps available and not maintained for 3 years). Young- identified by bundling all the tools and dependen- Hyun et al. (Choi et al., 2015) in 2015 developed a cies needed inside Docker containers, which not only project called DBA (Dynamic Binary Analyzer), ca- pable of dynamically detecting vulnerabilities in bi- 1http://www.trapkit.de/tools/checksec.html naries with taint analysis, which targets x86 (32-bit) 2https://cisofy.com/lynis/ Windows binaries. This project focuses on finding 3https://github.com/slimm609/checksec.sh 362 TED: A Container based Tool to Perform Security Risk Assessment for ELF Binaries make the application extremely portable, but avoid the The remaining platforms – LXC, Docker and Rkt, overhead of an hypervisor, reducing drastically the have been evaluated using three parameters: performance loss; given this approach, the set of de- 1. Availability: what needs to be done to get and in- pendencies of TED is fixed and it is limited to the stall the platform, what dependencies need to be Docker platform and a small number of Python pack- satisfied and also whether there are public repos- ages. Furthermore, TED focuses on 64-bit executa- itories from which container images can be ob- bles and aims to automate the scanning process, with- tained. out requiring user interaction, in order to grant scal- ability to the project and to allow users to run TED 2.