<<

Trustworthy Whole-System for the Kernel

Adam Bates, Dave (Jing) Tian, Thomas Moyer Kevin R.B. Butler University of Florida MIT Lincoln Laboratory {adammbates,daveti,butler}@ufl.edu [email protected]

Abstract is presently of enormous interest in a variety of dis- In a provenance-aware system, mechanisms gather parate communities including scientific data processing, and report metadata that describes the history of each ob- databases, software development, and storage [43, 53]. ject being processed on the system, allowing users to un- Provenance has also been demonstrated to be of great derstand how data objects came to exist in their present value to security by identifying malicious activity in data state. However, while past work has demonstrated the centers [5, 27, 56, 65, 66], improving Mandatory Access usefulness of provenance, less attention has been given Control (MAC) labels [45, 46, 47], and assuring regula- to securing provenance-aware systems. Provenance it- tory compliance [3]. self is a ripe attack vector, and its authenticity and in- Unfortunately, most provenance collection mecha- tegrity must be guaranteed before it can be put to use. nisms in the literature exist as fully-trusted We present Linux Provenance Modules (LPM), applications [28, 27, 41, 56]. Even kernel-based prove- the first general framework for the development of nance mechanisms [43, 48] and sketches for trusted provenance-aware systems. We demonstrate that LPM provenance architectures [40, 42] fall short of providing creates a trusted provenance-aware execution environ- a provenance-aware system for malicious environments. ment, collecting complete whole-system provenance The problem of whether or not to trust provenance is fur- while imposing as little as 2.7% performance overhead ther exacerbated in distributed environments, or in lay- on normal system operation. LPM introduces new mech- ered provenance systems, due to the lack of a mechanism anisms for secure provenance layering and authenticated to verify the authenticity and integrity of provenance col- communication between provenance-aware hosts, and lected from different sources. also interoperates with existing mechanisms to provide In this work, we present Linux Provenance Modules strong security assurances. To demonstrate the poten- (LPM), the first generalized framework for secure prove- tial uses of LPM, we design a Provenance-Based Data nance collection on the Linux . Mod- Loss Prevention (PB-DLP) system. We implement PB- ules capture whole-system provenance, a detailed record DLP as a file transfer application that blocks the trans- of processes, IPC mechanisms, network activity, and mission of files derived from sensitive ancestors while even the kernel itself; this capture is invisible to the ap- imposing just tens of milliseconds overhead. LPM is the plications for which provenance is being collected. LPM first step towards widespread deployment of trustworthy introduces a gateway that permits the upgrading of low provenance-aware applications. integrity workflow provenance from user space. LPM also facilitates secure distributed provenance through an authenticated, tamper-evident channel for the transmis- 1 Introduction sion of provenance metadata between hosts. LPM inter- operates with existing security mechanisms to establish a A provenance-aware system automatically gathers and hardware-based root of trust to protect system integrity. reports metadata that describes the history of each ob- ject being processed on the system. This allows users to Achieving the goal of trustworthy whole-system track, and understand, how a piece of data came to ex- provenance, we demonstrate the power of our approach ist in its current state. The application of provenance by presenting a scheme for Provenance-Based Data Loss Prevention (PB-DLP). PB-DLP allows administrators to The Lincoln Laboratory portion of this work was sponsored by the reason about the propagation of sensitive data and control Assistant Secretary of Defense for Research & Engineering under Air its further dissemination through an expressive policy Force Contract #FA8721-05-C-0002. Opinions, interpretations, con- clusions and recommendations are those of the author and are not nec- system, offering dramatically stronger assurances than essarily endorsed by the United States Government. existing enterprise solutions, while imposing just mil- /etc/rc.local:0 /bin/ps:0 /var/spool/cron/root:0 /etc/passwd:0 /etc/shadow:0 root

Used Used Used Used Used WasControlledBy Malicious Binary WasGeneratedBy WasGeneratedByWasGeneratedBy WasGeneratedBy WasGeneratedBy

/etc/rc.local:1 /bin/ps:1 /var/spool/cron/root:1 /etc/passwd:1 /etc/shadow:1

Figure 1: A provenance graph showing the attack footprint of a malicious binary. Edges encode relationships that flow backwards into the history of system execution, and writing to an object creates a second node with an incremented version number. Here, we see that the binary has rewritten /etc/rc.local, likely in an attempt to gain persistence after a system reboot. liseconds of overhead on file transmission. To our knowl- and “In what environment was the data produced?" Con- edge, this work is the first to apply provenance to DLP. versely, provenance can also answer questions about the Our contributions can thus be summarized as follows: successors of a piece of data, such as “What objects on the system were derived from this object?" Although po- • Introduce Linux Provenance Modules (LPM). tential applications for such information are nearly lim- LPM facilitates secure provenance collection at the itless, past proposals have conceptualized provenance in kernel layer, supports attested disclosure at the ap- different ways, indicating that a one-size-fits-all solution plication layer, provides an authenticated channel to provenance collection is unlikely to meet the needs of for network transmission, and is compatible with all of these audiences. We review these past proposals the W3C Provenance (PROV) Model [59]. In eval- for provenance-aware systems in Section 8. uation, we demonstrate that provenance collection The commonly accepted representation for data prove- imposes as little as 2.7% performance overhead. nance is a directed acyclic graph (DAG). In this work, we use the W3C PROV-DM specification [59] because it is • Demonstrate secure deployment. Leveraging pervasive and facilitates the exchange of provenance be- LPM and existing security mechanisms, we create tween deployments. An example PROV-DM graph of a a trusted provenance-aware execution environment malicious binary is shown in Figure 1. This graph de- for Linux. Through porting Hi-Fi [48] and provid- scribes an attack in which a binary running with root ing support for SPADE [29], we demonstrate the privilege reads several sensitive system files, then ed- relative ease with which LPM can be used to secure its those files in an attempt to gain persistent access to existing provenance collection mechanisms. We the host. Edges encode relationships between nodes, show that, in realistic malicious environments, ours pointing backwards into the history of system execution. is the first proposed system to offer secure prove- Writing to an object triggers the creation of a second ob- nance collection. ject node with an incremented version number. This par- ticular provenance graph could serve as a valuable foren- • Introduce Provenance-Based Data Loss Preven- sics tool, allowing system administrators to better under- tion (PB-DLP). We present a new paradigm for stand the nature of a network intrusion. the prevention of data leakage that searches object provenance to identify and prevent the spread of sensitive data. PB-DLP is impervious to attempts to launder data through intermediary files and IPC. 2.1 Data Loss Prevention We implement PB-DLP as a file transfer applica- tion, and demonstrate its ability to query object an- Data Loss Prevention (DLP) is enterprise software that cestries in just tens of milliseconds. seeks to minimize the leakage of sensitive data by moni- toring and controlling information flow in large, complex organizations [1].1 In addition to the desire to control in- 2 Background tellectual property, another motivator for DLP systems is demonstrating regulatory compliance for personally- Data provenance, sometimes called lineage, describes identifiable information (PII),2 as well as directives such the actions taken on a data object from its creation up to the present. Provenance can be used to answer a va- 1 riety of historical questions about the data it describes. Our overview of data loss prevention is based on review of pub- licly available product descriptions for software developed by Bit9, Such questions include, but are not limited to, “What CDW, Cisco, McAfee, Symantec, and Titus. processes and datasets were used to generate this data?" 2 See NIST SP 800-122

2 as PCI,3 HIPAA,4 SOX.5 or E.U. Data Protection.6 As 3.1 Defining Whole-System Provenance encryption can be used to protect data at rest from unau- thorized access, the true DLP challenge involves prevent- In the design of LPM, we adopt a model for whole- 9 ing leakage at the hands of authorized users, both mali- system provenance that is broad enough to accom- cious and well-meaning agents. This latter group is a modate the needs of a variety of existing provenance surprisingly big problem in the fight to control an organi- projects. To arrive at a definition, we inspect four zation’s intellectual property; a 2013 study conducted by past proposals that collect broadly scoped provenance: the Ponemon Institute found that over half of companies’ SPADE [29], LineageFS [53], PASS [43], and Hi-Fi [48]. employees admitted to emailing intellectual property to SPADE provenance is structured around primitive oper- their personal email accounts, with 41 percent admitting ations of system activities with data inputs and outputs. to doing so on a weekly basis [2]. It is therefore im- It instruments file and system calls, and asso- portant for a DLP system to be able to exhaustively ex- ciates each call to a process ID (PID), user identifier, and plain which pieces of data are sensitive, where that data network address. LineageFS uses a similar definition, has propagated to within the organization, and where it associating process IDs with the file descriptors that the is (and is not) permitted to flow. process reads and writes. PASS associates a process’s As DLP systems are proprietary and are marketed so output with references to all input files and the command as to abstract away the complex details of their inter- line and process environment of the process; it also ap- nal workings, we cannot offer a complete explanation of pends out-of-band knowledge such as OS and hardware their core features. However, some of the mechanisms descriptions, and random number generator seeds, if pro- in such systems are known. Many DLP products use a vided. In each of these systems, networking and IPC regular expression-based approach to identify sensitive activity is primarily reflected in the provenance record data, operating similarly to a general-purpose version of through manipulation of the underlying file descriptors. Cornell’s Spider7. For example, in PCI compliance,3 Hi-Fi takes an even broader approach to provenance, DLP might attempt to identify credit card in treating non-persistent objects such as memory, IPC, and outbound emails by searching for 16 digit numbers that network packets as principal objects. pass a Mod-10 validation check [39]. Other DLP systems We observe that, in all instances, provenance-aware use a label-based approach to identify sensitive data, tag- systems are exclusively concerned with operations on ging document metadata with security labels. The Titus controlled data types, which are identified by Zhang et system accomplishes this by having company employees al. as files, , superblocks, socket buffers, IPC manually annotate the documents that they create;8 plug- messages, IPC message queue, semaphores, and shared ins for applications (e.g., Microsoft Office) then prevent memory [64]. Because controlled data types represent a the document from being transmitted to or opened by super set of the objects tracked by system layer prove- other employees that lack the necessary clearance. In ei- nance mechanisms, we define whole-system provenance ther approach, DLP software is difficult to configure and as a complete description of agents (users, groups) con- prone to failure, offering marginal utility at great price. trolling activities (processes) interacting with controlled data types during system execution.

