In this paper, HTTP status codes are used as custom metrics within the HPA as the experimental scenario. By integrating the Random Forest classification algorithm from machine learning, attacks are assessed and predicted, dynamically adjusting the maximum pod parameter in the HPA to manage attack traffic. This approach enables the adjustment of HPA parameters using machine learning scripts in targeted attack scenarios while effectively managing attack traffic. All access from attacking IPs is redirected to honeypot pods, achieving a lower incidence of 5XX status codes through HPA pod adjustments under high load conditions. This method also ensures effective isolation of attack traffic, preventing excessive HPA expansion due to attacks. Additionally, experiments conducted under various conditions demonstrate the importance of setting appropriate thresholds for HPA adjustments.
翻译:本文以HTTP状态码作为HPA自定义指标构建实验场景。通过集成机器学习中的随机森林分类算法,对攻击行为进行评估与预测,动态调整HPA中的最大Pod参数以管控攻击流量。该方法能够在定向攻击场景中运用机器学习脚本调整HPA参数,同时有效管理攻击流量。所有来自攻击IP的访问均被重定向至蜜罐Pod,通过高负载条件下的HPA Pod调整实现了更低的5XX状态码发生率。该方法还能确保攻击流量的有效隔离,防止因攻击导致HPA过度扩缩。此外,在不同条件下进行的实验证明了为HPA调整设置合适阈值的重要性。