Computer Science
Computer Science-2021.gz:143419
Computer Science
d668b4ce4e7f2150ec3f70edc53d1d561f7d40da
SCADS: A Scalable Approach Using Spark in Cloud for Host-based Intrusion Detection System with System Calls

Following the current big data trend, the scale of real-time system call traces generated by Linux applications in a contemporary data center may increase excessively. Due to the deficiency of scalability, it is challenging for traditional host-based intrusion detection systems deployed on every single host to collect, maintain, and manipulate those large-scale accumulated system call traces. It is inflexible to build data mining models on one physical host that has static computing capability and limited storage capacity. To address this issue, we propose SCADS, a corresponding solution using Apache Spark in the Google cloud environment. A set of Spark algorithms are developed to achieve the computational scalability. The experiment results demonstrate that the efficiency of intrusion detection can be enhanced, which indicates that the proposed method can apply to the design of next-generation host-based intrusion detection systems with system calls.


INTRODUCTION
H OST-BASED intrusion detection system (HIDS) is renowned for the fine-grained analysis and the capability of discovering internal malicious behaviors. HIDS monitors logs from operating systems, whereas the network-based intrusion detection system (NIDS) focuses on the data flow of network traffic. HIDS with system calls (or system call-based HIDS) investigates gathered system call traces from Unix-like operating systems. This variety of HIDS initiated decades ago, and it has shown the ability to identify intrusions in Unix-like hosts. Conventionally, system call-based HIDS is often deployed on a physical machine to analyze malicious behaviors. It is challenging to manage and process the increasing quantity of system call traces originating from Unix-like operating systems of numerous virtual machines in a data center. Massive system call traces are a form of big data, which may be complex to be efficiently analyzed by standalone data mining methods. Training machine learning classifiers with big data on one individual physical machine that possesses fixed computational resources may require excessive time. The scale of intermediate datasets may not be tolerable for the internal memory of a PC. If those datasets are saved on hard drives, the real-time analysis may be postponed because of the I/O speed. In this case, it is demanded to propose innovative and cost-effective HIDS schemes for some particular Linux applications.
Recently, cloud computing presents extensive compu-tational capability and massive storage capacity that can facilitate security specialists to implement data-intensive projects with manageable expenditure. Users can focus on their works using a group of flexible IT services, with less concern about the purchase and maintenance of physical devices. Therefore, various security enterprises have moved their projects to the cloud. Moreover, a set of modern frameworks such as Apache Hadoop and Apache Spark are specifically developed for stable and scalable processing of big data. These frameworks enable the processing and storage of massive datasets among clusters that have the "master-workers" structure. Clusters can be created with multiple common computers, which provide local computation and storage capability. With these big data processing frameworks, computational resources in clusters can be scheduled, hardware failures can be handled, and functional user interfaces can be provided. Therefore, combining those big data processing frameworks and the capability of cloud computing can provide an opportunity to improve the detection efficiency of traditional system call-based HIDS.
To the best of our knowledge, there are limited research works concerning applying big data tools such as Apache Spark to system call-based HIDS. Motivated by this issue, in this article, we contribute to the community of HIDS by proposing a scalable HIDS approach using Spark in the Google cloud, endeavoring to improve the detection efficiency and the scalability for a new-generation system call-based HIDS.
The rest of this article is organized as follows. In Section 2, we provide related works about host-based intrusion detection system with system calls. In Section 3, we introduce the design of SCADS, the scalable approach using Spark in the Google cloud for HIDS with system calls. In Section 4, we demonstrate the experiment results. In Section 5, the conclusion is provided, and potential future works are discussed. arXiv:2109.11821v2 [cs.CR] 7 Jan 2022 2 RELATED WORKS 2.1 Host-based intrusion detection system with system calls System call-based HIDS was initially proposed as the "sequence time-delay embedding (STIDE)" method [1] [2] [3] [4] [5]. In STIDE, system call arguments are ignored. Short system call sequences from normal processes are used to construct databases of normal behaviors; system call sequences for testing are compared with the normal databases to identify anomalies. Since then, researchers have been devoting to improving the detection accuracy of system callbased HIDS. When it comes to rule learning-based HIDS methods [6] [7] [8] [9] [10] [11], short system call sequences are extracted and labeled to train a set of rules, and testing sequences that differ from those predefined rules are considered as anomalies [12]. It is also notable that the Hidden Markov Model (HMM) is broadly adopted in system callbased HIDS, where the evaluation, decoding, and learning problems of HMM are applicable [3] [32], and Bloom filter [33], etc.
Besides the detection accuracy, the detection efficiency is another important factor. Low detection efficiency may result in the delay of real-time intrusion detection from a large amount of system call traces. Therefore, researchers also have been attempting to reduce the processing cost and computational complexity. For instance, Hu et al. provided an approach which eliminates near-duplicate sequences of system calls to accelerate the training process of HMM [34]. A novel "nested-arc hidden semi-Markov model (NAHSMM)" was developed by Haider et al. to improve the training efficiency of HMM [16]. The "Kernel State Modeling" approach was proposed by Murtaza et al. to transfer system call traces to kernel module traces for the reduction of processing time [35] [36]. The "anomaly recognition and detection (AnRAD)" approach proposed by Chen et al. achieves high-speed incremental learning of data streams by implementing "a real-time self-structuring learning framework" [30] [31], etc.

