机器学习为何难以应用于真实的网络入侵检测系统?(上)

admin 2023年1月29日18:06:24评论13 views字数 10190阅读33分58秒阅读模式

今天分享的是国际网络安全领域顶级学术会议 IEEE S&P 2020 Test of Time Award(时间检验奖)获奖论文《Outside the Closed World: On Using Machine Learning For Network Intrusion Detection》(超越封闭世界假定:关于将机器学习用于网络入侵检测的思考)[0](下文称《Outside》)。“时间检验奖”,旨在表彰富有预见性和指导价值的研究论文,入选论文均对领域研究产生了持久的影响,正确预测甚至改变了行业的发展方向。文章作者为加州大学伯克利分校国际计算机科学研究所的 Robin Sommer 博士与 Vern Paxson 教授。Robin Sommer 博士毕业于德国帕德博恩大学,目前为网络安全公司 Corelight 的联合创始人 [1]。Vern Paxson 教授是计算机领域的著名教授,ACM Follow [2]。他曾是IETF/IESG成员、传输领域主任、IRTF主席,因为他在网络测量和网络安全领域的突出贡献,ACM SIGCOM曾授予他终身成就奖。Vern Paxson 教授是经典网络入侵检测系统 Bro [3](现更新为 Zeek)的作者,是网络入侵检测系统(NIDS)实践研究的开拓者。


该论文于2010年发表于安全顶会IEEE S&P。当时,尽管在网络入侵检测领域应用机器学习方法的研究数不胜数,但是在真实的场景中却很少看到成功的应用。作者基于入侵检测领域丰富的研究和实践经验、以及对机器学习的深刻洞察,极具前瞻性地指出:由于真实场景中的网络入侵检测与其他领域任务存在本质差别,机器学习算法难以得到有效应用,需解决一系列挑战。该论文首次对网络入侵检测系统(Network Intrusion Detection System, NIDS)进行了系统建模,针对机器学习算法应用于入侵检测时面临的挑战展开系统分析,并提供了一系列应对建议,希望为未来的网络入侵检测工作提供帮助。

论文发表后的十年间(2010-2020年),随着算力增长和海量数据集的涌现,机器学习取得了飞跃式发展,在机器翻译、图像内容识别等领域取得了里程碑式的突破。在安全研究领域,机器学习应用也是备受关注的话题,例如,入侵检测 [4,5]、恶意软件分析 [6,7]、漏洞发现 [8,9] 和二进制代码分析 [10~12] 等。然而,即使在十年后的今天,本文指出的机器学习应用的挑战在安全研究中仍然成立,其所提供的建议对安全研究人员也依然具有参考价值。

我们将通过两篇推送介绍文章内容:第一篇介绍机器学习应用于网络入侵检测中的困境与挑战,第二篇结合近年来最新的研究工作,介绍机器学习应用于安全研究中的建议。

机器学习为何难以应用于真实的网络入侵检测系统?(上)
全文共2900字,阅读时间约10分钟。


作者介绍:刘明烜,清华大学网络与系统安全实验室博士研究生,研究方向为网络安全和人工智能安全,导师为段海新教授。博士期间在域名基础设施安全、恶意加密流量检测以及人工智能模型对抗分析等领域发表高水平期刊会议论文十余篇(包括ACM CCS、TDSC、IJCAI、RAID、ACSAC、ESORIC),获得2022年度 EthiCS 最佳学生论文奖、2021年“第五届强网杯智能密码破解赛道一等奖”。预计毕业时间2023年6月,联系邮箱[email protected]

01

【背景介绍】


本文首次对网络入侵检测进行了系统建模,分析机器学习应用于网络入侵检测领域面临的挑战。如图1所示,网络入侵检测(NIDS)是指通过分析网络流量数据发现攻击行为的计算机系统。检测的基本假设是:恶意活动会表现出在正常活动中不能观察到的特征 [13]。基于该假设,部分安全研究工作开始将机器学习算法应用于网络入侵检测 [14~21]。
机器学习为何难以应用于真实的网络入侵检测系统?(上)
图1:网络入侵检测示意图

然而,本文指出,尽管机器学习算法在既往许多经典领域取得了令人瞩目的成就(如推荐系统、机器翻译、图像识别等),但由于安全场景中检测攻击与其他的任务场景有根本性的不同,基于机器学习的入侵检测方案难以在真实网络环境之中有效应用。

文章首次针对机器学习算法应用在网络入侵检测中面临的挑战展开系统分析。首先,机器学习算法更适合基于已知数据样本进行分类,而入侵检测不仅需要检测已知攻击行为,还应发现未知攻击现象,这与机器学习算法的分类功能具有本质冲突,是其难以直接应用于网络入侵检测的根本原因。此外,网络安全场景中的误判代价极高(High Cost of Errors)、机器学习算法与安全运维人员期望的语义差异(Semanctic Gap)、现实网络流量的多样性(Diversity of Network Traffic)导致异常难以判断、很难设计全面准确的评估方案(Difficulties with Evaluation)等,也是其所面临的应用挑战。下面进行具体介绍。