3 Linux Provenance Modules 3.2 Threat Model & Assumptions To serve as the foundation for secure provenance-aware We consider an adversary that has gained remote access systems, we present Linux Provenance Modules (LPM). to a provenance-aware host or network. Once inside the We provide a working definition for the provenance our system, the attacker may attempt to remove provenance system will collect in §3.1. In §3.2 we consider the ca- records, insert spurious information into those records, pabilities and aims of a provenance-aware adversary, and or find gaps in the provenance monitor’s ability to record identify security and design goals in §3.3. The LPM de- information flows. A network attacker may also attempt sign is presented in §3.4, and in §3.5 we demonstrate its to forge or strip provenance from data in transit. Be- secure deployment. An expanded description of our sys- cause captured provenance can be put to use in other ap- tem is available in our technical report [8]. plications, the adversary’s goal may even be to target the provenance monitor itself. The implications and meth- 3 See https://www.pcisecuritystandards.org 4 See http://www.hhs.gov/ocr/privacy ods of such an attack are domain-specific. For example: 5 Short for the Sarbanes-Oxley Act, U.S. Public Law No. 107-20 6 See EU Directive 95/46/EC 9This term is coined in [48], but not explicitly defined. We demon- 7 See http://www2.cit.cornell.edu/security/tools strate the concrete requirements of a collection mechanism for whole- 8 See http://www.titus.com system provenance in this work.

3 • Scientific Computing: An adversary may wish to ma- user space nipulate provenance in order to commit fraud, or to in- Prov. Aware ject uncertainty into records to trigger a “Climategate”- Applications GZip like controversy [50]. Provenance SQL • Access Control: When used to mediate access deci- Recorder Neo4j sions [7, 45, 46, 47], an attacker could tamper with provenance in order to gain unauthorized access, or to SNAP perform a denial-of-service attack on other users by ar- Relay Buffer tificially escalating the security level of data objects. kernel space IMA Prov. Module • Networks: Provenance metadata can also be associ- ated with packets in order to better understand network TPM Prov. Hooks NF Hooks

events in distributed systems [5, 65, 66]. Coordinating System Provenance Workflow Provenance multiple compromised hosts, an attacker may attempt Integrity Measurements to send unauthenticated messages to avoid provenance generation and to perform data exfiltration. Figure 2: Diagram of the LPM Framework. Kernel We define a provenance trusted computing base (TCB) hooks report provenance to a recorder in userspace, to be the kernel mechanisms, provenance recorder, and which uses one of several storage back-ends. The storage back-ends responsible for the collection and recorder is also responsible for evaluating the integrity management of provenance. Provenance-aware appli- of workflow provenance prior to storing it. cations are not considered part of the TCB. We make the following assumption with regards to the adversarial target. The TCB must therefore be im- TCB. In Linux, kernel modules have unrestricted access pervious to disabling or manipulation by processes to kernel memory, meaning that there is no mechanism in user space. for protecting LPM from the rest of the kernel. The ker- nel code is therefore trusted; we assume that the stock G3 Verifiable. The functionality of LPM must be kernel will not seek to tamper with the TCB. However, verifiably correct. Additionally, local and remote we do consider the possibility that the kernel could be users should be able to attest whether the host with compromised after installation through its interactions which they are communicating is running the se- with user space applications. To facilitate host attestation cured provenance-aware kernel. in distributed environments, we also assume access to a Public Key Infrastructure (PKI) for provenance-aware Through surveying past work in provenance-aware hosts to publish their public signing keys. systems, we identify the following additional goals to support whole-system provenance:

3.3 System Goals G4 Authenticated Channel. In distributed environ- We set out to provide the following security assurances ments, provenance-aware systems must provide a in the design of of our system-layer provenance collec- means of assuring authenticity and integrity of tion mechanism. McDaniel et al. liken the needs of a provenance as it is communicated over open net- secure provenance monitor [42] to the reference monitor works [7, 42, 48, 65]. While we do not seek to guarantees laid out by Anderson [4]: complete media- provide a complete distributed provenance solution tion, tamperproofness, and verifiability. We define these in LPM, we do wish to provide the required build- guarantees as follows: ing blocks within the host for such a system to ex- ist. LPM must therefore be able to monitor ev- G1 Complete. Complete mediation for provenance has ery network message that is sent or received by the been discussed elsewhere in the literature in terms host, and reliably explain these messages to other of assuring completeness [32]: that the provenance provenance-aware hosts in the network. record be gapless in its description of system activ- ity. To facilitate this, LPM must be able to observe G5 Attested Disclosure. Layered provenance, where all information flows that pass through controlled additional metadata is disclosed from higher opera- data types. tional layers, is a desirable feature in provenance- aware systems, as applications are able to report G2 Tamperproof. As many provenance use cases in- workflow semantics that are invisible to the oper- volve enhancing system security, LPM will be an ating system [44]. LPM must provide a gateway for

4 upgrading low integrity user space disclosures be- fore logging them in the high integrity provenance Text Editor user space

record. This is consistent with the Clark-Wilson In- open System Call kernel space tegrity model for upgrading or discarding low in- tegrity inputs [17]. Look Up

Error Checks In order to bootstrap trust in our system, we have im-

plemented LPM as a parallel framework to Linux Secu- DAC Checks rity Modules (LSM) [60, 61]. Building on these results, LSM Module Examine context. "Authorized?" Does request pass policy? we show in Section 4 that this approach allows LPM to LSM Hook Yes or No Grant or deny. inherit the formal assurances that have been verified for LPM Module the LSM architecture. Examine context. "Prov collected?" Collect provenance. LPM Hook Yes or No If successful, grant.

3.4 Design & Implementation Access Inode An overview of the LPM architecture is shown in Fig- ure 2. The LPM patch places a set of provenance hooks Figure 3: Hook Architecture for the open system call. around the kernel; a provenance module then registers Provenance is collected after DAC and LSM checks, en- to control these hooks, and also registers several Netfil- suring that it accurately reflects system activity. LPM ter hooks; the module then observes system events and will only deny the operation if it fails to generate prove- transmits information via a relay buffer to a provenance nance for the event. recorder in user space that interfaces with a datastore. The recorder also accepts disclosed provenance from ap- hooks that correspond to existing security hooks, we also plications after verifying their correctness using the In- support Pohly et al.’s Hi-Fi [48] hook that is necessary to tegrity Measurements Architecture (IMA) [52]. preserve Lamport timestamps on network messages [38]. In designing LPM, we first considered using an exper- imental patch to the LSM framework that allows “stack- ing” of LSM modules 10. However, at this time, no stan- 3.4.2 Netfilter Hooks dard exists for handling when modules make conflict- LPM uses Netfilter hooks to implement a cryptographic ing decisions, creating the potential unpredicted behav- message commitment protocol. In Hi-Fi, provenance- ior. We also felt that dedicated provenance hooks were aware hosts communicated by embedding a provenance necessary; by collecting provenance after LSM autho- sequence number in the IP options field [49] of each out- rization routines, we ensure that the provenance history bound packet [48]. This approach allowed Hi-Fi to com- is an accurate description of authorized system events. If municate as normal with hosts that were not provenance- provenance collection occurred during authorization, as aware, but unfortunately was not secure against a net- would be the case with stacked LSMs, it would not be work adversary. In LPM, provenance sequence numbers possible to provide this property. are replaced with Digital Signature Algorithm (DSA) signatures, which are space-efficient enough to embed in 3.4.1 Provenance Hooks the IP Options field. We have implemented full DSA support in the Linux kernel by creating signing rou- The LPM patch introduces a set of hook functions in the tines to use with the existing DSA verification func- Linux kernel. These hooks behave similarly to the LSM tion. DSA signing and verification occurs in the NetFil- framework’s security hooks in that they facilitate mod- ter inet_local_out and inet_local_in hooks. ularity, and default to taking no action unless a module In inet_local_out, LPM signs over the immutable is enabled. Each provenance hook is placed directly be- fields of the IP header, as well as the IP payload. In neath a corresponding security hook. The return value of inet_local_in, LPM checks for the presence of a the security hook is checked prior to calling the prove- signature, then verifies the signature against a config- nance hook, thus assuring that the requested activity has urable list of public keys. If the signature fails, the packet been authorized prior to provenance capture; we consider is dropped before it reaches the recipient application, the implications of this design in Section 4. A workflow thus ensuring that there are no breaks in the continuity of for the hook architecture is depicted in Figure 3. The the provenance log. The key store for provenance-aware LPM patch places over 170 provenance hooks, one for hosts is obtained by a PKI and transmitted to the ker- each of the LSM authorization hooks. In addition to the nel during the boot process by writing to securityfs. 10See https://lwn.net/Articles/518345/ LPM registers the Netfilter hooks with the highest prior-