Public cloud
Contemporary public cloud computing services can offer load-balanced IaaS (Infrastructure as a Service) for scalable data analytics. Based on the information provided by Amazon EC2 [37] and Google Compute Engine [38], IaaS cloud computing services can be scaled from single to multiple virtual machines (instances) running in data centers with consistent performance. Users can manage and configure those instances on web interfaces. The pricing of those public cloud computing services is flexible. According to the scale of their projects, users can choose and pay for the sizes of processors, the volume of storage, and the time of computation. Moreover, renowned enterprises such as Amazon and Google may provide more reliable and less vulnerable cloud computing services, considering intruders may attack the intrusion detection software based on the vulnerabilities. Therefore, system call-based HIDS can be deployed in the public cloud. General acceleration methods used in the community for system call-based HIDS can also be integrated into public cloud platforms.

Apache Spark
Contemporary big data processing frameworks (or big data tools) refer to a group of open-source software that can execute on clusters built with common hosts for distributed, scalable, and reliable processing of large-scale datasets. These frameworks provide functionalities such as distributed storage and processing of big data, and these frameworks usually have user-friendly APIs and web interfaces. These frameworks can deliver high-availability services, and frequent hardware failures can be automatically handled and restored. Distributed algorithms can be passed to worker nodes to process the local data. Therefore, with big data tools deployed on clusters, datasets can be efficiently processed.    The distributed and fault-tolerant computing paradigm of Spark is based on the Resilient Distributed Dataset (RDD) and the relevant directed acyclic graph (DAG) (depicted in figure 1).
An RDD consists of multiple partitions. The dependencies between RDDs can be classified into two types, namely, narrow dependencies and wide dependencies. Narrow dependencies allow pipelined executions in one cluster node with no shuffling, whereas wide dependencies require data shuffling across nodes [39]. Some examples of narrow dependencies and wide dependencies are depicted in figure  2. As the process of data shuffling in wide dependencies may require additional processing time, unnecessary data shuffling should be avoided.

SCALABLE APPROACH USING SPARK IN CLOUD FOR SYSTEM CALL-BASED HIDS
The intrusion detection procedure for SCADS is depicted in figure 3. There are two main phases in this procedure, i.e., the training phase and the testing phase. There are several steps for each phase.
(1) The training phase. Firstly, the ADFA-LD dataset is prepared and stored in the cloud storage system. For the preprocessing and feature extraction of the training phase, vectors of words are generated from raw system call traces with the multiple-length n-gram method. The single-length n-gram method is also applied for comparison. TF-IDF feature vectors are generated from the vectors of words and labeled as normal or attack. Two kinds of classifiers are trained in the experiments. One is the logistic regression with limited-memory BFGS (LR-LBFGS), the other is the linear support vector machine (SVM).
(2) The testing phase. For the preprocessing and feature extraction of the testing phase, vectors of words are generated from raw system call traces with the multiple-length n-gram method. The single-length n-gram method is also applied for comparison. For the generation of TF-IDF feature vectors, it is assumed that in the real-world scenario of intrusion detection, real-time system call traces are gathered by the IDS trace by trace. Therefore, the IDF model of the testing dataset cannot be obtained at one-time. In this case, for each testing trace, the TF vector is generated, then the TF-IDF feature vector is generated using the IDF model of the training dataset. Then the TF-IDF feature vector is passed to the detection models (LR-LBFGS and SVM) for the prediction of either intrusive or normal trace. Finally, the value of AUC is returned to evaluate the detection accuracy. TF feature vectors are used in this phase for comparison. The detailed steps are elaborated in the following subsections.