02

【主要挑战】


挑战一:网络安全场景中的入侵检测与机器学习算法的离群点检测两者具有本质差异(Outlier Detection)

如图2所示,经典机器学习算法的根本目的是解决分类问题,依据已知样本识别相似数据,例如根据用户历史的购买行为推测用户未来倾向于购买的商品 [22]。

机器学习为何难以应用于真实的网络入侵检测系统?(上)
图2:机器学习可以解决类别定义明确的分类问题

然而,网络入侵检测需要解决的是从网络流量中识别入侵行为 [23],甚至是未知的攻击行为。如图3所示,一些研究工作试图将网络入侵检测问题转换成为分类问题,将流量分为“正常”与“异常”两种类别,即进行离群点检测(Outlier Detection)。

对于旨在发现新的攻击的异常检测而言,“新的攻击”是不可能获取标记数据集的。因此,只能通过学习大规模的“正常”流量数据 [24],试图发现“异常”入侵行为,并假设不属于“正常”样本特征的均为“异常”,这种假设被称为封闭世界假定[25]。其在网络世界中没有现实意义,因为非“正常“的流量可能仅是群发性网络活动和重传行为导致的网络激增 [28,29],将其直接判定为“异常”过于武断。而这也不是机器学习算法的理想应用场景。

机器学习为何难以应用于真实的网络入侵检测系统?(上)
图3:网络入侵检测的实际应用需要发现“封闭世界之外”的离群点

总的来看,基于机器学习的入侵检测更适用于发现已知攻击的相似变种,但不适用于发现未知的恶意攻击行为。

挑战二:网络安全场景中的误判可能会引入极高代价(High Cost of Errors)

一些经典的机器学习应用对误判通常容忍度较高。如图4所示,推荐不符合用户喜好的产品,后果可能仅是丢失了一笔生意,并不会造成特别负面的影响 [26]。然而,网络安全场景的检测误判代价远远高于其他领域。安全分析人员与运维人员需耗费大量时间精力逐一检查系统的误报,且考虑到实际网络流量规模极为庞大,即便是非常小的假阳率都会极大提升安全分析人员的时间成本、使系统无法实际部署应用 [25]。不仅如此,检测系统的漏报则可能意味着未能及时发现网络攻击现象,可能会对网络系统造成严重危害。


机器学习为何难以应用于真实的网络入侵检测系统?(上)
图4:机器学习的错误在其他领域的影响是微弱的

挑战三:机器学习算法与安全运维人员期望的语义差异(Semantic Gap)
      
异常检测系统面临的另一个关键挑战是,如何将机器学习的检测结果转化为网络运维人员可读的异常报告。已有研究均缺乏对该挑战的思考,即算法模型与实际安全运维之间存在语义差异(Semantic Gap)。本文认为,许多基于机器学习算法的网络入侵检测方案,本质上都是发现未在训练数据集中观测到“非正常的行为”,而非网络攻击行为。这使得检测结果(“非正常流量”)与实际期望(“攻击流量”)之间产生了语义差异,导致机器学习模型难以理解并学习到实际的安全规则。并且,在现实网络环境中,许多安全规则的具体含义是比较模糊的 [27]。例如,不同网络环境对于流量“过载”的具体判断标准不同。这也进一步加剧了网络入侵检测的难度。不仅如此,语义差异也使得机器学习算法输出的结果难以被安全分析人员与运维人员理解,即难以在真实场景下得到有效使用。

挑战四:现实网络流量复杂多变,难以准确界定何为异常(Diversity of Network Traffic)

机器学习为何难以应用于真实的网络入侵检测系统?(上)
图5:网络中导致多样性的因素非常多

入侵检测面临的另一个严峻挑战源自于网络流量的多样性。如果仅在流量层面观察,正常的网络通信行为也可能引起“非正常”现象。比如,群发性网络活动和重传均会导致网络流量激增 [28,29]。此外,如图5所示,网络流量的多样性不仅体现在数据包层面,应用层的句法和语义上的变化也可能颇为丰富 [30, 31]。因此,仅基于部分已知的流量训练学习的机器学习模型,难以应对复杂多变的真实网络环境。这也是基于机器学习的网络入侵检测所面临的一个极大的挑战。

挑战五:学术研究工作通常难以准确全面评价机器学习算法的实际效益(Difficulties with Evaluation)

本文认为,许多基于机器学习算法的网络入侵检测系统在现实应用中无法达到预期效果,一个潜在的原因是,安全研究人员没有办法对检测系统进行全面准确地评估。设计一个好的评估方案太困难了,甚至比设计入侵检测系统本身更加困难,主要原因包括:

1. 学术界缺乏公开的大规模网络数据集(Difficulties of Data)[27, 32~35],研究使用的训练/检测数据与实际网络场景差异过大,导致系统评估结果不可信;
2. 难以解释检测的结果(Mind the Gap)[26],检测系统给出的语义(如“流量异常”)跟运行维护人员的期待存在较大差距,不像其他领域中(如“垃圾邮件”)那么直观,运维人员无法评估“流量异常”的原因甚至后果,导致无法设计有效的系统评估方案 ;
3. 实际网络安全场景具有高对抗性,而研究往往未能考虑攻击者针对检测系统的逃逸(Adversarial Setting)[36~38]。

03

【小结】


本文首次系统分析了机器学习算法应用在网络入侵检测所面临的挑战,包括网络安全场景中的误判代价极高(High Cost of Errors)、机器学习算法与安全标准的语义差异(Semanctic Gap)、现实网络流量的复杂性(Diversity of Network Traffic)导致异常难以判断、机器学习算法在安全检测场景的实际效果很难得到全面准确的评估(Difficulties with Evaluation)等。

下篇推送中,我们将结合 USENIX Security 2022 的安全场景下机器学习应用建模和建议的工作,针对本文提出的挑战,提出安全场景下机器学习应用的建议。

原文链接
https://ieeexplore.ieee.org/document/5504793

原作者 PPT 链接
http://oakland31.cs.virginia.edu/slides/anomaly-oakland.pdf

参考文献