5 ity levels, such that signing occurs just before transmis- provenance in a centralized data store. It then recov- sion (i.e., after all other IPTables operations), and sig- ers the implicit information flow policy through min- nature verification occurs just after the packet enters the ing the provenance store to generate a MAC policy for interface (i.e., before all other IPTables operations). the distributed system, decreasing both administrator effort and the potential for misconfiguration. 3.4.3 Provenance Modules 3.4.4 Provenance Recorders Here, we introduce two of our own provenance modules (Provmon, SPADE), as well as briefly mention the work LPM provides modular support for different storage of our peers (UPTEMPO): through provenance recorders. To prevent an infinite provenance loop, recorders are flagged as provenance- • Provmon. Provmon is an extended port of the Hi-Fi opaque [48] using the security.provenance ex- security module [48]. The original Hi-Fi code base tended attribute, which is checked by LPM before creat- was 1,566 lines of code, requiring 723 lines to be mod- ing a new event. Each recorder was designed to be as ag- ified in the transition. Our extensions introduced 728 nostic to the active LPM as possible, making them easy additional lines of code. The process of porting did to adapt to new modules. not affect the module’s functionality, although we have We currently provide provenance recorders that of- subsequently extended the Hi-Fi protocol to capture fer backend storage for Gzip, PostGreSQL, Neo4j, and additional lineage information: SNAP. Commentary on our PostGreSQL and Neo4j re- File Versioning. The original Hi-Fi protocol did not porters can be found in our technical report [8]. We make track version information for files, leading to uncer- use of the Gzip and SNAP recorders during our evalua- tainty as to the exact contents of a file at the time it tion in Section 6. was read. Accurately recovering this information in The Gzip recorder incurs low storage overheads and user space was not possible due to race conditions be- fast insertion speeds. On our test bed, we observed tween kernel events. Because versioning is necessary this recorder processing up to 400,000 events per sec- to break cycles in provenance graphs [43], we have ond from the Provmon provenance stream. However, be- added a version field to the provenance context for in- cause the provenance is not stored in an easily queried odes, which is incremented on each write. form, this back-end is best suited for environments where Network Context. Hi-Fi omitted remote host address queries are an offline process. information for network events, reasoning that source To create graph storage that was efficient enough for 11 information could be forged by a dishonest agent in the LPM, we used the SNAP graphing library to design network. These human-interpretable data points were a recorder that maintains an in-memory graph database replaced with an assigned random identifier for each that is fully compliant with the W3C PROV-DM Model packet. We found, however, that these identifiers could [59]. We have observed insertion speeds of over 150,000 not be interpreted without remote address information, events per second using the SNAP recorder, and highly and incorporated the recording of remote IP addresses efficient querying as well. This recorder is further evalu- and ports into Provmon. ated in Section 6. • SPADE. The SPADE system is an increasingly pop- 3.4.5 Workflow Provenance ular option for provenance auditing, but collecting provenance in user space limits SPADE’s expressive- To support layered provenance while preserving our se- ness and creates the potential for incomplete prove- curity goals, we require a means of evaluating the in- nance. To address this limitation, we have cre- tegrity of user space provenance disclosures. To ac- ated a mechanism that reports LPM provenance into complish this, we extend the LPM Provenance Recorder SPADE’s Domain-Specific Language pipe [29]. This to use the Linux Integrity Measurement Architecture permits the collection of whole-system provenance (IMA) [35, 52]. IMA computes a cryptographic hash of while simultaneously leveraging SPADE’s existing each binary before execution, extends the measurement storage, remote query, and visualization utilities. into a TPM Platform Control Register (PCR), and stores the measurement in kernel memory. This set of measure- • Using Provenance to Expedite MAC Policies (UP- ments can be used by the Recorder to make a decision TEMPO). Using LPM as a collection mechanism, about the integrity of the a Provenance-Aware Applica- Moyer et al. investigate provenance analysis as a tion (PAA) prior to accepting the disclosed provenance. means of administrating Mandatory Access Control When a PAA wishes to disclose provenance, it opens a (MAC) policies [54]. UPTEMPO first observes system execution in a sterile environment, aggregating LPM 11See http://snap.stanford.edu

6 b.png a.png 3.5.1 Platform Integrity Used Used We configured LPM to run on a physical machine with WasDerivedFrom mogrify -format jpg *.png WasDerivedFrom a Trusted Platform Module (TPM). The TPM provides a WasGeneratedBy WasGeneratedBy root of trust that allows for a measured boot of the sys- b.jpg a.jpg tem. The TPM also provides the basis for remote attes- tations to prove that LPM was in a known hardware and Figure 4: A provenance graph of image conversion. software configuration. The BIOS’s core root of trust for Here, workflow provenance (WasDerivedFrom) encodes measurement (CRTM) bootstraps a series of code mea- a relationship that more accurately identifies the output surements prior to the execution of each platform com- files’ dependencies compared to only using kernel layer ponent. Once booted, the kernel then measures the code observations (Used, WasGeneratedBy). for user space components (e.g., provenance recorder) before launching them, through the use of the Linux In- tegrity Measurement Architecture (IMA)[52]. The result new UNIX domain socket to send the provenance data is then extended into TPM PCRs, which forms a verifi- to the Provenance Recorder. The Recorder uses its own able chain of trust that shows the integrity of the system UNIX domain socket to recover the process’s pid, then via a digital signature over the measurements. A remote uses the /proc filesystem to find the full path of the bi- verifier can use this chain to determine the current state nary, then uses this information to look up the PAA in of the system using TPM attestation. the IMA measurement list. The disclosed provenance is We configured the system with Intel’s Trusted Boot recorded only if the signature of PAA matches a known- (tboot),13 which provides a secure boot mechanism, pre- good cryptographic hash. venting system from into the environment where As a demonstration of this functionality, we created critical components (e.g., the BIOS, boot loader and a provenance-aware version of the popular ImageMag- the kernel) are modified. Intel tboot relies on the In- 14 ick utility 12. ImageMagick contains a batch conversion tel TXT to provide a secure execution environment. 15 tool for image reformatting, mogrify. Shown in Fig- Additionally, we compiled support for IMA into the ure 4, mogrify reads and writes multiple files during provenance-aware kernel, which is necessary in order for execution, leading to an overtainting problem – at the the LPM Recorder to be able to measure the integrity of kernel layer, LPM is forced to conservatively assume provenance-aware applications. that all outputs were derived from all inputs, creating false dependencies in the provenance record. To address 3.5.2 Runtime Integrity this, we extended the Provmon protocol to support a new message, provmsg_imagemagick_convert, After booting into the provenance-aware kernel, the run- which links an input file directly to its output file. When time integrity of the TCB (defined in §3.2) must also be the recorder receives this message, it first checks the list assured. To protect the runtime integrity of the kernel, of IMA measurements to confirm that ImageMagick is we deploy a Mandatory Access Control (MAC) policy, in a good state. If successful, it then annotates the exist- as implemented by Linux Security Modules. On our pro- ing provenance graph, connecting the appropriate input totype deployments, we enabled SELinux’s MLS policy, and output objects with WasDerivedFrom relationships. the security of which was formally modeled by Hicks et Our instrumentation of ImageMagick demonstrates that al. [33]. Refining the SELinux policy to prevent Ac- LPM supports layered provenance at no additional cost cess Vector Cache (AVC) denials on LPM components over other provenance-aware systems [29, 43], and does required minimal effort; the only denial we encountered so in a manner that provides assurance of the integrity of was when using the PostgreSQL recorder, which was the provenance log. quickly remedied with the audit2allow tool. Pre- serving the integrity of LPM’s user space components, such as the provenance recorder, was as simple as creat- ing a new policy module. We created a policy module to 3.5 Deployment protect the LPM recorder and storage back-end using the sepolicy utility. Uncompiled, the policy module was We now demonstrate how we used LPM in the deploy- only 135 lines. ment of a secure provenance-aware system. Additional background on the security technologies use in our de- 13 See http://sf.net/projects/tboot ployment can be found in our technical report [8]. 14 See https: //www.kernel.org/doc/Documentation/intel_txt.txt 15For virtual environments, similar functionality can be provided on Xen via TPM sealing and the virtual TPM (vTPM), which is bound to 12See http://www.imagemagick.org the physical TPM of the host system.