Symbols
Symbols used for the description of the proposed approach are listed and described in table 1.

Symbols
Descriptions IH The complete dataset of system call traces T T A trace of system calls S S A system call ID The complete corpus of documents D D The generated document that contains the extracted words W of system calls S W An extracted word of system calls S

RDD repartitioning
To achieve the detection efficiency and scalability for a HIDS using Spark, the design of the intrusion detection algorithms should conform to the internal mechanism of Spark. To achieve distributed processing, the raw system call traces should be firstly distributed evenly among worker nodes of the Spark cluster, and then be processed by appropriate algorithms in parallel. In the proposed approach, after eliminating redundant traces, the raw system call traces for training and testing are treated as Spark RDDs, each RDD has several partitions. When the system call traces are firstly loaded from the storage system and cached as RDDs, they may only have a few partitions and are not distributed evenly among worker nodes of the cluster. Therefore, we have designed an RDD repartitioning method using the Spark API to transform those RDDs of raw system call traces into new RDDs with more partitions; the new partitions are distributed evenly to the worker nodes. The RDD repartitioning method for system call traces is implemented in algorithm 1, and figure 4 provides a demonstration of the RDD repartitioning process using the RangePartitioner in Spark. The RDD repartitioning method is explained as follows.  (1) For an RDD of system call traces traces, each trace is assigned a hashCode value by calling the transformation map. Then the RDD tHashed will be repartitioned by the RangePartitioner, which can partition traces with hashCode values into roughly equal ranges.
(2) Then a Spark RangePartitioner rangeP tnr is constructed with two parameters. The RDD tHashed will be repartitioned by the rangeP tnr. Since traces.count.toInt counts the number of system call traces in the dataset, the number of partitions of the new RDD tP tned is roughly equal to the number of system call traces. Thus each partition of tP tned may represent a system call trace in this case.
(3) Then for the repartitioned RDD tP tned, after processed by the transformation flatMap on the values to split by one or more whitespaces, the transformation mapPartitions operates on every partition of the RDD input to extract words of system calls by calling the function WordsGen. Then the RDD output is generated. (4) Then the RDD output is coalesced to eight partitions by using the transformation coalesce, which is "useful for running operations more efficiently after filtering down a large dataset" [41]. The number of coalesced partitions in the proposed approach is selected based on the number of worker nodes. The second parameter of coalesce is set to "false" in the proposed approach, as it is expected that the coalescence of partitions only occurs within the local worker nodes with no data shuffling, i.e., the coalescence conforms to the narrow dependencies depicted in figure 2. Using the parameter of "true" may cause additional shuffling between worker nodes.

Single-length n-grams
For system call-based HIDS, an n-gram is referred to a contiguous sequence of n system calls extracted from a system call trace within a time interval [42]. The sliding window algorithm with window size n can be taken to scan a system call trace to generate n-grams of system calls, and the generated n-grams can be used for training detection models. Using the n-gram method for preprocessing has been widely adopted by HIDS researchers [33] [20]. The term "single-length n-gram method" is used to compare with the "multiple-length n-gram method".
The process of feature extraction with the single-length n-gram method is described as follows. Let IH = {T 1 , T 2 , ..., T m } be the complete dataset of m system call traces T ; and let T = {S 1 , S 2 , ..., S k } be a trace of k system calls S. Then for a trace T , one sliding window of length n is applied to traverse from the beginning to the end of trace T to extract contiguous system call sequences. The maximum window size n allowed in this case is k, which is the length of trace T . The contiguous system call sequences extracted are treated as words W of length n. Therefore, if n is equal to 6, for trace T the generated document D that contains the extracted words W of system calls is, Algorithm 2 implements the single-length n-gram method using Spark. It takes the sliding window algorithm with one window size n. In Algorithm 2, n is set to 6. Thus the length of the extracted words W is 6.

