Evaluation of Unsupervised Anomaly Detection in Structured API Logs: A Comparative Evaluation with a Focus on API Endpoints
2024 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE credits
Student thesis
Abstract [en]
With large quantities of API logs being stored, it becomes difficult to manually inspect them and determine whether the requests are benign or anomalies, indicating incorrect access to an application or perhaps actions with malicious intent. Today, companies can rely on third-party penetration testers who occasionally attempt various techniques to find vulnerabilities in software applications. However, to be a self-sustainable company, implementing a system capable of detecting abnormal traffic which could be malicious would be beneficial. By doing so, attacks can be proactively prevented, mitigating risks faster than waiting for third parties to detect these issues. A potential solution is applying machine learning, specifically anomaly detection, which detects patterns that do not conform to normal standards. This thesis covers the process of having structured log data to find anomalies in the log data. Various unsupervised anomaly detection models were evaluated on their capabilities of detecting anomalies in API logs. These models were K-means, Gaussian Mixture Model, Isolation Forest and One-Class Support Vector Machine. The findings from the evaluation show that the Gaussian Mixture Model was the best baseline model, reaching a precision of 63%, a recall of 72%, resulting in an F1-score of 0.67, an AUC score of 0.76 and an accuracy of 0.71. By tuning the models, Isolation Forest performed the best with a precision of 67% and a recall of 80%, resulting in an F1-score of 0.73, an AUC score of 0.83 and an accuracy of 0.75. The pros and cons of each model are presented and discussed along with insights related to anomaly detection and its applicability in API log analysis and API security.
Place, publisher, year, edition, pages
2024. , p. 68
Keywords [en]
machine learning, api security, security, unsupervised learning
National Category
Computer Sciences
Identifiers
URN: urn:nbn:se:liu:diva-204192ISRN: LIU-IDA/LITH-EX-A--24/019--SEOAI: oai:DiVA.org:liu-204192DiVA, id: diva2:1866087
External cooperation
Upsales Nordic AB
Subject / course
Computer Engineering
Presentation
2024-06-04, Charles Babbage, B-Huset, Linköpings universitet, Linköping, 13:15 (English)
Supervisors
Examiners
2024-06-112024-06-052024-06-11Bibliographically approved