7 4 Security Authenticated Channel (G4). Through use of Net- filter hooks [57], LPM embeds a DSA signature in ev- In this section, we demonstrate that our system meets ery outbound network packet. Signing occurs immedi- all of the required security goals for trustworthy whole- ately prior to transmission, and verification occurs im- system provenance. In this analysis, we consider an LPM mediately after reception, making it impossible for an deployment on a physical machine that was enabled with adversary-controlled application running in user space the Provmon module and has been configured to the con- to interfere. For both transmission and reception, the ditions described in Section 3.5. signature is invisible to user space. Signatures are Complete (G1). We defined whole-system provenance removed from the packets before delivery, and LPM as a complete description of agents (users, groups) con- feigns ignorance that the options field has been set if trolling activities (processes) interacting with controlled get_options is called. Hence, LPM can enforce that data types during system execution (§ 3.1). LPM at- all applications participate in the commitment protocol. tempts to track these system objects through the place- Prior to implementing our own message commitment ment of provenance hooks (§3.4.1), which directly fol- protocol in the kernel, we investigated a variety of ex- low each LSM authorization hook. The LSM’s complete isting secure protocols. The integrity and authenticity of mediation property has been formally verified [20, 64]; provenance identifiers could also be protected via IPsec in other words, there is an authorization hook prior to [36], SSL tunneling,16 or other forms of encapsulation every security-sensitive operation. Because every inter- [5, 65]. We elected to move forward with our approach action with a controlled data type is considered security- because 1) it ensures the monitoring of all all processes sensitive, we know that a provenance hook resides on and network events, including non-IP packets, 2) it does all control paths to the provenance-sensitive operations. not change the number of packets sent or received, en- LPM is therefore capable of collecting complete prove- suring that our provenance mechanism is minimally in- nance on the host. vasive to the rest of the Linux network stack, and 3) It is important to note that, as a consequence of plac- it preserves compatibility with non-LPM hosts. An al- ing provenance hooks beneath authorization hooks, LPM ternative to DSA signing would be HMAC [9], which is unable to record failed access attempts. However, in- offers better performance but requires pairwise keying serting the provenance layer beneath the security layer and sacrifices the non-repudiation policy; BLS, which ensures accuracy of the provenance record. Moreover, approaches the theoretical maximum security parame- failed authorizations are a different kind of metadata than ter per byte of signature [12]; or online/offline signature provenance because they do not describe processed data; schemes [15, 23, 26, 55]. this information is better handled at the security layer, Authenticated Disclosures (G5). We make use e.g., by the SELinux Access Vector Cache (AVC) Log. of IMA to protect the channel between LPM and Tamperproof (G2). The runtime integrity of the LPM provenance-aware applications wishing to disclose trusted computing base is assured via the SELinux MLS provenance. IMA is able to prove to the provenance policy, and we have written a policy module that protects recorder that the application was unmodified at the time the LPM user space components (§3.5.2). Therefore, the it was loaded into memory, at which point the recorder only way to disable LPM would be to reboot the sys- can accept the provenance disclosure into the official tem into a different kernel; this action can be disallowed record. If the application is known to be correct (e.g., through secure boot techniques,13 and is detectable by through formal verification), this is sufficient to estab- remote hosts via TPM attestation (§3.5.1). lish the runtime integrity of the application. However, if Verifiable (G3). While we have not conducted an in- the application is compromised after execution, this ap- dependent formal verification of LPM, our argument for proach is unable to protect against provenance forgery. its correctness is as follows. A provenance hook follows A separate consideration for all of the above security each LSM authorization hook in the kernel. The correct- properties are Denial of Service (DoS) attacks. DoS at- ness of LSM hook placement has been verified through tacks on LPM do not break its security properties. If an both static and dynamic analysis techniques [20, 25, 34]. attacker launches a resource exhaustion attack in order Because an authorization hook exists on the path of ev- to prevent provenance from being collected, all kernel ery sensitive operation to controlled data types, and LPM operations will be disallowed and the host will cease to introduces a provenance hook behind each authorization function. If a network attacker tampers with a packet’s hook, LPM inherits LSM’s formal assurance of complete provenance identifier, the packet will not be delivered to mediation over controlled data types. This is sufficient the recipient application. In all cases, the provenance to ensure that LPM can collect the provenance of every record remains an accurate reflection of system events. sensitive operation on controlled data types in the kernel 16See http://docs.oracle.com/cd/E23823_01/html/816-5175/kssl- (i.e., whole-system provenance). 5.html

8 Algorithm 1 Summarizes a’s propagation through the system. Algorithm 2 Mediates request to write e to d given Rules. Require: a is an entity Require: e,d are entities 1: procedure REPORT(a) Require: Rules is a PB-DLP policy 2: Locations = [ ] . Assigns an empty list. 1: procedure PROVWRITE(e,d,Rules) 3: for each s in a,FindSuccessors(a) do 2: for each rule in Rules do 4: if s.type is File then 3: if d = rule.dst then 5: Locations.Add(< s.disk,s.directory >) 4: A = FindAncestors(e) 6: else if s.type is Network Packet then 5: NumSrcs = length(rule.Srcs) 7: Locations.Add(< s.remote_ip,s.port >) 6: for each src in rule.Srcs do 8: end if 7: if src in A then 9: end for 8: NumSrcs − − 10: return Locations 9: end if 11: end procedure 10: end for 11: if NumSrcs = 0 then . A ⊇ Srcs, deny. 12: return PB-DLP_DENY 13: end if 14: end if 5 LPM Application: Provenance-Based 15: end for 16: return PB-DLP_PERMIT . A 6⊇ Srcs, permit. Data Loss Prevention 17: end procedure

To further demonstrate the power of LPM, we now in- troduce a set of mechanisms for Provenance-Based Data 5.1 Monitoring Phase Loss Prevention (PB-DLP) that offer dramatically sim- The goal of monitoring is to allow administrators to rea- plified administration and improved enforcement over son about how sensitive data is stored and put to use on existing DLP systems. A provenance-based approach is their systems. The end product of the monitor phase is a a novel and effective means of handling data loss preven- set of rules (a policy) that restrict the permissible flows tion; to our knowledge, we are the first in the literature for sensitive data sources. Monitoring is an ongoing pro- to do so. The advantage of our approach when compared cess in DLP, where administrators attempt to iteratively to existing systems is that LPM-based provenance-aware improve protection against data leakage. The first step is systems already perform system-wide capture of infor- to identify the data that needs protection. Identifying the mation flows between kernel objects. Data loss preven- source of such information is often quite simple; for ex- tion in such a system therefore becomes a matter of pre- ample, a database of PCI or PII data. However, reliably venting all derivations of a sensitive source entity, e.g., a finding data objects that were derived from this source is Payment Card Industry (PCI) database, from being writ- extraordinarily complicated using existing solutions, but ten to a monitored destination entity (e.g., a network in- is simple now with LPM. To begin, we define a helper terface). function for system monitoring: We begin by defining a policy format for PB-DLP. In- dividual rules take the form 1. FindSuccessors(Entity): This function performs a provenance graph traversal to obtain the list of data < Srcs = [src1,src2,...,srcn],dst > objects derived from Entity.

where Srcs is a list of entities representing persistent FindSuccessors can then be used as the basis for a data objects, and dst is a single entity representing either function that summarizes the spread of sensitive data: a persistent data object such as a file or interface or an ab- stract entity such as a remote host. The goal for PB-DLP 2. Report(Entity): List the locations that a target object is as follows – an entity e1 with ancestors A is written and its successors have propagated. This function is to entity e2 if and only if A 6⊇ Srcs for all rules in the defined in Algorithm 1. rule set where e2 = dst. The reason that sources are ex- pressed as sets is that, at times, the union of information The information provided by Report is similar to the is more sensitive than its individual components. For ex- data found in the Symantec DLP Dashboard [1], and ample, sharing a person’s last name or birthdate may be could be used as the backbone of a PB-DLP user inter- permissible, while sharing the last name and birthdate is face. Administrators can use this information to write a restricted as PII.2 PB-DLP policy or revise an existing one. Below, we define the functions that realize this goal. First, we define two provenance-based functions as the 5.2 Enforcement Phase basis for a DLP monitoring phase, which allows admin- istrators to learn more about the propagation of sensitive Possessing a PB-DLP policy, the goal of the enforcement data on their systems. Then, we define mechanisms for a phase is to prevent entities that were derived from sensi- DLP enforcement phase. tive sources from being written to restricted locations. To