Multiple-length n-grams
The multiple-length n-gram method has been proven to be effective to increase the detection accuracy in the area of system call-based HIDS [43] [44] [45]. For instance, Creech et al. used multiple sliding windows with various sizes to scan the complete system call trace; the generated multiplelength n-grams were used for feature extraction, and notable detection accuracy was achieved [46]. Therefore, we have implemented the multiple-length n-gram method with Spark for feature extraction.
The process of feature extraction with the multiplelength n-gram method is described as follows. Let IH = {T 1 , T 2 , ..., T m } be the complete dataset of m system call traces T ; and T = {S 1 , S 2 , ..., S k } be a trace of k system calls S. Then for a trace T , a set of sliding windows ranging from size 1 to n are applied to traverse from the beginning to the end of trace T to extract contiguous system call sequences. In this case, the maximum window size n allowed is k, which is the length of trace T . The contiguous system call sequences extracted at this stage form words W of length 1 to n. Therefore, if n is equal to 6, for trace T the generated document D that contains the extracted words W of system calls is, Algorithm 3 implements the multiple-length n-gram method with the sliding window algorithm with multiple window sizes. In Algorithm 3, the maximum window size n is set to 6, thus the length of the extracted words can range from 1 to 6. When the maximum window size n is set to one, the algorithm is the same with the single-length n-gram method.

Constructing feature vectors with TF-IDF
"Term frequency-inverse document frequency (TF-IDF)" is a feature extraction scheme commonly used in text-based information retrieval to measure the importance of a word in a document and the relevant corpus [47]. The term frequency (TF) is the number of times that the word appears in the document; the document frequency (DF) is the number of documents that contain the word [48]. Using only TF may over-emphasize frequent words, as a frequent word in the corpus may carry little special information about a particular document; the inverse document frequency (IDF) can measure the quantity of information that a word provides about a particular document [41]. Thus the TF-IDF value of a word increases according to its frequency in the document and is adjusted by the frequency in the corpus. We have implemented TF-IDF with Spark to construct feature vectors. The process is described as follows. Let ID = {D 1 , D 2 , ..., D n } denotes the complete corpus of n documents D. Term frequency T F (W, D) is the number of times that a word W appears in document D, while document frequency DF (W, ID) is the number of documents that contain the word W [49]. In this case, the IDF is defined as, The TF-IDF is defined as, TF and IDF are implemented in HashingTF and IDF in Spark. The TF-IDF feature vectors generated from the training and testing system call traces are also treated as Spark RDDs. The HashingTF utilizes feature hashing in machine learning [50]. In the proposed approach, to reduce the chance of hash collisions, the dimension number of the target feature vectors is set to the number of distinct words in the corpus of the training dataset. Algorithm 4 is implemented to count the number of distinct words for an RDD of vectors of words. Algorithm 5 is implemented to generate TF feature vectors from an RDD of vectors of words as sparse vectors. Algorithm 6 [41] is implemented to generate TF-IDF feature vectors from an RDD of vectors of words as sparse vectors. In practice, the real-time system call traces are assumed to be gathered by the IDS trace by trace. Thus the whole testing dataset cannot be processed at onetime, instead only one single trace can be handled each time. In this case, for the testing traces, only TF feature vectors can be generated from them, and the IDF model is unobtainable. Therefore, algorithm 6 is applied to the training dataset only. To generate the TF-IDF feature vectors of the testing dataset, firstly the TF feature vectors are generated using algorithm 5, and then adjusted by the Spark IDF model generated from the training dataset.

Classifier training and prediction
The training and prediction processes of machine learning classifiers can be classified as the optimization problem, where w is the weight vector with d items. The objective function f (w) can be written as, where x i ∈ R d , 1 ≤ i ≤ n is the training data, y i ∈ R is the prediction label, L(w; x, y) is the loss function, R(w) is the regularization term, and λ is the regularization term parameter. The loss function measures the deviation between the prediction and the actuality; the regularization term controls the model complexity and uses the parameter to reduce the deviation while avoiding over-fitting. 1 and 2 are two commonly used regularization terms, We use logistic regression and linear support vector machine for training and prediction. For the logistic regression classifier, the LBFGS algorithm is used for training; for the linear support vector machine classifier, the stochastic gradient descent method (SGD) and the 2 regularization method are used for training.

LBFGS logistic regression classifier (LR-LBFGS)
Logistic regression is a widely used linear classification method. The loss function of logistic regression is, For x, the trained model uses the logistic function to predict, If f (w T x) is greater than a given threshold, then the prediction is positive, otherwise it is negative. We use the LBFGS algorithm and 2 regularization for training of the logistic regression classifier. The LBFGS algorithm is an optimization algorithm based on the Quasi-Newton method [51]. The LBFGS algorithm uses limited computer memory to approximates the Broyden-Fletcher-Goldfarb-Shanno (BFGS) algorithm. The LBFGS algorithm is claimed to have fast convergence speed. Therefore, we use the LBFGS algorithm for training of the logistic regression classifier.