[0] Sommer, R. & Paxson, V. Outside the Closed World: On Using Machine Learning For Network Intrusion Detection. IEEE Symposium on Security and Privacy , 2010
[1] Personal Page of Robin Sommer, https://www.icir.org/robin/
[2] Personal Page of Vern Paxson, https://www.icir.org/vern/
[3] Paxson, Vern. "Bro: a system for detecting network intruders in real-time." Computer networks 31.23-24 (1999): 2435-2463.
[4] Mirsky Y, Doitshman T, Elovici Y, et al. Kitsune: an ensemble of autoencoders for online network intrusion detection[J]. arXiv preprint arXiv:1802.09089, 2018.
[5] M. Du, F. Li, G. Zheng, and V. Srikumar. Deeplog: Anomaly detection and diagnosis from system logs through deep learning. In Proc. of ACM Conference on Computer and Communications Security (CCS), 2017.
[6] J. Jang, D. Brumley, and S. Venkataraman. Bitshred: feature hashing malware for scalable triage and semantic analysis. In Proc. of ACM Conference on Computer and Communications Security (CCS), 2011.
[7] E. Mariconti, L. Onwuzurike, P. Andriotis, E. D. Cristofaro, G. J. Ross, and G. Stringhini. Mamadroid: Detecting android malware by building markov chains of behavioral models. In Proc. of Network and Distributed System Security Symposium (NDSS), 2017.
[8] Z. Li, D. Zou, S. Xu, X. Ou, H. Jin, S. Wang, Z. Deng, and Y. Zhong. Vuldeepecker: A deep learning-based system for vulnerability detection. In Proc. of Network and Distributed System Security Symposium (NDSS), 2018.
[9] F. Yamaguchi, A. Maier, H. Gascon, and K. Rieck. Automatic inference of search patterns for taint-style vulnerabilities. In Proc. of IEEE Symposium on Security and Privacy (S&P), 2015.
[10] S. H. H. Ding, B. C. M. Fung, and P. Charland. Asm2vec: Boosting static representation robustness for binary clone search against code obfuscation and compiler optimization. In Proc. of IEEE Symposium on Security and Privacy (S&P), 2019.
[11] E. C. R. Shin, D. Song, and R. Moazzezi. Recognizing functions in binaries with neural networks. In Proc. of USENIX Security Symposium, 2015.
[12] X. Xu, C. Liu, Q. Feng, H. Yin, L. Song, and D. Song. Neural network-based graph embedding for cross-platform binary code similarity detection. In Proc. of ACM Conference on Computer and Communications Security (CCS), 2017.
[13] D. E. Denning, “An Intrusion-Detection Model,”IEEE Trans-actions on Software Engineering, vol. 13, no. 2, pp. 222–232,1987.
[14] Wang K, Stolfo S J. Anomalous payload-based network intrusion detection[C]//International workshop on recent advances in intrusion detection. Springer, Berlin, Heidelberg, 2004: 203-222.
[15] Borders K, Springer J, Burnside M. Chimera: A declarative language for streaming network traffic analysis[C]//21st USENIX Security Symposium (USENIX Security 12). 2012: 365-379.
[16] Bartos K, Sofka M, Franc V. Optimized invariant representation of network traffic for detecting unseen malware variants[C]//25th USENIX Security Symposium (USENIX Security 16). 2016: 807-822.
[17] Li H, Hu H, Gu G, et al. vNIDS: Towards elastic security with safe and efficient virtualization of network intrusion detection systems[C]//Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security. 2018: 17-34.
[18] Milajerdi S M, Gjomemo R, Eshete B, et al. Holmes: real-time apt detection through correlation of suspicious information flows[C]//2019 IEEE Symposium on Security and Privacy (SP). IEEE, 2019: 1137-1152.
[19] Liu F, Wen Y, Zhang D, et al. Log2vec: A heterogeneous graph embedding based approach for detecting cyber threats within enterprise[C]//Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security. 2019: 1777-1794.
[20] Alsaheel A, Nan Y, Ma S, et al. {ATLAS}: A Sequence-based Learning Approach for Attack Investigation[C]//30th USENIX Security Symposium (USENIX Security 21). 2021: 3005-3022.
[21] Mirsky Y, Doitshman T, Elovici Y, et al. Kitsune: an ensemble of autoencoders for online network intrusion detection[J]. arXiv preprint arXiv:1802.09089, 2018.
[22] Du M, Chen Z, Liu C, et al. Lifelong anomaly detection through unlearning[C]//Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security. 2019: 1283-1297.
[23] Fu C, Li Q, Shen M, et al. Realtime Robust Malicious Traffic Detection via Frequency Domain Analysis[C]//Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security. 2021: 3431-3446.
[24] G. Linden, B. Smith, and J. York, “Amazon.com Recommendations: Item-to-Item Collaborative Filtering,” IEEE Internet Computing, vol. 7, no. 1, pp. 76–80, 2003.
[25] I. H. Witten and E. Frank, Data Mining: Practical Machine Learning Tools and Techniques (2nd edition). Morgan Kaufmann, 2005.
[26] R. O. Duda, P. E. Hart, and D. G. Stork, Pattern Classification (2nd edition). Wiley Interscience, 2001.
[27] “Make Data Useful,” Greg Linden, Data Mining Seminar, Stanford University, 2006. http://glinden.blogspot.com/2006/ 12/slides-from-my-talk-at-stanford.htm%l.
[28] S. Axelsson, “The Base-Rate Fallacy and Its Implications for the Difficulty of Intrusion Detection,” in Proc. ACM Conference on Computer and Communications Security, 1999.
[29] R. Sommer, “Viable Network Intrusion High-Performance Environments,” Ph.D. TU M¨unchen, 2005.
[30] W. Willinger, M. S. Taqqu, R. Sherman, and D. V. Wilson, “Self-Similarity Through High-Variability: Statistical Analysis of Ethernet LAN Traffic at the Source Level,” IEEE/ACM Transactions on Networking, vol. 5, no. 1, 1997.
[31] A. Feldmann, A. C. Gilbert, and W. Willinger, “Data Networks As Cascades: Investigating the Multifractal Nature of Internet WAN Traffic,” in Proc. ACM SIGCOMM, 1998.
[32] J. Xu, J. Fan, M. Ammar, and S. Moon, “On the Design and Performance of Prefix-Preserving IP Traffic Trace Anonymization,” in Proc. ACM SIGCOMM Internet Measurement Workshop, Nov. 2001.
[33] R. Pang, M. Allman, V. Paxson, and J. Lee, “The Devil and Packet Trace Anonymization,” in Computer Communication Review, 2006.
[34] K. S. Killourhy and R. A. Maxion, “Toward Realistic and Artifact-Free Insider-Threat Data,” Proc. Computer Security Applications Conference, 2007.
[35] 捷克共和国的捷克理工大学(CTU)的僵尸网络流量数据,https://www.stratosphereips.org/datasets-malware
[36] T. H. Ptacek and T. N. Newsham, “Insertion, Evasion, and Denial of Service: Eluding Network Intrusion Detection,” Secure Networks, Inc., Tech. Rep., January 1998.
[37] P. Fogla and W. Lee, “Evading Network Anomaly Detection Systems: Formal Reasoning and Practical Techniques,” in Proc. ACM Conference on Computer and Communications Security, 2006.
[38] M. Barreno, B. Nelson, R. Sears, A. D. Joseph, and J. D. Tygar, “Can Machine Learning Be Secure?” in Proc. ACM Symposium on Information, Computer and Communications Security, 2006.



编辑&审校|张一铭、刘保君



原文始发于微信公众号(NISL实验室):机器学习为何难以应用于真实的网络入侵检测系统?(上)

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年1月29日18:06:24
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   机器学习为何难以应用于真实的网络入侵检测系统?(上)http://cn-sec.com/archives/1400838.html

发表评论

匿名网友 填写信息