9 do so, we need to inspect the object’s provenance to dis- commercial products. Proprietary label-based DLP sys- cover the entities from which it was derived. We define tems rely on manual annotations provided by users, re- the following helper function: quiring them to provide correct labeling based on their knowledge of data content. Using SELinux as an exem- 3. FindAncestors(Entity): This function performs a plar labeling system is therefore an extremely conserva- provenance graph traversal to obtain the list of data tive approach to analysis. objects used in the creation of Entity. Within an MLS system, each subject, and object, is assigned a classification level, and categories, or com- FindAncestors can be then used as the basis for a func- partments. Consider an example system, with classi- tion that prevents the spread of sensitive data: fication levels, {A,B} with A dominating B, and com- partments {α,β}. We can model our policy as a lat- 4. ProvWrite(Entity, Destination, Rules): Write the tar- tice, where each node in the lattice is a tuple of the get entity to the destination if and only if it is valid to form {< level >,{compartments}}. Once the policy the provided rule set, as defined in Algorithm 2. is defined, it is possible to enforce the simple and *- properties. If a user has access to data with classification 5.3 File Transfer Application level A, and compartment α, he cannot read anything in compartment {β} (no read-up). Furthermore, when data In many enterprise networks that are isolated from the is accessed in A,{α}, the user cannot write anything to Internet via firewalls and proxies, it is desirable to share B,{α} (no write-down). files with external users. File transfer services are one In order to use SELinux’s MLS enforcement as a DLP way to achieve this, and provide a single entry/exit point solution, the administrator configures the policy to en- to the enterprise network where files being transferred force the constraint that no data of specified types can can be examined before being released.17 In the case be sent over the network. However, this is difficult in of incoming files, scans can check for known malware, practice. Consider an example system that processes PII. and in some cases, check for other types of malicious The users of the system may need to access information, behavior from unknown malware. such as last names, and send these to the payroll depart- We implemented PB-DLP as a file transfer applica- ment to ensure that each employee receives a paycheck. tion for provenance-aware systems using LPM’s Prov- Separately, the user may need to send a list of birthdays mon module. The application interfaced with LPM’s to another user in the department to coordinate birthday SNAP recorder using a custom API. Before permitting celebrations for each month. Either of these activities are a file to be transmitted to a remote host, the application acceptable (Figure 5, Decision Condition 2). However, WasDerivedFrom ran a query that traversed edges to re- it is common practice for organizations to have stricter turn a list of the file’s ancestors, permitting the transfer sharing policies for data that contains multiple forms of only if the file was not derived from a restricted source. PII, so while either of these identifiers could be transmit- PB-DLP allows internal users to share data, while ensur- ted in isolation, the two pieces of information combined ing that sensitive data is not exfiltrated in the process. could not be shared (Figure 5, Decision Condition 3). Because provenance graphs continue to grow indefi- The MLS policy cannot easily handle this type of data nitely over time, in practice the bottleneck of this appli- fusion. In order to provide support for correctly label- cation is the speed of provenance querying. We evaluate ing fused data, an administrator would need to define the the performance of PB-DLP queries in Section 6.3. power set of all compartments within the MLS policy. In the example above, the administrator would define the 5.4 PB-DLP Analysis following compartments: {}, {α}, {β}, {α,β}. In the default configuration SELinux supports 256 unique cate- Below, we select two open source systems that approx- gories, meaning an SELinux DLP policy could only sup- imate label based and regular expression (regex) based port eight types of data. Furthermore, the MLS policy DLP solutions, and compare their benefits to PB-DLP. does not support defining multiple categories within a single sensitivity level18. This implies that the MLS pol- 5.4.1 Label-Based DLP icy cannot support having a security level for A,{α} and for A,{α,β}. Instead, the most restrictive labeling must The SELinux MLS policy [31] provides information flow be defined to protect the data on the system. In contrast, security through a label-based approach, and could be PB-DLP can support an arbitrary number of data fusions. used to approximate a DLP solution without relying on

17 Two examples of vendors that provide this capability are FireEye 18See the definition of level statements at http:// (http://www.fireeye.com) and Accellion (http://www.accellion.com/) selinuxproject.org/page/MLSStatements

10 1 Training_Data:0

Birth_Dates:0 Used 3 4 WasGeneratedBy Used WasGeneratedBy 2 Used join Birth_Dates SSNs > PII_Data PII_Data:0 gzip PII_Data PII_Data.gz:0 SSNs:0

Figure 5: A provenance graph of PII data objects that are first fused and then transformed. The numbers mark DLP decision conditions. Objects marked by green circles should not be restricted, while red octagons should be restricted. Label-Based DLP correctly handles data resembling PII (1,2) and data transformations (4), but struggles with data fusions (3). Regex-Based DLP correctly identifies data fusions (3), but is prone to incorrect handling of data resembling PII (1) and fails to identify data transformations (4). PB-DLP correctly handles all conditions.

5.4.2 Regex-Based DLP Test Type Vanilla LPM Provmon Process tests, times in µseconds (smaller is better) null call 0.14 0.14 (0%) 0.14 (0%) The majority of DLP software relies on pattern matching null I/O 0.21 0.21 (0%) 0.32 (52%) techniques to identify sensitive data. While enterprise so- stat 1.57 1.6 (2%) 2.8 (78%) open/close file 2.75 2.42 (-12%) 3.91 (42%) lutions offer greater sophistication and customizability, signal install 0.25 0.25 (0%) 0.25 (0%) their fundamental approach resembles that of Cornell’s signal handle 1.37 1.29 (-6%) 1.39 (1%) 7 fork process 380 396 (4%) 401 (6%) Spider , a forensics tools for identifying sensitive per- exec process 873 879 (1%) 911 (4%) sonal data (e.g., credit card or social security numbers). process 2990 3000 (0%) 3113 (4%) File and memory latencies in µseconds (smaller is better) Because it is open source, we make use of Spider as an file create (0k) 11.5 11.2 (-3%) 15.8 (37%) exemplar application for regex-based DLP. file delete (0k) 8.51 8.12 (-5%) 11.8 (39%) file create (10k) 23.4 21.6 (-8%) 28.8 (23%) Regex approaches are prone to false positives. file delete (10k) 12.5 12 (-4%) 14.7 (18%) Spider is pre-configured with a set of regular mmap latency 1062 1053 (-1%) 1120 (5%) protect fault 0.32 0.3 (-6%) 0.346 (8%) expressions for identifying potential PII, e.g., page fault 0.016 0.016 (0%) 0.016 (0%) (\d{3}-\d{2}-\d{4}) identifies a social se- 100 fd select 1.53 1.53 (0%) 1.53 (0%) curity number. However, it is common practice for Table 1: LMBench measurements for LPM kernels. All developers to generate and distribute training datasets times are in microseconds. Percent overhead for modi- to aid in software testing (Figure 5, Decision Condition fied configurations are shown in parenthesis. 1). Spider is oblivious to information flows, instead searching for content that bears structural similarity to PII, and therefore would be unable to distinguish LPM scaffolding installed but without an enabled mod- between true PII and training data. PB-DLP tracks the ule (LPM), and LPM installed with the Provmon module propagation of data from its source onwards, and could enabled (Provmon). trivially differentiate between true PII and training sets. Regex approaches are also prone to false negatives. Even after the most trivial data transformations, PII and 6.1 Collection Performance PCI data is no longer identifiable to the Spider system (Figure 5, Decision Condition 4), permitting its exfiltra- We used LMBench to microbenchmark LPM’s impact tion. To demonstrate, we generated a file full of ran- on system calls as well as file and memory latencies. dom valid social security numbers that Spider was able to Table 1 shows the averaged results over 10 trials for identify. We then ran gzip on the file and stored it in a each kernel, with a percent overhead calculation against second file. Spider was unable to identify the second file, Vanilla. For most measures, the performance differ- but PB-DLP correctly identified both files as PII since the ences between LPM and Vanilla are negligible. Com- gzip output was derived from a sensitive input. paring Vanilla to Provmon, there are several measures in which overhead is noteworthy: stat, open/close, file creation and deletion. Each of these benchmarks in- 6 Evaluation volve LMBench manipulating a temporary file that re- sides in /usr/tmp/lat_fs/. Because an absolute We now evaluate the performance of LPM. Our bench- path is provided, before each system call occurs LM- marks were run on a bare metal server machine with 12 Bench first traverses the path to the file, resulting in GB memory and 2 Intel Xeon quad core CPUs. The Red the creation of 3 different provenance events in Prov- Hat 2.6.32 kernel was compiled and installed under 3 dif- mon’s inode_permission hook, each of which is ferent configurations: all provenance disabled (Vanilla), transmitted to user space via the kernel relay. While

11 5 1 5000 Raw Prov. Stream Vanilla 4 GZip Recorder 0.99 4000 LPM SNAP Recorder Provmon 3 0.98 Batch Sig 3000 2 0.97 2000 1 0.96 Cumulative Density

Storage Cost (GBytes) 1000 0 0.95 Throughput (Mbps) 0 2 4 6 8 10 0 5 10 15 20 25 0 Time (Minutes) Response Time (Milliseconds) Iperf Performance