Linear support vector machine classifier (SVM)
Linear Support Vector Machine (SVM) is a linear method that is commonly used for classification of large-scale data. The loss function of SVM is the hinge loss, L(w; x, y) := max{0, 1 − yw T x}, y ∈ {−1, +1} (8) The SVM is predicted based on the value of w T x. If w T x ≥ 0, the prediction is positive. If w T x < 0, the prediction is negative. We use the stochastic gradient descent method (SGD) and the 2 regularization method for the training of SVM classifier.

The training and prediction processes
(1) In the processes of classifier training and prediction, firstly the attack traces and normal traces of ADFA-LD are loaded from the Google cloud storage system. The distinct transformation, which can produce a new RDD with only distinct elements, is called to eliminate repetitive traces for both of the attack traces and normal traces. For both of the attack traces and normal traces, 60% of them are randomly selected as the training data, and the other 40% of them are selected as the testing data.
(2) To get the number of dimensions num for functions TfGen and TfidfGen, the attack training traces and normal training traces are combined using the union method in Spark, followed by applying the distinct transformation to eliminate repetitive traces. Then the function VectsGen is applied to the combined traces to generate vectors of words, followed by applying the function NumOfDistinctWords to get the number of distinct words, i.e., the number of dimensions.
(3) For both of the attack training data and normal training data, the function VectsGen is called to generate vectors of BinaryClassificationMetrics(predictionAndLabels) 5 val AU C = metrics.areaUnderROC() 6 return AU C words, followed by applying the function TfidfGen to generate TF-IDF feature vectors. The attack feature vectors are labeled point 1, and the normal feature vectors are labeled point 0. Then the labeled feature vectors are combined using the union method in Spark to form trainingData, which is the dataset for training the classifiers. (4) In practice, as the real-time system call traces are assumed to be gathered by the IDS trace by trace, thus the whole testing dataset cannot be processed at one-time, instead only one single trace can be processed each time. Therefore, for both of the attack testing data and normal testing data, the function VectsGen is called to generate vectors of words, followed by applying the function TfGen to generate TF feature vectors. Then the function TfGen is applied to the vectors of words formed in step (2) to generate TF feature vectors from the training dataset, followed by generating the relevant Spark IDF model of the training dataset. Then this IDF model is used to adjust the attack testing TF feature vectors and normal testing TF feature vectors. The (adjusted) attack feature vectors are labeled point 1, and the (adjusted) normal feature vectors are labeled point 0. The labeled feature vectors are combined using the union method in Spark to form testingData, which is the dataset for testing the classifiers. (5) Algorithm 7 and algorithm 8 [41] implement the training and prediction with the LR-LBFGS classifier and the SVM classifier, respectively. The trainingData and testingData are prepared for training and prediction. For the LR-LBFGS classifier, the LogisticRegressionWithLBFGS method is used for training; for the SVM classifier, the SVMWithSGD method is used for training and the number of iterations is set to 100. Finally, the predicted labels are compared with the labels of the testing feature vectors to evaluate the detection accuracy. For these two algorithms, the AUC value AU C is returned using the BinaryClassificationMetrics method and the areaUnderROC method.

The environment for experiments
The experiments are launched with Dataproc on the Google Compute Engine [38] cloud computing environment. Dataproc provides pre-installed and administrated Apache new BinaryClassificationMetrics(scoreAndLabels) 5 val AU C = metrics.areaUnderROC() 6 return AU C Hadoop and Spark services with a user-friendly API for configuration. Dataproc can automatically and quickly create and manage clusters of virtual machines. There are three modes to deploy a cluster, i.e., "single node (one master and zero workers)", "standard (one master and multiple workers)", or "high availability (three masters and numerous workers)". Virtual machines of a cluster can connect with each other with internal IP networking. Users can customize the number of virtual CPUs, the memory capacity, the sizes and types of disks, and the region/zone where the cluster to be deployed. The created master node contains the HDFS NameNode and the YARN ResourceManager, and can be accessed with SSH; each of the worker nodes includes an HDFS DataNode and a YARN NodeManager. Spark jobs can be submitted via the Dataproc API, where the jobs' output can be accessed; the graphs of the network, disk, and CPU utilization can also be viewed. Via the API, the created cluster can be scaled up or down regarding the number of worker nodes. Therefore, a cluster can be scaled multiple times with simple operations, which is flexible to test the scalability of the proposed approach.
In our experiments, a free account has been set up firstly. Standard clusters (one master, multiple workers) are created within the global region and us-central1-c zone. For a cluster, the master node has one vCPU with 3.75GB memory, and the primary disk size is 100GB; each of the worker nodes has the same machine type with the master node. Spark version 2.2.1 on Dataproc is used for the experiments, and the number of Spark executors can be flexibly extended from 1 to 6.

