US8539593B2 - Extraction of code level security specification - Google Patents
Extraction of code level security specification Download PDFInfo
- Publication number
- US8539593B2 US8539593B2 US12/358,580 US35858009A US8539593B2 US 8539593 B2 US8539593 B2 US 8539593B2 US 35858009 A US35858009 A US 35858009A US 8539593 B2 US8539593 B2 US 8539593B2
- Authority
- US
- United States
- Prior art keywords
- security
- sensitive operation
- data structure
- check function
- instance
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related, expires
Links
- 238000000605 extraction Methods 0.000 title 1
- 238000000034 method Methods 0.000 claims abstract description 23
- 230000006870 function Effects 0.000 description 84
- 230000003068 static effect Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000013475 authorization Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000001627 detrimental effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
Definitions
- the embodiments relate generally to software security and more particularly to extracting code level security specification from source code.
- an access control scheme may include a number of security check functions that, when called, determine whether a subject (i.e., a process entity) is authorized to perform a particular operation (e.g., read or write) on an object (e.g., a data file, an inode, or a socket).
- a security sensitive operation An operation on a sensitive object is called a security sensitive operation.
- Identified security sensitive operations and the security check functions associated with each object are used to define a security specification for a code.
- a code developer identifies sensitive objects and associates security check functions with the sensitive objects when developing the code.
- the developer inserts a security check function (or a call to a security check function) each time a security sensitive operation path occurs in the code. For example, when a read or write instruction path for a sensitive object occurs in the code (a security sensitive operation), a security check function is inserted into the code.
- the security check function is run to determine whether the entity requesting the security sensitive operation is authorized to perform the operation.
- the security check function authorizes or denies the performance of the operation.
- an exemplary method comprising, receiving a source code, identifying a data structure access in the source code, determining whether the data structure access is associated with a security check function, defining the data structure access as a security sensitive operation responsive to determining that the data structure access is associated with the security check function, and defining a security specification to include the security check function and the security sensitive operation.
- An exemplary system comprising a processor operative to receive a source code, identify a data structure access in the source code, determine whether the data structure access is associated with a security check function, define the data structure access as a security sensitive operation responsive to determining that the data structure access is associated with the security check function, and define a security specification to include the security check function and the security sensitive operation.
- An exemplary computer readable medium including instruction to receive a source code, identify a data structure access in the source code, determine whether the data structure access is associated with a security check function, define the data structure access as a security sensitive operation responsive to determining that the data structure access is associated with the security check function, and define a security specification to include the security check function and the security sensitive operation.
- FIG. 1 illustrates a block diagram of a high level method for reviewing source code.
- FIG. 2 illustrates an example of a security specification.
- FIG. 3 illustrates example portions of code.
- FIG. 4 illustrates example portions of code.
- FIG. 5 illustrates an exemplary embodiment of a system for reviewing source code.
- FIG. 1 illustrates a block diagram of a high level method for reviewing source code to determine whether every security sensitive operation is associated with a security check function.
- the source code is received.
- the security check functions used in the code are identified.
- the security check functions are usually annotated in header information in the code and are labeled with identifiers (e.g., security_file_mmap ( ⁇ file>, . . . )).
- the reviewer may then identify the sensitive operations in the code by reviewing the body of the code to find security check functions (or calls to security check functions) and determining what object is associated with each security check function and identifying the data structure access in block 106 .
- An object typically resides in a particular field of a data structure.
- An object associated with a security check function may be defined as a sensitive object.
- the security specification is defined.
- a security specification includes a security check function and each of the security sensitive operations (data structure accesses, i.e., a read or write function associated with a sensitive object) that, when requested, should call and run the security check function.
- the code may be reviewed to find each security sensitive operation listed in the security specification in block 110 .
- the code is verified to determine whether the code includes the running of a security check function prior to performing the security sensitive operation in block 112 .
- the results including the security specification may be output to a user for analysis in block 114 .
- FIG. 2 illustrates an example of a security specification 200 .
- the security specification 200 includes a security check function and the associated security sensitive operation defined as a numbered list of data structure accesses (e.g., “READ” instruction; and the data structure and field, “inode->i_size”).
- FIG. 3 illustrates two example portions of code that will be used to illustrate a typical method for defining a security specification.
- a security check is shown that is called and run when the shown security sensitive operation is requested.
- the known security check function is found in the code, and the security sensitive operation may be identified.
- the sensitive object associated with the security sensitive operation data structure access
- the security check function may be identified; associated with the security check function; and added to the security specification (in block 108 ).
- the security sensitive operation of block 302 is different than the security sensitive operation of block 301 . If the security sensitive operation of block 302 is not associated with a security check function it may be easily missed by a reviewer.
- FIG. 4 illustrates two example portions of code.
- Blocks 401 and 402 show two security sensitive operations that are protected by a security check function. Identifying the security sensitive operations by their function names does not necessarily identify the sensitive data structure access that includes the sensitive data.
- Blocks 403 and 404 show the sensitive data structures that are called by the two security sensitive operations.
- the sensitive data structure access (security sensitive object) in block 404 includes the same data structure and field as the protected security sensitive object of block 403 (inode->i_size).
- the function names of the security sensitive operations are different, the functions access the same data structures. Thus, using data structures accesses as opposed to function names to identify security sensitive operations is less error prone.
- the security specification is used in block 110 (of FIG. 1 ) to find each security sensitive operation in the code and verify (in block 112 ) that the security check function associated with each found security sensitive operation in the security specification is run when each security sensitive operation is performed.
- An incomplete or inaccurate security specification results in a failure to identify security violations in the code because a correct security specification should include each security sensitive operation.
- defining a security specification by merely identifying occurrences of security check functions in code; using the identified security check functions to identify associated operations; defining the associated operations as security sensitive operations; and adding the security sensitive operations is prone to error. Since instances of the same type of security sensitive operations access the same sensitive data structures, if the code is reviewed to identify the sensitive data structures associated with known instances of security sensitive operations, the identified sensitive data structures may then be used to identify unknown instances of security sensitive operations.
- FIG. 5 illustrates an exemplary embodiment of a system for reviewing source code.
- the system 500 includes a processor 502 communicatively connected to a display device 504 , input devices 506 , and a memory 508 .
- the memory 508 may include any computer readable medium, for example, an optical disk, a magnetic disk, and a solid state memory device. In operation the system may perform the methods described herein.
- a security check function Check i may be called multiple times in the program, each of which is called an instance of the security check function, denoted as InstanceOf(Check i ) v , where v is between 1 and the total number of Check i instances inclusive.
- a security sensitive operation Op i may appear in the program multiples times, and each of which is called an instance of the sensitive operation, InstanceOf(Op i ) u . If for all instances of the sensitive operation, there exists at least one instance of security check function to protect the sensitive operation, then the sensitive operation is protected by the security check function.
- AST is an Abstract Syntax Tree.
- AccessSet i ( Check i , AccessSet i ) , ⁇ where ⁇ ⁇ Check i ⁇ CheckSet .
- InstanceOf(AccessSet i ) u is a violation to InferredRule i if it is not protected by any instance of the security check function. Defined below:
- the code is broken into modules (e.g., each file system is a module) based on the compilation configurations that come with the software (e.g. in Makefile), and the root functions of each module as functions that actually use security check functions for authorization check are determined, where root functions are functions that are not called by any other functions in the module.
- modules e.g., each file system is a module
- the code is broken into modules (e.g., each file system is a module) based on the compilation configurations that come with the software (e.g. in Makefile), and the root functions of each module as functions that actually use security check functions for authorization check are determined, where root functions are functions that are not called by any other functions in the module.
- These root functions can be automatically extracted by analyzing the call graphs of each module.
- the data structure access set may be extracted for each instance of a security check function.
- the intersection of all of the access sets is computed. Since the static analysis may miss some data structure accesses for some root functions due to analysis imprecision, accesses are not required to be protected by all instances. Instead, if intersecting an access set results in an empty set, the access set is dropped because it is likely to be an incomplete set. As long as there are enough security check instances protecting the accesses, the accesses are security sensitive and the inferred rule is assumed to be valid.
- check function security mode rmdir ( ) is only called once in the virtual file system level, but it actually protects the sensitive rmdir operation of many different file systems. Therefore, semantically the check function is invoked once for each file system.
- an intersect of the rmdir operations of different file systems may be used to obtain the essential protected sensitive accesses.
- This strategy makes it possible for the method to automatically generate rules of reasonably small sizes with high confidence even for check functions that are called only a few times. This is realized by performing a function alias analysis and generating a separate static trace for each function alias, essentially treating each function alias as if it was a separate function call.
- Inter-procedural and flow-insensitive static program analysis is used to infer security rules and detect violations.
- Inter-procedural analysis is used because many sensitive data structure accesses related to the same sensitive operation are performed in different functions. The accesses can be many (e.g., 18) levels apart in the call chain, meaning the caller of one access can be the 18th ancestor caller of another access.
- An intra-procedural analysis would not adequately capture the security rules or be effective at detecting violations. Without the above described inter-procedural analysis, most of the violations may be undetectable.
- function pointers are widely used in Linux and Xen, and simple function pointer analysis is used by resolving a function pointer to functions with the same type. The analysis is conservative in the absence of type cast.
- An untrusted-space exposability analysis may be used to limit false positive results.
- the analysis identifies security sensitive operations that are performed by the trusted computing base on its own behalf and exempts them from the requirement of being protected by the security check.
- the kernel for example, defining the kernel to be a trusted computing base, security sensitive operations in kernel space that do not interact with the untrusted space (user space entity), do not need to be protected by a security check function because the kernel is trusted to perform any operations on its own behalf.
- a security check may be mandatory.
- Xen the hypervisor is defined as the trusted computing base.
- a trusted space exposability study is performed.
- a list of user space interface functions is compiled that are known a priori to be exposed to user space, e.g., system calls such as sys_read ().
- the sensitive operations that are reachable from these interface functions are identified. If a sensitive operation that can be exposed to the untrusted space is not protected by the proper security check function, we report the violation as an error; otherwise, we report the violation as a warning.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Storage Device Security (AREA)
Abstract
Description
Claims (14)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US12/358,580 US8539593B2 (en) | 2009-01-23 | 2009-01-23 | Extraction of code level security specification |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US12/358,580 US8539593B2 (en) | 2009-01-23 | 2009-01-23 | Extraction of code level security specification |
Publications (2)
Publication Number | Publication Date |
---|---|
US20100192194A1 US20100192194A1 (en) | 2010-07-29 |
US8539593B2 true US8539593B2 (en) | 2013-09-17 |
Family
ID=42355249
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US12/358,580 Expired - Fee Related US8539593B2 (en) | 2009-01-23 | 2009-01-23 | Extraction of code level security specification |
Country Status (1)
Country | Link |
---|---|
US (1) | US8539593B2 (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9830149B2 (en) * | 2016-01-14 | 2017-11-28 | International Business Machines Corporation | Automatic extraction of sensitive code fragments to be executed in a sandbox |
US10033602B1 (en) | 2015-09-29 | 2018-07-24 | Amazon Technologies, Inc. | Network health management using metrics from encapsulation protocol endpoints |
US10044581B1 (en) | 2015-09-29 | 2018-08-07 | Amazon Technologies, Inc. | Network traffic tracking using encapsulation protocol |
US10243820B2 (en) | 2016-09-28 | 2019-03-26 | Amazon Technologies, Inc. | Filtering network health information based on customer impact |
US10248532B1 (en) | 2015-09-15 | 2019-04-02 | Amazon Technologies, Inc. | Sensitive data usage detection using static analysis |
US10862777B2 (en) | 2016-09-28 | 2020-12-08 | Amazon Technologies, Inc. | Visualization of network health information |
US10911263B2 (en) | 2016-09-28 | 2021-02-02 | Amazon Technologies, Inc. | Programmatic interfaces for network health information |
US11641319B2 (en) | 2016-09-28 | 2023-05-02 | Amazon Technologies, Inc. | Network health data aggregation service |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8782603B2 (en) * | 2010-12-21 | 2014-07-15 | Sap Ag | Standardized configuration checklists for software development |
US20140109070A1 (en) * | 2012-10-11 | 2014-04-17 | Tata Consultancy Services Limited | System and method for configurable entry points generation and aiding validation in a software application |
US9690945B2 (en) | 2012-11-14 | 2017-06-27 | International Business Machines Corporation | Security analysis using relational abstraction of data structures |
US9158935B2 (en) * | 2013-06-07 | 2015-10-13 | Microsoft Technology Licensing, Llc | Automatic mediation of resource access in mobile applications |
US9558128B2 (en) * | 2014-10-27 | 2017-01-31 | Seagate Technology Llc | Selective management of security data |
US10657022B2 (en) | 2017-02-20 | 2020-05-19 | Tsinghua University | Input and output recording device and method, CPU and data read and write operation method thereof |
US10642981B2 (en) * | 2017-02-20 | 2020-05-05 | Wuxi Research Institute Of Applied Technologies Tsinghua University | Checking method, checking device and checking system for processor |
US10684896B2 (en) | 2017-02-20 | 2020-06-16 | Tsinghua University | Method for processing asynchronous event by checking device and checking device |
US10572671B2 (en) | 2017-02-20 | 2020-02-25 | Tsinghua University | Checking method, checking system and checking device for processor security |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1421770A (en) | 2001-11-28 | 2003-06-04 | 刘有志 | METHODS OF AUTHORIZED EXECUTION AND USE OF PROGRAMS AND MATERIALS |
EP1624692A1 (en) | 2004-08-03 | 2006-02-08 | Thomson Licensing | Forcing an action in a terminal |
US20060288226A1 (en) | 2005-06-15 | 2006-12-21 | Stelor Productions, Llc. | System and method for establishing and authorizing a security code |
US20070094707A1 (en) | 2000-02-01 | 2007-04-26 | Teleran Technologies, Inc. | Rule Based Security Policy Enforcement |
US20070150965A1 (en) | 2000-11-13 | 2007-06-28 | Redlich Ron M | Data Security System and Method Adjunct to a Browser, Telecom or Encryption Program |
US20070180490A1 (en) | 2004-05-20 | 2007-08-02 | Renzi Silvio J | System and method for policy management |
US20070226797A1 (en) | 2006-03-24 | 2007-09-27 | Exploit Prevention Labs, Inc. | Software vulnerability exploitation shield |
US7849509B2 (en) * | 2005-10-07 | 2010-12-07 | Microsoft Corporation | Detection of security vulnerabilities in computer programs |
-
2009
- 2009-01-23 US US12/358,580 patent/US8539593B2/en not_active Expired - Fee Related
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070094707A1 (en) | 2000-02-01 | 2007-04-26 | Teleran Technologies, Inc. | Rule Based Security Policy Enforcement |
US20070150965A1 (en) | 2000-11-13 | 2007-06-28 | Redlich Ron M | Data Security System and Method Adjunct to a Browser, Telecom or Encryption Program |
CN1421770A (en) | 2001-11-28 | 2003-06-04 | 刘有志 | METHODS OF AUTHORIZED EXECUTION AND USE OF PROGRAMS AND MATERIALS |
US20070180490A1 (en) | 2004-05-20 | 2007-08-02 | Renzi Silvio J | System and method for policy management |
EP1624692A1 (en) | 2004-08-03 | 2006-02-08 | Thomson Licensing | Forcing an action in a terminal |
US20060288226A1 (en) | 2005-06-15 | 2006-12-21 | Stelor Productions, Llc. | System and method for establishing and authorizing a security code |
US7849509B2 (en) * | 2005-10-07 | 2010-12-07 | Microsoft Corporation | Detection of security vulnerabilities in computer programs |
US20070226797A1 (en) | 2006-03-24 | 2007-09-27 | Exploit Prevention Labs, Inc. | Software vulnerability exploitation shield |
Non-Patent Citations (3)
Title |
---|
Ganapathy et al., "Mining Security Sensitive Operations in Legacy Code using Concept Analysis," May 2007, ICSE'07 29th International Conference on Software Engineering, pp. 1-12. * |
Lin Tan et al, "AutoISES: Automatically Inferring Security Specifications and Detecting Violation" USENIX Security Symposium 2008: 379-394. |
Zhenmin, Li et al., "PR-MINER: Automatically Extracting Implicit Programming Rules and Detecting Violation in Large Software Code", ESEC/SIGSOFT FSE 2005: 306-315. |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10248532B1 (en) | 2015-09-15 | 2019-04-02 | Amazon Technologies, Inc. | Sensitive data usage detection using static analysis |
US10033602B1 (en) | 2015-09-29 | 2018-07-24 | Amazon Technologies, Inc. | Network health management using metrics from encapsulation protocol endpoints |
US10044581B1 (en) | 2015-09-29 | 2018-08-07 | Amazon Technologies, Inc. | Network traffic tracking using encapsulation protocol |
US10917322B2 (en) | 2015-09-29 | 2021-02-09 | Amazon Technologies, Inc. | Network traffic tracking using encapsulation protocol |
US9830149B2 (en) * | 2016-01-14 | 2017-11-28 | International Business Machines Corporation | Automatic extraction of sensitive code fragments to be executed in a sandbox |
US10243820B2 (en) | 2016-09-28 | 2019-03-26 | Amazon Technologies, Inc. | Filtering network health information based on customer impact |
US10862777B2 (en) | 2016-09-28 | 2020-12-08 | Amazon Technologies, Inc. | Visualization of network health information |
US10911263B2 (en) | 2016-09-28 | 2021-02-02 | Amazon Technologies, Inc. | Programmatic interfaces for network health information |
US11641319B2 (en) | 2016-09-28 | 2023-05-02 | Amazon Technologies, Inc. | Network health data aggregation service |
US12068938B2 (en) | 2016-09-28 | 2024-08-20 | Amazon Technologies, Inc. | Network health data aggregation service |
Also Published As
Publication number | Publication date |
---|---|
US20100192194A1 (en) | 2010-07-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8539593B2 (en) | Extraction of code level security specification | |
US8656496B2 (en) | Global variable security analysis | |
US10380349B2 (en) | Security analysis using relational abstraction of data structures | |
CN107657177A (en) | A kind of leak detection method and device | |
Huang et al. | Detecting sensitive data disclosure via bi-directional text correlation analysis | |
US20100131472A1 (en) | Detection and utilzation of inter-module dependencies | |
Wressnegger et al. | Twice the bits, twice the trouble: Vulnerabilities induced by migrating to 64-bit platforms | |
Khoury et al. | Execution trace analysis using ltl-fo | |
US20170344746A1 (en) | Utilizing likely invariants for runtime protection of web services | |
CN110727476B (en) | Method, device, equipment and storage medium for generating authorization configuration file | |
US20180046454A1 (en) | Securing secret information in source code verification and at runtime | |
US11868465B2 (en) | Binary image stack cookie protection | |
US11886589B2 (en) | Process wrapping method for evading anti-analysis of native codes, recording medium and device for performing the method | |
US9171168B2 (en) | Determine anomalies in web application code based on authorization checks | |
RU168346U1 (en) | VULNERABILITY IDENTIFICATION DEVICE | |
EP3765965B1 (en) | Static software analysis tool approach to determining breachable common weakness enumerations violations | |
US20140137083A1 (en) | Instrumenting computer program code by merging template and target code methods | |
Hermann et al. | Getting to know you: Towards a capability model for java | |
Klieber et al. | Automated code repair based on inferred specifications | |
CN111625784B (en) | Anti-debugging method of application, related device and storage medium | |
CN118860470B (en) | Component vulnerability repair method, device, electronic device and storage medium | |
CN111143851A (en) | Applicable to detection method and system of operating system kernel object address leakage | |
US12314155B2 (en) | Rule engine for functional safety certification | |
US20240354230A1 (en) | Rule engine for functional safety certification | |
Shim et al. | Semantic-aware Comment Analysis Approach for API Permission Mapping on Android |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
AS | Assignment |
Owner name: INTERNATIONAL BUSINESS MACHINES CORPORATION, NEW Y Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:TAN, LIN;ZHANG, XIAOLAN;ZHOU, YUANYUAN;SIGNING DATES FROM 20081223 TO 20090105;REEL/FRAME:022163/0936 |
|
STCF | Information on status: patent grant |
Free format text: PATENTED CASE |
|
REMI | Maintenance fee reminder mailed | ||
FEPP | Fee payment procedure |
Free format text: SURCHARGE FOR LATE PAYMENT, LARGE ENTITY (ORIGINAL EVENT CODE: M1554) |
|
MAFP | Maintenance fee payment |
Free format text: PAYMENT OF MAINTENANCE FEE, 4TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1551) Year of fee payment: 4 |
|
AS | Assignment |
Owner name: SERVICENOW, INC., CALIFORNIA Free format text: CONVEYOR IS ASSIGNING UNDIVIDED 50% INTEREST;ASSIGNOR:INTERNATIONAL BUSINESS MACHINES CORPORATION;REEL/FRAME:044413/0144 Effective date: 20171102 Owner name: INTERNATIONAL BUSINESS MACHINES CORPORATION, NEW Y Free format text: CONVEYOR IS ASSIGNING UNDIVIDED 50% INTEREST;ASSIGNOR:INTERNATIONAL BUSINESS MACHINES CORPORATION;REEL/FRAME:044413/0144 Effective date: 20171102 |
|
FEPP | Fee payment procedure |
Free format text: MAINTENANCE FEE REMINDER MAILED (ORIGINAL EVENT CODE: REM.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY |
|
LAPS | Lapse for failure to pay maintenance fees |
Free format text: PATENT EXPIRED FOR FAILURE TO PAY MAINTENANCE FEES (ORIGINAL EVENT CODE: EXP.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY |
|
STCH | Information on status: patent discontinuation |
Free format text: PATENT EXPIRED DUE TO NONPAYMENT OF MAINTENANCE FEES UNDER 37 CFR 1.362 |
|
FP | Lapsed due to failure to pay maintenance fee |
Effective date: 20210917 |