Figure 6: Growth of provenance Figure 7: Performance of ancestry Figure 8: LPM network overhead storage overheads during kernel queries for objects created during can be reduced with batch signature compilation. kernel compilation. schemes. the overheads seem large for these operations, the log- For kernel compile and postmark, Provmon outper- ging of these three events only imposes approximately forms the PASS system, which exacted 15.6% and 11.5% 1.5 microseconds per traversal. Moreover, the over- overheads on kernel compilation and postmark, respec- head for opening and closing is significantly higher than tively [43]. Provmon introduces comparable kernel com- the overhead than reads and writes (Null I/O); thus, the pilation overhead to Hi-Fi (2.8%) [48]. It is difficult to higher open/close costs are likely to be amortized over compare our Blast results to SPADE and PASS, as both the course of regular system use. A provenance module used a custom workload instead of a publicly available could further reduce this overhead by maintaining state benchmark. SPADE reports an 11.5% overhead on a about past events within the kernel, then blocking the large workload [29], while PASS reports just an 0.7% creation of redundant provenance records. overhead. Taken as a whole, though, LPM collection ei- ther meets or exceeds the performance of past systems, Test Vanilla Provmon Overhead while providing additional security assurances. Kernel Compile 598 sec 614 sec 2.7% Postmark 25 sec 27 sec 7.5% Blast 376 sec 390 sec 4.8% 6.2 Storage Overhead Table 2: Benchmarking Results. Our provenance module A major challenge to automated provenance collection is imposed just 2.7% overhead on kernel compilation. the storage overhead incurred. We plotted the growth of provenance storage using different recorders during the To gain a more practical sense of the costs of LPM, we kernel compilation benchmark, shown in Figure 6. LPM also performed multiple benchmark tests that represented generated 3.7 GB of raw provenance. This required only realistic system workloads. Each trial was repeated 5 450 MB of storage with the Gzip recorder, but prove- times to ensure consistency. The results are summarized nance cannot be efficiently queried in this format. The in Table 2. For the kernel compile test, we recompiled SNAP recorder builds an in-memory provenance graph. the kernel source (in a fixed configuration) while booted We approximated the storage overhead through polling into each of the kernels. Each compilation occurred on the consumed by the recorder process in 16 threads. The LPM scaffolding (without an enabled the /proc filesystem. The SNAP graph required 1.6 GB module) is not included, because in both tests it imposed storage; the reduction from the raw provenance stream less than 1% overhead. In spite of seemingly high over- is due to the fact that redundant events did not lead to heads for file I/O, Provmon imposes just 2.7% overhead the creation of new graph components. In contrast, the on kernel compilation, or 16 seconds. The Postmark test PASS system generates 1.3 GB of storage overhead dur- simulates the operation of an email server. It was con- ing kernel compilation while collecting less information figured to run 15,000 transactions with file sizes rang- (e.g., shared memory). LPM’s storage overheads are thus ing from 4 KB to 1 MB in 10 subdirectories, with up to comparable to other provenance-aware systems. 1,500 simultaneous transactions. The Provmon module imposed just 7.5% overhead on this task. To estimate 6.3 Query Performance (PB-DLP) LPM’s overhead for scientific applications, we ran the BLAST benchmarks 19, which simulates biological se- We evaluated query performance using our exemplar PB- quence workloads obtained from analysis of hundreds of DLP application and LPM’s SNAP recorder. The prove- thousands of jobs from the National Institutes of Health. nance graph that was populated using the routine from the kernel compile benchmark. This yielded a raw prove- 19See http://fiehnlab.ucdavis.edu/staff/kind/Collector/Benchmark/ nance stream of 3.7 GB, which was translated by the Blast_Benchmark recorder into a graph of 6,513,398 nodes and 6,754,059

12 edges. We were then able to use the graph to issue an- DSA. Yet another approach to reducing our impact on cestry queries, in which the subgraphs were traversed to network performance would be to employ a batch signa- find the data object ancestors of a given file. Because ture scheme [11]. We tested this by transmitting a sig- we did not want ephemeral objects with limited ances- nature over every 10 packets during TCP sessions, and tries to skew our results, we only considered the results found that throughput increased by 3.3 times to approx- of objects with more than 50 ancestors. imately 1600 Mbps. Due to the fact that this overhead In the worst case, which was a node that had 17,696 may not be suitable for some environments, Provmon ancestors, the query returned in just 21 milliseconds. can be configured to use Hi-Fi identifiers [48], which are Effectively, we were able to query object ancestries at vulnerable to network attack but impose negligible over- line speed for network activity. We are confident that head. LPM’s impact on network performance is specific this approach can scale to large databases through pre- to the particular module, and can be tailored to meet the computation of expensive operations at data ingest, mak- needs of the system. ing it a promising strategy for provenance-aware dis- tributed systems; however, we note that these results are 7 Discussion highly dependent on the size of the graph. Our test graph, while large, would inevitably be dwarfed by the size of Without the aid of provenance-aware applications, LPM the provenance on long-lived systems. Fortunately, there will struggle to accurately track dependencies through are also a variety of techniques for reducing these costs. workflow layer abstractions. The most obvious example Bates et al. show that the results from provenance graph of such an abstraction is the copy/paste buffer in window- traversals can be extensively cached when using a fixed ing applications like Xorg. This is a known side channel security policy, which would allow querying to amortize for kernel layer security mechanisms, one that has been to a small constant cost [7]. LPM could also be extended addressed by the Trusted Solaris project [10], Trusted X to support deduplication [63, 62] and policy-based prun- [21, 22], the SELinux-aware X window system [37], Se- ing [6, 13], both of which could further improve perfor- cureView 20, and General Dynamics’ TVE 21. Without mance by reducing the size of provenance graphs. provenance-aware windowing, LPM will conservatively assume that all files opened for reading are dependencies 6.4 Message Commitment Protocol of the paste buffer, leading to false dependencies. LPM is also unable to observe system side channels, such as Under each kernel configuration, we performed iperf timing channels or L2 cache measurements [51], a limi- benchmarking to discover LPM’s impact on TCP tation shared by many other security solutions [18]. throughput. iperf was launched in both client and server Although we have not presented a secure distributed mode over localhost. The client was launched provenance-aware system in this work, LPM provides with 16 threads, two per each CPU. Our results can be the foundation for the creation of such a system. In the found in Figure 8. The Vanilla kernel reached 4490 presented modules, provenance is stored locally by the Mbps. While the LPM framework imposed negligible host and retrieved on an as-needed basis from other hosts. cost compared to the vanilla kernel (4480 Mbps), Prov- This raises availability concerns as hosts inevitably begin mon’s DSA-based message commitment protocol re- to fail. Availability could be improved with minimal per- duced throughput by an order of magnitude (482 Mbps). formance and storage overheads through Gehani et al.’s Through use of printk instrumentation, we found that approach of duplicating provenance at k neighbors with the average overhead per packet signature was 1.2 ms. a limited graph depth d [27, 28]. This result is not surprising when compared to IPsec Finally, LPM does not address the matter of prove- performance. IPsec’s Authentication Header (AH) mode nance confidentiality; this is an important challenge that uses an HMAC-based approach to provide similar guar- is explored elsewhere in the literature [14, 46]. LPM’s antees as our protocol. AH has been shown to reduce Recorders provide interfaces that can be used to intro- throughput by as much as half [16]. An HMAC approach duce an access control layer onto the provenance store. is a viable alternative to establish integrity and data ori- gin authenticity and would also fit into the options field, but would require the negotiation of IPsec security as- 8 Related Work sociations. Our message commitment protocol has the benefit of being fully interoperable with other hosts, and While myriad provenance-aware systems have been pro- disclose does not require a negotiation phase before communi- posed in the literature, the majority provenance cation occurs. Another option for increasing through- within an application [32, 41, 65] or workflow [24, 58]. It put would be to employ CPU instruction extensions [30] 20See http://www.ainfosec.com/secureview and security co-processor [19] to accelerate the speed of 21See http://gdc4s.com/tve.html