The dataset for experiments
As most of the datasets utilized for measuring system callbased HIDS were created in the last century and cannot represent modern attack approaches, Creech et al. compiled the new publicly available ADFA-LD dataset [46]. In their method, Ubuntu Linux is the host operating system, which represents a contemporary Linux server and provides multiple functionalities with a few vulnerabilities. The dataset has three subsets of raw system call traces, including 833 traces of normal data, 4372 traces of validation data, and 746 traces of attack data. Training and validation traces were gathered during normal activities of the operating system. The attack traces were gathered under the cyber attack environment. Attack methods include "brute force password guessing", "add new superuser", "Java Meterpreter payload", "Linux Meterpreter payload", and "C100 webshell" [52]. The ADFA-LD dataset was claimed to be more challenging to investigate than the traditional datasets since the modern Linux environment has become more complicated than before [52]. Thus, the ADFA-LD dataset is a new benchmark for analyzing system call-based HIDS and is utilized in our experiments.

The experiment processes
In our experiments, the attack traces and normal traces of ADFA-LD are utilized. Multiple files in the dataset are combined into less number of files for experiments. The dataset is prepared and stored in a bucket of Google's cloud storage system. With the Google cloud storage, users can store and retrieve large-scale data flexibly, regarding the time and the location. The default storage class of the bucket used for experiments is Multi-Regional, and the location is ASIA. During an experiment, after logging into the master node with SSH and launching the Spark shell, the attack traces and normal traces of ADFA-LD are firstly retrieved from the bucket of Google's cloud storage system, followed by performing the complete training and testing phases for intrusion detection.  Figure 5 demonstrates the directed acyclic graph (DAG) formed using the multiple-length n-gram method and the LR-LBFGS classifier in an experiment. The DAG has 271 stages, which represent the complete experiment from the reading of data files to the returning of the AUC values. The effectiveness of the multiple-length n-gram method and the TF-IDF method are tested in the experiments. To test the effectiveness of using the multiple-length n-gram method for feature extraction, by using the LR-LBFGS classifier, the AUC values achieved using the multiple-length ngram method are compared with the AUC values achieved using the single-length n-gram method. To test the effectiveness of using the TF-IDF method to construct feature vectors, for the testing traces, we have compared the AUC values achieved using only the TF feature vectors with using the TF-IDF feature vectors adjusted by the Spark IDF model generated from the training traces. The multiple-length ngram method and the LR-LBFGS classifier are used in this case.

Experiment results
The experiments also compare the LR-LBFGS classifier with the SVM classifier in terms of the detection accuracy and the scalability. The criteria of comparison are the AUC values and the average (executor) task time achieved when using these two kinds of classifiers.

