Identification and Implementation of Authentication and Authorization Patterns in the Spring Security Framework

Total Page:16

File Type:pdf, Size:1020Kb

Identification and Implementation of Authentication and Authorization Patterns in the Spring Security Framework Identification and Implementation of Authentication and Authorization Patterns in the Spring Security Framework Aleksander Dikanski, Roland Steinegger, Sebastian Abeck Research Group Cooperation & Management (C&M) Karlsruhe Institute of Technology (KIT) Karlsruhe, Germany { a.dikanski, abeck }@kit.edu, [email protected] Abstract—In the development of secure applications, patterns business functionality, the reuse of existing functionality are useful in the design of security functionality. Mature increases the efficiency of the implementation process. security products or frameworks are usually employed to Implementing security patterns using existing security implement such functionality. Yet, without a deeper functionality is complicated. For one, their built-in flexibility comprehension of these products, the implementation of to support many different application contexts leads to a high security patterns is difficult, as a non-guided implementation complexity, requiring a deep understanding of the internal leads to non-deterministic results. In this paper, the Spring workings. This often raises the question, if and how the Security framework is analyzed with the goal of identifying required security patterns can be implemented with the supported authentication and authorization patterns. selected product. In such a case, the security functionality Additionally, a best practice guide on implementing the needs to be analyzed by security experts to determine the identified patterns using the framework is presented. A real world case study is presented, in which the findings are supported patterns. employed to implement security requirements in a web Such an analysis is especially useful, if a model-driven application. With this approach it is possible to overcome the approach is used to automatically generate security-related gap between pattern-based security design and implementation artifacts from design models. The identified and supported to implement high quality security functionality in software patterns of the framework or product can be used to describe systems. the target platform and to generate framework artifacts from design models. Such an approach is part of a reuse-based Keywords - security patterns; security framework; security security engineering approach, which we outlined in earlier engineering; authorization; authentication works [3]. In this paper, the capabilities of the popular open source I. INTRODUCTION authentication and authorization framework Spring Security [4] are examined. The goal thereby is to identify support for Security engineering aims for a consecutive secure common pattern by Spring Security and provide a reusable software development by introducing methods, tools, and catalog of best practice advice on how to implement them in activities into a software development process [1]. As such, a high quality fashion. Theses informal description can be each phase of the software development needs to consider used by developers in the need to evaluate security security aspects: in the analysis phase security requirements frameworks as well as a guide to implementation. Also, they are identified, in the design phase security functionality is can be used to describe formal transformation rules for a modeled in conjunction with the main business functionality model-driven approach. and finally, security solutions are realized in the The rest of this paper is structured as followed: Section 2 implementation phase. introduces the Spring Security framework and discusses Security patterns are an agreed upon method to describe related work. In Section 3, the relationship of the pattern- best practice solutions for common security problems [2]. based framework description to our reuse-based security When designing security functionality for an application engineering approach is described. The identified security such patterns can be instantiated in the design model to cover patterns and their equivalent implementation using Spring a certain security requirement. Security are covered in Section 4. In Section 5, a real-world The reuse of existing security functionality, i.e., in the case study is presented, which shows the security pattern form of security components, frameworks or products, is implementation using Spring Security. A conclusion and considered best practice as well, as they usually cover a great outlook on future work closes the body of this paper. percentage of existing security requirements. Their maturity can usually not be achieved by implementing it completely II. BACKGROUND AND RELATED WORK new, so self-made solutions should extend it as well. By The following section provides a background on the doing so, the quality of the security functionality of the Spring Security framework and discusses related works. developed application is increased. Also, as the main focus of software development lies upon the implementation of the A. Background on Spring Security Security framework. Pattern based security engineering Spring Security is an open source Java framework, processes are discussed in [11] and [12], yet they do not providing highly flexible and extensible authentication, consider the implementation of patterns using security authorization, and access control solutions [5][6]. platforms. The modular framework consists of loosely coupled An automated retrieval of security patterns in existing components, which are connected using dependency software, such as discussed in [13] and [14], would be useful injection. The core classes and their dependencies are shown in the identification process. Unfortunately, the retrieval rate in Figure 1. The Authentication class stores user information. of the approaches is still to low to be useful for our goals. It is part of a SecurityContext class for every authenticated Applying them would only show the patterns implemented in user in an application. An AuthenticationManager loads this the software not all possibilities of the security framework. data and which verifies the authenticity of users using This is why a manual approach was applied. offered credentials and information from a user store [5]. The pattern-based platform description presented here is To intercept secured resource access, classes extend the a feasible enhancement to model-driven security approaches, AbstractSecurityInterceptor class, which is the central class which is not considered by other such approaches, e.g., in terms of authorization. Thereby, the SecurityContext and [15][16][17]. We aim at describing the target security SecurityMetadataSource classes offer information about the platform using security patterns, to simplify the current user and the secured object respectively. Access transformations and easily adapt them to new platforms. decisions are performed by the AccessDecisionManager, Background information on the Spring Security which is also called by the AbstractSecurityInterceptor. The framework, its inner relations and concepts as well as its AccessDecisionManager calls voters, which decide whether usage can be found in the community documentation as well access is granted or not and which can be added dynamically as in [5] and [6]. These descriptions are not based on security to the application. Thus, the voter system abstracts from an patterns and do not show all possible applications of the access control mechanism. framework. Although it can be used for desktop applications, the III. REUSE-BASED SECURITY ENGINEERING main purpose of Spring Security is to secure web applications based on the Java Platform Enterprise Edition The pattern-based identification and description of (JEE, [26]). The framework integrates with many security functionality in existing frameworks is part of a authentication technologies and standards, e.g., Lightweight reuse-oriented security engineering approach, presented in Directory Access Protocol (LDAP), Central Authentication [3]. We argue for reuse of existing security functionality as System (CAS), OpenID and OAuth. Spring Security also well as knowledge throughout the phases of development provides support for basic role-based access control [6]. Due processes to increase the quality and the development to its flexible architecture the framework can easily be efficiency of the implemented software artifacts. Security adapted and extended to support other forms of problems, which can not be covered by existing models and authentication and authorization and access control as well. functionality, can benefit from a reuse approach by extending or adapting them to a new context. B. Related Work For one, the reuse of knowledge about possible threats Due to the identification of security patterns, the work is and attacks against information resources, as well as based on common security pattern literature. A appropriate countermeasures, is feasible in the analysis of comprehensive catalog of abstract and context-specific security requirements of an application. security patterns for, e.g., operating systems, can be found in The topic discussed in this paper covers the design and [2]. Identity management as well access control patterns are implementation phase of the engineering process. In the discussed in [7] and [8]. Patterns specific to the JEE platform design phase existing security knowledge should be used to are described in [9]. Authorization patterns for the Extensible determine possible solutions for security problems. Security Access Control Markup language (XACML) are discussed in patterns
Recommended publications
  • Opentext Product Security Assurance Program
    The Information Company ™ Product Security Assurance Program Contents Objective 03 Scope 03 Sources 03 Introduction 03 Concept and design 04 Development 05 Testing and quality assurance 07 Maintain and support 09 Partnership and responsibility 10 Privavy and Security Policy 11 Product Security Assurance Program 2/11 Objective The goals of the OpenText Product Security Assurance Program (PSAP) are to help ensure that all products, solutions, and services are designed, developed, and maintained with security in mind, and to provide OpenText customers with the assurance that their important assets and information are protected at all times. This document provides a general, public overview of the key aspects and components of the PSAP program. Scope The scope of the PSAP includes all software solutions designed and developed by OpenText and its subsidiaries. All OpenText employees are responsible to uphold and participate in this program. Sources The source of this overview document is the PSAP Standard Operating Procedure (SOP). This SOP is highly confidential in nature, for internal OpenText consumption only. This overview document represents the aspects that are able to be shared with OpenText customers and partners. Introduction OpenText is committed to the confidentiality, integrity, and availability of its customer information. OpenText believes that the foundation of a highly secure system is that the security is built in to the software from the initial stages of its concept, design, development, deployment, and beyond. In this respect,
    [Show full text]
  • Address Munging: the Practice of Disguising, Or Munging, an E-Mail Address to Prevent It Being Automatically Collected and Used
    Address Munging: the practice of disguising, or munging, an e-mail address to prevent it being automatically collected and used as a target for people and organizations that send unsolicited bulk e-mail address. Adware: or advertising-supported software is any software package which automatically plays, displays, or downloads advertising material to a computer after the software is installed on it or while the application is being used. Some types of adware are also spyware and can be classified as privacy-invasive software. Adware is software designed to force pre-chosen ads to display on your system. Some adware is designed to be malicious and will pop up ads with such speed and frequency that they seem to be taking over everything, slowing down your system and tying up all of your system resources. When adware is coupled with spyware, it can be a frustrating ride, to say the least. Backdoor: in a computer system (or cryptosystem or algorithm) is a method of bypassing normal authentication, securing remote access to a computer, obtaining access to plaintext, and so on, while attempting to remain undetected. The backdoor may take the form of an installed program (e.g., Back Orifice), or could be a modification to an existing program or hardware device. A back door is a point of entry that circumvents normal security and can be used by a cracker to access a network or computer system. Usually back doors are created by system developers as shortcuts to speed access through security during the development stage and then are overlooked and never properly removed during final implementation.
    [Show full text]
  • FANS: Fuzzing Android Native System Services Via Automated Interface Analysis
    FANS: Fuzzing Android Native System Services via Automated Interface Analysis Baozheng Liu1;2,∗ Chao Zhang1;2 , Guang Gong3, Yishun Zeng1;2, Haifeng Ruan4, Jianwei Zhuge1;2 1Institute of Network Science and Cyberspace, Tsinghua University [email protected] 2Beijing National Research Center for Information Science and Technology [email protected] 3Alpha Lab, 360 Internet Security Center 4Department of Computer Science and Technology, Tsinghua University Abstract 1 Introduction Android has become the most popular mobile operating sys- Android native system services provide essential supports and tem, taking over 85% markets according to International Data fundamental functionalities for user apps. Finding vulnerabil- Corporation1. The most fundamental functions of Android ities in them is crucial for Android security. Fuzzing is one of are provided by Android system services, e.g., the camera the most popular vulnerability discovery solutions, yet faces service. Until October 2019, hundreds of vulnerabilities re- several challenges when applied to Android native system lated to Android system services had been reported to Google, services. First, such services are invoked via a special inter- revealing that Android system services are still vulnerable and process communication (IPC) mechanism, namely binder, attractive for attackers. A large portion of these vulnerabilities via service-specific interfaces. Thus, the fuzzer has to recog- reside in native system services, i.e., those mainly written in nize all interfaces and generate interface-specific test cases C++. Vulnerabilities in Android native system services could automatically. Second, effective test cases should satisfy the allow remote attackers to compromise the Android system, interface model of each interface. Third, the test cases should e.g., performing privilege escalation, by means of launching also satisfy the semantic requirements, including variable IPC requests with crafted inputs from third-party applications.
    [Show full text]
  • A United States Perspective on the Ethical and Legal Issues of Spyware Janice C
    A United States Perspective on the Ethical and Legal Issues of Spyware Janice C. Sipior Burke T. Ward Georgina R. Roselli College of Commerce & Finance College of Commerce & Finance College of Commerce & Finance Villanova University Villanova University Villanova University Villanova, PA 19085 USA Villanova, PA 19085 USA Villanova, PA 19085 USA +1-610-519-4347 +1-610-519-4375 +1-610-519-4347 [email protected] [email protected] [email protected] ABSTRACT While information concerning user characteristics and Spyware is regarded as the largest threat to internet users since preferences may be used beneficially to improve product and spam, yet most users do not even know spyware is on their service offerings, the surreptitious nature of its acquisition personal computers. Ethical and legal concerns associated with coupled with no indication of its intended use may raise ethical spyware call for a response. A balance must be found between and legal issues regarding its acceptability. Ethically, spyware legitimate interests of spyware installers, who have obtained installers have an obligation to users to obtain informed consent informed consent of users who accept advertisements or other for the collection and use of personal information. However, in marketing devices, and users who are unwitting targets. the commercially competitive environment of electronic Currently, there is not widespread awareness or understanding commerce, information gathering may be undertaken without of the existence of spyware, its effects, and what remedies are users’ knowledge or permission. available to defend against it. For industry sectors subject to For industry sectors which are subject to data collection laws, data collection and protection laws, spyware results in “spyware can be an unwitting avenue to noncompliance” [9].
    [Show full text]
  • Authentication and Authorization for Mobile Devices
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Göteborgs universitets publikationer - e-publicering och e-arkiv Authentication and Authorization for Mobile Devices Bachelor of Science Thesis in Software Engineering and Management NAVID RANJBAR MAHDI ABDINEJADI The Author grants to Chalmers University of Technology and University of Gothenburg the non-exclusive right to publish the Work electronically and in a non-commercial purpose make it accessible on the Internet. The Author warrants that he/she is the author to the Work, and warrants that the Work does not contain text, pictures or other material that violates copyright law. The Author shall, when transferring the rights of the Work to a third party (for example a publisher or a company), acknowledge the third party about this agreement. If the Author has signed a copyright agreement with a third party regarding the Work, the Author warrants hereby that he/she has obtained any necessary permission from this third party to let Chalmers University of Technology and University of Gothenburg store the Work electronically and make it accessible on the Internet. Authentication and Authorization for Mobile Devices NAVID RANJBAR MAHDI ABDINEJADI © NAVID RANJBAR, June 2012. © MAHDI ABDINEJADI, June 2012. Examiner: HELENA HOLMSTRÖM OLSSON University of Gothenburg Chalmers University of Technology Department of Computer Science and Engineering SE-412 96 Göteborg Sweden Telephone + 46 (0)31-772 1000 Department of Computer Science and Engineering Göteborg, Sweden June 2012 2 Authentication and Authorization for Mobile Devices Navid Ranjbar Mahdi Abdinejadi Department of Computer Science and Engineering Department of Computer Science and Engineering University of Gothenburg University of Gothenburg Gothenburg, Sweden Gothenburg, Sweden [email protected] [email protected] Abstract— Nowadays market demand forces companies to adapt to mobile technology.
    [Show full text]
  • Identification, Authentication and Authorization on the World Wide Web1
    Identification, Authentication and Authorization 1 on the World Wide Web An ICSA White Paper M. E. Kabay, PhD [,CISSP-ISSMP] [formerly] Director of Education, 2 International Computer Security Association Executive summary The buying public are leery of engaging in electronic commerce largely because they worry that their electronic transactions will be insecure. Observers of the growing field of e-commerce concur that lack of consumer confidence is the key stumbling block to continued growth of business on the World Wide Web. Both merchants and clients need to be confident of the identity of the people and institutions with which they are doing business. At a technical level, these concerns focus on identification, authentication and authorization. Identification consists of providing a unique identifier for automated systems; authentication consists of correlating this electronic identity to a real-world, legally-binding identity; and authorization consists of assigning rights to the authenticated identifier. Encryption technologies play a crucial role in protecting confidentiality, integrity and authenticity in cyberspace. Standards for labeling Web sites' compliance with privacy policies help consumers judge where to do business. Digital certificates and electronic cash of various kinds allow authorization for purchases with varying degrees of assurance for customer privacy. Single sign-on systems allow clients to establish and prove their identity once and then shop at several electronic locations without further inconvenience. Systems for extending the content and flexibility of digital certificates allow Web sites to tailor their services more closely to the needs and demands of their clientele. 1 This paper was published in 1997. Ten years later, colleagues asked me to ensure that it would be available on my Web site, so I dug it out of my archives and reformatted it and converted the end-notes to footnotes.
    [Show full text]
  • 19-783 Van Buren V. United States (06/03/2021)
    (Slip Opinion) OCTOBER TERM, 2020 1 Syllabus NOTE: Where it is feasible, a syllabus (headnote) will be released, as is being done in connection with this case, at the time the opinion is issued. The syllabus constitutes no part of the opinion of the Court but has been prepared by the Reporter of Decisions for the convenience of the reader. See United States v. Detroit Timber & Lumber Co., 200 U. S. 321, 337. SUPREME COURT OF THE UNITED STATES Syllabus VAN BUREN v. UNITED STATES CERTIORARI TO THE UNITED STATES COURT OF APPEALS FOR THE ELEVENTH CIRCUIT No. 19–783. Argued November 30, 2020—Decided June 3, 2021 Former Georgia police sergeant Nathan Van Buren used his patrol-car computer to access a law enforcement database to retrieve information about a particular license plate number in exchange for money. Alt- hough Van Buren used his own, valid credentials to perform the search, his conduct violated a department policy against obtaining da- tabase information for non-law-enforcement purposes. Unbeknownst to Van Buren, his actions were part of a Federal Bureau of Investiga- tion sting operation. Van Buren was charged with a felony violation of the Computer Fraud and Abuse Act of 1986 (CFAA), which subjects to criminal liability anyone who “intentionally accesses a computer without authorization or exceeds authorized access.” 18 U. S. C. §1030(a)(2). The term “exceeds authorized access” is defined to mean “to access a computer with authorization and to use such access to ob- tain or alter information in the computer that the accesser is not enti- tled so to obtain or alter.” §1030(e)(6).
    [Show full text]
  • Software Assurance: an Overview of Current Industry Best Practices
    Software Assurance: An Overview of Current Industry Best Practices February 2008 Executive Summary Software Assurance: An Overview of Current Industry Best Practices Software underpins the information infrastructure that govern- ments, critical infrastructure providers and businesses worldwide depend upon for daily operations and business processes. These organizations widely and increasingly use commercial off-the- shelf software (“COTS”) to automate processes with information technology. At the same time, cyber attacks are becoming more stealthy and sophisticated, creating a complex and dynamic risk environment for IT-based operations that users are working to better understand and manage. As such, users have become in- creasingly concerned about the integrity, security and reliability of commercial software. To address these concerns and meet customer requirements, vendors have undertaken significant efforts to reduce vulner- abilities, improve resistance to attack and protect the integrity of the products they sell. These efforts are often referred to as “software assurance.” Software assurance is especially impor- tant for organizations critical to public safety and economic and national security. These users require a high level of confidence that commercial software is as secure as possible, something only achieved when software is created using best practices for secure software development. This white paper provides an overview of how SAFECode mem- bers approach software assurance, and how the use of best practices for software
    [Show full text]
  • Guidelines on Minimum Standards for Developer Verification of Software
    Guidelines on Minimum Standards for Developer Verification of Software Paul E. Black Barbara Guttman Vadim Okun Software and Systems Division Information Technology Laboratory July 2021 Abstract Executive Order (EO) 14028, Improving the Nation’s Cybersecurity, 12 May 2021, di- rects the National Institute of Standards and Technology (NIST) to recommend minimum standards for software testing within 60 days. This document describes eleven recommen- dations for software verification techniques as well as providing supplemental information about the techniques and references for further information. It recommends the following techniques: • Threat modeling to look for design-level security issues • Automated testing for consistency and to minimize human effort • Static code scanning to look for top bugs • Heuristic tools to look for possible hardcoded secrets • Use of built-in checks and protections • “Black box” test cases • Code-based structural test cases • Historical test cases • Fuzzing • Web app scanners, if applicable • Address included code (libraries, packages, services) The document does not address the totality of software verification, but instead recom- mends techniques that are broadly applicable and form the minimum standards. The document was developed by NIST in consultation with the National Security Agency. Additionally, we received input from numerous outside organizations through papers sub- mitted to a NIST workshop on the Executive Order held in early June, 2021 and discussion at the workshop as well as follow up with several of the submitters. Keywords software assurance; verification; testing; static analysis; fuzzing; code review; software security. Disclaimer Any mention of commercial products or reference to commercial organizations is for infor- mation only; it does not imply recommendation or endorsement by NIST, nor is it intended to imply that the products mentioned are necessarily the best available for the purpose.
    [Show full text]
  • Malware Risks and Mitigation Report
    MALWARE RISKS AND MITIGATION REPORT June 2011 BITS A DIVISION OF THE FINANCIAL SERVICES ROUNDTABLE 1001 PENNSYLVANIA AVENUE NW SUITE 500 SOUTH WASHINGTON, DC 20004 202-289-4322 WWW.BITS.ORG BITS Malware Risk and Mitigation Report Table of Contents 1. Executive Summary ..............................................................................................................3 2. Malware Evolution................................................................................................................3 2.1 Malware Categories...............................................................................................................................5 2.2 Malware Example .................................................................................................................................8 2.3 Polymorphic Malware ........................................................................................................................10 3. Malware Supply and Demand ............................................................................................ 10 3.1 The Malware Industry ........................................................................................................................11 3.2 Malware Supply Chain........................................................................................................................13 3.3 Beyond Crime......................................................................................................................................14 4. Malware in Financial
    [Show full text]
  • A Hierarchical Approach for Android Malware Detection Using Authorization-Sensitive Features
    electronics Article A Hierarchical Approach for Android Malware Detection Using Authorization-Sensitive Features Hui Chen 1,2,† , Zhengqiang Li 1,†, Qingshan Jiang 1,* , Abdur Rasool 1,2 and Lifei Chen 3 1 Shenzhen Key Lab for High Performance Data Mining, Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences, Shenzhen 518055, China; [email protected] (H.C.); [email protected] (Z.L.); [email protected] (A.R.) 2 Shenzhen College of Advanced Technology, University of Chinese Academy of Sciences, Shenzhen 518055, China 3 College of Mathematics and Informatics, Fujian Normal University, Fuzhou 350007, China; [email protected] * Correspondence: [email protected]; Tel.: +86-186-6532-6469 † These authors contributed equally to this work. Abstract: Android’s openness has made it a favorite for consumers and developers alike, driving strong app consumption growth. Meanwhile, its popularity also attracts attackers’ attention. Android malware is continually raising issues for the user’s privacy and security. Hence, it is of great practical value to develop a scientific and versatile system for Android malware detection. This paper presents a hierarchical approach to design a malware detection system for Android. It extracts four authorization- sensitive features: basic blocks, permissions, Application Programming Interfaces (APIs), and key functions, and layer-by-layer detects malware based on the similar module and the proposed deep learning model Convolutional Neural Network and eXtreme Gradient Boosting (CNNXGB). This detection approach focuses not only on classification but also on the details of the similarities between malware software. We serialize the key function in light of the sequence of API calls and pick up a similar module that captures the global semantics of malware.
    [Show full text]
  • External Authorization Vs. Authentication
    External Authorization vs. Authentication Christian Patrascu, Oracle Corporation Keywords: Authorization, Authentication, Single Sign On, SSO, Identity Management, IdM, I&AM, Identity and Access Management. Please write down your Keywords. Authorization, Authentication, Single Sign On, SSO, Identity Management, IdM, I&AM, Identity and Access Management Introduction Unlike authentication, which happens only once per session, authorization is active throughout the session, controlling every action and every piece of information displayed to the user. Authorization is the "Glue" which ties Compliance and Security requirements with application code and human workflow. Enterprise-wide authorization solutions focus on technology, business process and compliance requirements. This session covers all aspects involved in deploying end-to-end enterprise wide authorization solutions, lessons learned from field and best practices. The talk will include an overview of the new release of OES 11g, and a discussion with customers about their deployment of OES. Oracle Entitlements Server Oracle Entitlements Server (OES) is a fine grained authorization service which can be used to secure applications and services end-to-end across the enterprise. It provides authorization for a broad set of ecosystems including Java EE, Java SE, .NET, SOA, content management systems and databases. OES comes with several out-of-the-box (OOTB) integrations which can be dropped into a given deployment with minimal impact. It allows for separation of development and deployment cycles, so application developers can be agnostic of deployment issues. As OES is Oracle's strategic authorization solution for all our applications and technology it has been designed to meet the performance and scalability requirements of Oracle's largest and most complex customer deployments.
    [Show full text]