13 is difficult or impossible to obtain complete provenance mation that is too coarse-grained to meet the needs of in this manner. This is because systems events that occur some applications. Moreover, to the best of our knowl- outside of the application, but still effect its execution, edge their system is unimplemented. will not appear in the provenance record. The most promising model to date for secure prove- The alternative to disclosed systems are automatic nance collection is Pohly et al.’s Hi-Fi system [48]. Hi-Fi provenance-aware systems, which collect provenance is a Linux Security Module (LSM) that collects whole- transparently within the operating system. Gehani et system provenance that details the actions of processes, al.’s SPADE is a multi-platform system for eScience and IPC mechanisms, and even the kernel itself (which does grid computing audiences, with an emphasis on low la- not exclusively use system calls). Hi-Fi attempts to pro- tency and availability in distributed environments [29]. vide a provenance reference monitor [42], but remains SPADE’s provenance reporters make use of familiar ap- vulnerable to the provenance-aware adversary that we plication layer utilities to generate provenance, such as describe in Section 3.2. Enabling Hi-Fi blocks the in- polling ps for process information and lsof for net- stallation of other LSM’s, such as SELinux or Tomoyo, work information. This gives rise to the possibility of in- or requires a third party patch to permit module stack- complete provenance due to race conditions. The PASS ing. This blocks the installation of MAC policy on the project collects the provenance of system calls at the vir- host, preventing runtime integrity assurances. Hi-Fi is tual filesystem (VFS) layer. PASSv1 provides base func- also vulnerable to adversaries in the network, who can tions for provenance collection that observe processes’ strip the provenance identifiers from packets in transit, file I/O activity [43]. Because these basic functions are resulting in irrecoverable provenance. Unlike LPM, Hi- manually placed around the kernel, there is no clear Fi does not attempt to provide layered provenance ser- way to extend PASSv1 to support additional collection vices, and therefore does not consider the integrity and hooks; we address this limitation in the modular design authenticity of provenance-aware applications. of LPM. PASSv2 introduces a Disclosed Provenance API Provenance collection is a form of information flow for tighter integration between provenance collected at monitoring that is related, but fundamentally distinct, different layers of abstraction, e.g., at the application from past areas of study. Due to space constraints, our layer [44]. PASSv2 assumes that disclosing processes discussion of Information Flow Control (IFC) systems are benign, while LPM provides a secure disclosure has been relegated to our technical report [8]. mechanism for attesting the correctness of provenance- aware applications. Both SPADE and PASS are designed for benign environments, making no attempt to protect 9 Conclusion their collection mechanisms from an adversary. In this work, we have presented LPM, a platform for Previous work has considered the security of prove- the creation of trusted provenance-aware execution en- nance under relaxed threat models relative to LPM’s. In vironments. Our system imposes as little as 2.7% per- SProv, Hasan et al. introduce provenance chains, cryp- formance overhead on normal system operation, and can tographic constructs that prevent the insertion or dele- respond to queries about data object ancestry in tens of tion of provenance inside of a series of events [32]. milliseconds. We have used LPM as the foundation of SProv effectively demonstrates the authentication prop- a provenance-based data loss prevention system that can erties of this primitive, but is not intended to serve as a scan file transmissions to detect the presence of sensitive secure provenance-aware system; attackers can still ap- ancestors in just tenths of a second. The Linux Prove- pend false records to the end of the chain, delete the nance Module Framework is an exciting step forward for whole chain, or disable the library altogether. Zhou et both provenance- and security-conscious communities. al. consider provenance corruption an inevitability, and show that provenance can detect some malicious hosts in distributed environments provided that a critical mass of Acknowledgements correct hosts still exist [65]. They later strengthen these assurances through use of provenance-aware software- We would like to thank Rob Cunningham, Alin Do- defined networking [5]. These systems consider only bra, Will Enck, Jun Li, Al Malony, Patrick McDaniel, network events, and are unable to speak to the internal Daniela Oliveira, Nabil Schear, Micah Sherr, and Patrick state of hosts. Lyle and Martin sketch the design for Traynor for their valuable comments and insight, as well a secure provenance monitor based on trusted comput- as Devin Pohly for his sustained assistance in working ing [40]. However, they conceptualize provenance as with Hi-Fi, and Mugdha Kumar for her help developing a TPM-aided proof of code execution, overlooking in- LPM SPADE support. This work was supported in part terprocess communication and other system activity that by the US National Science Foundation under grant num- could inform execution results, and therefore offer infor- bers CNS-1118046, CNS-1254198, and CNS-1445983.

14 Availability [15] D. Catalano, M. Di Raimondo, D. Fiore, and R. Gennaro. Off- line/On-line Signatures: Theoretical Aspects and Experimental The LPM code base, including all user space utilities and Results. In PKC’08: Proceedings of the Practice and theory in public key cryptography, 11th international conference on Pub- patches for both Red Hat and the mainline Linux kernels, lic key cryptography, pages 101–120, Berlin, Heidelberg, 2008. is available at http://linuxprovenance.org. Springer-Verlag. [16] S. Chaitanya, K. Butler, A. Sivasubramaniam, P. McDaniel, and M. Vilayannur. Design, Implementation and Evaluation of Secu- References rity in iSCSI-based Network Storage Systems. In Proceedings of the Second ACM Workshop on Storage Security and Survivability, http:// [1] Symantec Data Loss Prevention Customer Brochure. StorageSS ’06, pages 17–28, New York, NY, USA, 2006. ACM. www.symantec.com/data-loss-prevention. [17] D. D. Clark and D. R. Wilson. A Comparison of Commercial and [2] What’s Yours is Mine: How Employees are Putting Military Computer Security Policies. In IEEE S&P, Oakland, Your Intellectual Property at Risk. https://www4. CA, USA, Apr. 1987. symantec.com/mktginfo/whitepaper/WP_ WhatsYoursIsMine-HowEmployeesarePutting [18] D. Cock, Q. Ge, T. Murray, and G. Heiser. The Last Mile: An YourIntellectualPropertyatRisk_dai211501_ Empirical Study of Some Timing Channels on seL4. In ACM cta69167.pdf. Conference on Computer and Communications Security, pages 570–581, Scottsdale, AZ, USA, nov 2014. [3] R. Aldeco-Pérez and L. Moreau. Provenance-based Auditing of Private Data Use. In Proceedings of the 2008 International Con- [19] J. Dyer, M. Lindemann, R. Perez, R. Sailer, L. van Doorn, and ference on Visions of Computer Science, VoCS’08, Sept. 2008. S. Smith. Building the IBM 4758 Secure Coprocessor. Computer, 34(10):57–66, Oct 2001. [4] J. P. Anderson. Computer Security Technology Planning Study. Technical Report ESD-TR-73-51, Air Force Electronic Systems [20] A. Edwards, T. Jaeger, and X. Zhang. Runtime Verification of Division, 1972. Authorization Hook Placement for the Linux Security Modules Framework. In Proceedings of the 9th ACM Conference on Com- [5] A. Bates, K. Butler, A. Haeberlen, M. Sherr, and W. Zhou. Let puter and Communications Security, CCS’02, 2002. SDN Be Your Eyes: Secure Forensics in Data Center Networks. In NDSS Workshop on Security of Emerging Network Technolo- [21] J. Epstein and J. Picciotto. Trusting X: Issues in Building Trusted ˘ ´ Pro- gies, SENT, Feb. 2014. X Window Systems -or- WhatâAZs Not Trusted About X. In ceedings of the 14th Annual National Computer Security Confer- [6] A. Bates, K. R. B. Butler, and T. Moyer. Take Only What You ence, 1991. Need: Leveraging Mandatory Access Control Policy to Reduce [22] J. Epstein and M. Shugerman. A Trusted X Window System Provenance Storage Costs. In 7th Workshop on the Theory and Server for Trusted Mach. In USENIX MACH Symposium, pages Practice of Provenance, TaPP’15, July 2015. 141–156, 1990. [7] A. Bates, B. Mood, M. Valafar, and K. Butler. Towards Secure [23] S. Even, O. Goldreich, and S. Micali. On-line/off-line Digital Provenance-based Access Control in Cloud Environments. In Signatures. In Proceedings on Advances in cryptology, CRYPTO Proceedings of the 3rd ACM Conference on Data and Applica- ’89, pages 263–275, New York, NY, USA, 1989. Springer-Verlag tion Security and Privacy, CODASPY ’13, pages 277–284, New New York, Inc. York, NY, USA, 2013. ACM. [24] I. T. Foster, J.-S. Vöckler, M. Wilde, and Y. Zhao. Chimera: AVir- [8] A. Bates, D. Tian, K. R. B. Butler, and T. Moyer. Linux Prove- tual Data System for Representing, Querying, and Automating nance Modules: Trustworthy Whole-System Provenance for the Data Derivation. In Proceedings of the 14th Conference on Sci- Linux Kernel. Technical Report REP-2015-578, University of entific and Statistical Database Management, SSDBM’02, July Florida CISE Dept, 2015. 2002. [9] M. Bellare, R. Canetti, and H. Krawczyk. Keyed Hash Functions [25] V. Ganapathy, T. Jaeger, and S. Jha. Automatic placement of and Message Authentication. In Proceedings of Crypto’96, vol- authorization hooks in the linux security modules framework. In ume 1109 of LNCS, pages 1–15, 1996. Proceedings of the 12th ACM Conference on Computer and Com- [10] M. Bellis, S. Lofthouse, H. Griffin, and D. Kucukreisoglu. munications Security, CCS ’05, pages 330–339, New York, NY, Trusted Solaris 8 4/01 Security Target. 2003. USA, 2005. ACM. [11] A. Bittau, D. Boneh, M. Hamburg, M. Handley, D. Mazieres, [26] C.-z. Gao and Z.-a. Yao. A Further Improved Online/Offline Sig- and Q. Slack. Cryptographic protection of TCP Streams nature Scheme. Fundam. Inf., 91:523–532, August 2009. (tcpcrypt). https://tools.ietf.org/html/ [27] A. Gehani, B. Baig, S. Mahmood, D. Tariq, and F. Zaffar. Fine- draft-bittau-tcp-crypt-01. grained Tracking of Grid Infections. In Proceedings of the [12] D. Boneh, B. Lynn, and H. Shacham. Short Signatures from the 11th IEEE/ACM International Conference on Grid Computing, Weil Pairing. In C. Boyd, editor, Advances in Cryptology – ASI- GRID’10, Oct 2010. ACRYPT 2001, volume 2248 of Lecture Notes in Computer Sci- [28] A. Gehani and U. Lindqvist. Bonsai: Balanced Lineage Authen- ence, pages 514–532. Springer Berlin Heidelberg, 2001. tication. In Proceedings of the 23rd Annual Computer Security Applications Conference, ACSAC’07, Dec 2007. [13] U. Braun, S. L. Garfinkel, D. A. Holland, K.-K. Muniswamy- Reddy, and M. I. Seltzer. Issues in Automatic Provenance Col- [29] A. Gehani and D. Tariq. SPADE: Support for Provenance Audit- lection. In International Provenance and Annotation Workshop, ing in Distributed Environments. In Proceedings of the 13th In- pages 171–183, 2006. ternational Middleware Conference, Middleware ’12, Dec 2012. [14] U. Braun and A. Shinnar. A Security Model for Provenance. [30] S. Gueron and V. Krasnov. Speed Up Big-Number Multiplication Technical Report TR-04-06, Harvard University Computer Sci- Using Single Instruction Multiple Data (SIMD) Architectures, ence Group, 2006. June 7 2012. US Patent App. 13/491,141.