Evaluation regarding the detection accuracy
The detection accuracy of a system call-based HIDS can be evaluated with the True Positive Rate (TPR) and False Positive Rate (FPR) criteria, which are defined as [53], (1) True Positive (TP): The label of a system call trace is attack and the prediction is also attack. The attack trace is detected correctly.
(2) False Positive (FP): The label of a trace is normal but the prediction is attack. A normal system call trace is falsely detected as an attack trace.
(3) True Negative (TN): The label of a trace is normal and the prediction is also normal. The testing system call trace is correctly predicted as normal.
(4) False Negative (FN): The label of a sequence is attack but the prediction is normal. The system omits an attack system call trace. The Receiver Operating Characteristic (ROC) curve can provide an intuitive view of the relation between the false positive rate (FPR) and the true positive rate (TPR) [54]. In the proposed approach, the performance regarding detection accuracy is evaluated using values of the area under the ROC curve (AUC). AUC can be a simple metric to provide an overall evaluation of the detection accuracy. Using AUC values, we have evaluated the performance regarding three aspects, i.e., the effectiveness of using the multiple-length n-gram method for feature extraction, the effectiveness of using the TF-IDF method to construct feature vectors, and the comparison of using the LR-LBFGS classifier with using the SVM classifier in terms of the detection accuracy.
(1) To test the effectiveness of using the multiple-length ngram method for feature extraction, under the circumstance of using the LR-LBFGS classifier, the AUC values achieved using the multiple-length n-gram method are compared with the AUC values achieved using the single-length ngram method. For the single-length n-gram method, we have tested the performance with the length of n from 1 to 10. For each length of n, the AUC values of ten experiments are recorded and averaged in table 2. For the multiplelength n-gram method, we have tested the performance with the maximum length of n from 1 to 10. For each of the maximum lengths of n, the AUC values of ten experiments are recorded and averaged in table 3. The averaged AUC values for both of the single-length n-gram method and the multiple-length n-gram method are depicted in figure 6(a)    for comparison. Based on figure 6(a), for the multiplelength n-gram method, the AUC values reach a plateau when the maximum length of n is greater than 5. For the single-length n-gram method, the AUC values reach the maximum when n is equal to 5. Based on our implementation methods and experiment results, the multiple-length ngram method outperforms the single-length n-gram method using the LR-LBFGS classifier when the sizes of n (or maxi-   mum n) range from 1 to 10.
(2) To test the effectiveness of using the TF-IDF method to construct feature vectors, for the testing traces, we have compared the AUC values obtained using only the TF feature vectors with using the TF-IDF feature vectors adjusted by the Spark IDF model generated from the training traces. The multiple-length n-gram method and the LR-LBFGS classifier are used. The AUC values of using only the TF feature vectors for testing traces are recorded in table 4. For each of the maximum lengths of n, the AUC values of ten experiments are recorded and averaged. The averaged AUC values of these two cases (TF only and TF-IDF) are depicted in figure 6(b). Based on our implementation methods and experiment results, using only the TF feature vectors for testing shows unstable performance, and using Spark IDF model generated from the training traces to adjust the TF feature vectors of the testing traces is effective to improve the detection accuracy.
(3) The experiments compare the LR-LBFGS classifier and the SVM classifier regarding the AUC values. According to table 5 and figure 7, for the LR-LBFGS classifier, the AUC values reach a plateau when the maximum length of n is greater than 5; for the SVM classifier, the AUC values reach a plateau when the maximum length of n is greater than 3. During this group of experiments, when the iteration number of SVM is set to 100, the LR-LBFGS classifier outperforms the SVM classifier regarding the detection accuracy.

Evaluation of the scalability
Via the Dataproc API, the created Spark cluster can be flexibly scaled up or down to test the scalability of the proposed approach. As we use a free account of the Google Compute Engine, the number of Spark executors in our experiments ranges from 1 to 6. The experiments for the evaluation of scalability are divided into two groups. The first group uses the LR-LBFGS classifier, the second group uses the SVM classifier. The multiple-length n-gram method is used in both of the two groups, and the maximum length of n is equal to 1, 6, and 10, respectively. For both of the two groups of experiments, in each case of the number of Spark executors (1 to 6), we have executed the system three times, applying the multiple-length n-gram method with different maximum lengths of n (1, 6, and 10). The relevant average task time of Spark executors is recorded each time.
Thus there are 54 times of experiment in each group of experiments. The results are averaged in figure 8. Based on figure 8, with the increase of the maximum length of n in the multiple-length n-gram method, the average task time of Spark executors increases as well. When the maximum length of n is equal to 10, the LR-LBFGS classifier is more efficient than the SVM classifier regarding the average task time of Spark executors. For both of the two classifiers, with the increase of the number of Spark executors, the average task time of Spark executors decreases apparently. Therefore, the approach of SCADS shows acceptable scalability.

CONCLUSION AND FUTURE WORKS
In this article, we have proposed SCADS, a scalable approach using Spark in the Google cloud for host-based intrusion detection system with system calls. Based on the experiment results, the proposed framework with Apache Spark and Google cloud computing services can improve the detection efficiency of traditional system call-based HIDS. Besides the algorithms used in our experiments, other existing intrusion detection algorithms may also be incorporated into this proposed framework with Apache Spark and Google cloud computing services. However, as the current experiments are conducted with a free account, the scale of computation is relatively limited. Therefore, in the future experiments, we will keep tunning the system to achieve better performance, and we will also consider upgrading the account to a paid one for the processing of real-time large-scale system call traces.