15 [31] C. Hanson. SELinux and MLS: Putting The Pieces Together. In [50] A. C. Revkin. Hacked E-mail is New Fodder for Climate Dispute. In Proceedings of the 2nd Annual SELinux Symposium, 2006. New York Times, 20, 2009. [32] R. Hasan, R. Sion, and M. Winslett. The Case of the Fake Pi- [51] T. Ristenpart, E. Tromer, H. Shacham, and S. Savage. Hey, You, casso: Preventing History Forgery with Secure Provenance. In Get Off of My Cloud: Exploring Information Leakage in Third- Proceedings of the 7th USENIX Conference on File and Storage Party Compute Clouds. In Proceedings of the 16th ACM Con- Technologies, FAST’09, San Francisco, CA, USA, Feb. 2009. ference on Computer and Communications Security (CCS’09), pages 199–212, Chicago, IL, USA, Oct. 2009. ACM. [33] B. Hicks, S. Rueda, L. St.Clair, T. Jaeger, and P. McDaniel. A Logical Specification and Analysis for SELinux MLS Policy. [52] R. Sailer, X. Zhang, T. Jaeger, and L. van Doorn. Design and ACM Trans. Inf. Syst. Secur., 13(3):26:1–26:31, July 2010. Implementation of a TCG-based Integrity Measurement Archi- tecture. In SSYM’04: Proceedings of the 13th conference on [34] T. Jaeger, A. Edwards, and X. Zhang. Consistency Analysis of USENIX Security Symposium, pages 16–16, Berkeley, CA, USA, Authorization Hook Placement in the Linux Security Modules 2004. USENIX Association. Framework. ACM Trans. Inf. Syst. Secur., 7(2):175–205, May 2004. [53] C. Sar and P. Cao. Lineage . http://crypto.stanford.edu/~cao/lineage.html. [35] T. Jaeger, R. Sailer, and U. Shankar. PRIMA: Policy-reduced Integrity Measurement Architecture. In Proceedings of the 11th [54] J. Seibert, G. Baah, J. Diewald, and R. Cunningham. Using ACM Symposium on Access Control Models and Technologies, Provenance To Expedite MAC Policies (UPTEMPO) (Previously SACMAT ’06, pages 19–28, New York, NY, USA, 2006. ACM. Known as IPDAM). Technical Report USTC-PM-015, MIT Lin- coln Laboratory, October 2014. [36] S. Kent and R. Atkinson. RFC 2406: IP Encapsulating Security Payload (ESP). 1998. [55] A. Shamir and Y. Tauman. Improved Online/Offline Signa- ture Schemes. In J. Kilian, editor, Advances in Cryptology — [37] D. Kilpatrick, W. Salamon, and C. Vance. Securing the X Win- CRYPTO 2001, volume 2139 of Lecture Notes in Computer Sci- dow System with SELinux. Technical report, Jan. 2003. ence, pages 355–367. Springer Berlin / Heidelberg, 2001. [38] L. Lamport. Time, Clocks, and the Ordering of Events in a Dis- [56] D. Tariq, B. Baig, A. Gehani, S. Mahmood, R. Tahir, A. Aqil, and tributed System. Commun. ACM, 21(7):558–565, July 1978. F. Zaffar. Identifying the Provenance of Correlated Anomalies. In [39] H. Luhn. Computer for Verifying Numbers, Aug. 23 1960. US Proceedings of the 2011 ACM Symposium on Applied Computing, Patent 2,950,048. SAC ’11, Mar. 2011. [40] J. Lyle and A. Martin. Trusted Computing and Provenance: Bet- [57] The Netfilter Core Team. The Netfilter Project: Packet Mangling ter Together. In 2nd Workshop on the Theory and Practice of for Linux 2.4. http://www.netfilter.org/, 1999. Provenance, TaPP’10, Feb. 2010. [58] J. Widom. Trio: A System for Integrated Management of Data, [41] P. Macko and M. Seltzer. A General-purpose Provenance Li- Accuracy, and Lineage. Technical Report 2004-40, Stanford In- brary. In 4th Workshop on the Theory and Practice of Prove- foLab, Aug. 2004. nance, TaPP’12, June 2012. [59] World Wide Web Consortium. PROV-Overview: An Overview [42] P. McDaniel, K. Butler, S. McLaughlin, R. Sion, E. Zadok, and of the PROV Family of Documents. http://www.w3.org/ M. Winslett. Towards a Secure and Efficient System for End-to- TR/prov-overview/, 2013. End Provenance. In Proceedings of the 2nd conference on The- [60] C. Wright, C. Cowan, J. Morris, S. Smalley, and G. Kroah- ory and practice of provenance, San Jose, CA, USA, Feb. 2010. Hartman. Linux Security Module Framework. In Ottawa Linux USENIX Association. Symposium, page 604, 2002. [43] K. Muniswamy-Reddy, D. A. Holland, U. Braun, and M. Seltzer. [61] C. Wright, C. Cowan, S. Smalley, J. Morris, and G. Kroah- Provenance-Aware Storage Systems. In Proceedings of the 2006 Hartman. Linux security modules: General security support for USENIX Annual Technical Conference, 2006. the linux kernel. In Proceedings of the 11th USENIX Security Symposium, pages 17–31, Berkeley, CA, USA, 2002. USENIX [44] K.-K. Muniswamy-Reddy, U. Braun, D. A. Holland, P. Macko, Association. D. Maclean, D. Margo, M. Seltzer, and R. Smogor. Layering in Provenance Systems. In Proceedings of the 2009 Conference on [62] Y. Xie, K.-K. Muniswamy-Reddy, D. Feng, Y. Li, and D. D. E. USENIX Annual Technical Conference, ATC’09, June 2009. Long. Evaluation of a Hybrid Approach for Efficient Provenance Storage. Trans. Storage, 9(4):14:1–14:29, Nov. 2013. [45] D. Nguyen, J. Park, and R. Sandhu. Dependency Path Patterns As the Foundation of Access Control in Provenance-aware Sys- [63] Y. Xie, K.-K. Muniswamy-Reddy, D. D. E. Long, A. Amer, tems. In Proceedings of the 4th USENIX Conference on Theory D. Feng, and Z. Tan. Compressing Provenance Graphs, June and Practice of Provenance, TaPP’12, pages 4–4, Berkeley, CA, 2011. USA, 2012. USENIX Association. [64] X. Zhang, A. Edwards, and T. Jaeger. Using CQUAL for Static [46] Q. Ni, S. Xu, E. Bertino, R. Sandhu, and W. Han. An Access Analysis of Authorization Hook Placement. In Proceedings of Control Language for a General Provenance Model. In Secure the 11th USENIX Security Symposium, 2002. Data Management, Aug. 2009. [65] W. Zhou, Q. Fei, A. Narayan, A. Haeberlen, B. T. Loo, and [47] J. Park, D. Nguyen, and R. Sandhu. A Provenance-Based Access M. Sherr. Secure Network Provenance. In Proceedings of Control Model. In Proceedings of the 10th Annual International the 23rd ACM Symposium on Operating Systems Principles, Conference on Privacy, Security and Trust (PST), pages 137–144, SOSP’11, Oct. 2011. 2012. [66] W. Zhou, M. Sherr, T. Tao, X. Li, B. T. Loo, and Y. Mao. Efficient [48] D. Pohly, S. McLaughlin, P. McDaniel, and K. Butler. Hi-Fi: Col- Querying and Maintenance of Network Provenance at Internet- lecting High-Fidelity Whole-System Provenance. In Proceedings Scale. In ACM SIGMOD International Conference on Manage- of the 2012 Annual Computer Security Applications Conference, ment of Data (SIGMOD), June 2010. ACSAC ’12, Orlando, FL, USA, 2012. [49] J. Postel. RFC 791: Internet protocol. 1981.

16