由于史诗级漏洞 “Log4JRCE” 漏洞的影响的不断进展,已经有越来越多的用户发现修改应用程序的源代码或者更新Apache版本需要更多时间来完成。在打补丁的过程中。我们建议您同时开始使用亚马逊云科技WAF的托管规则来阻断网上公开的漏洞利用工具的攻击尝试。这能减少来自互联网的漏洞扫描发现您网站潜在问题的机会。所以也请您尽快启用使用这个缓解措施。
1. 这个是什么漏洞,会有什么影响
Apache Log4j2 是一款常用的日志记录库,目前已确认存在任意代码执行漏洞,该组件存在Java JNDI注入漏洞,当程序将用户输入的数据进行日志,即可触发此漏洞,成功利用此漏洞可以在目标服务器上执行任意代码。鉴于此漏洞危害巨大、利用门槛低,建议用户尽快参考缓解方案阻止漏洞攻击。
2. 如何确定我是否受影响
如果您的应用基于 Java 开发直接使用了 log4j2 库或者使用如下框架,那么您可能会受影响。
受影响的log4j版本:Apache Log4j 2.x <= 2.14.2
受影响的第三方组件:Apache Struts2、Apache Solr、Apache Druid、Apache Flink 等众多组件与大型应用均受影响
3. 如何使用 Amazon WAF缓解这个漏洞
前置条件:服务通过 CloudFront 或者 ALB、API gateway、AppSync 接入。若未开通,请联系 AWS 人员指导。
使用方式:添加托管的WAF规则 “Known bad inputs”,其中已包含针对此漏洞的防护规则 “Log4JRCE” 。如您对配置过程存在疑问,请联系 Amazon 人员进行指导。

目前中国区域该托管规则也已经同步推出。可以用同样步骤来启用防护。
同时,建议关注 Log4j 官网,及时升级 Log4j 到修复版本。
4. 迁移至 Amazon 托管服务来缓解针对 Log4j2RCE 的漏洞攻击
如您系统当前运行环境包含如下列表中自建的受影响的服务/组件,则可考虑迁移至AWS对应的托管服务(这些服务已经完成针对此漏洞的修复)以缓解攻击。如您对迁移方案存在疑问,请联系 Amazon 技术人员进行协助。
- **MySQL、PostgreSQL**:Amazon RDS 、Amazon Aurora 已完成针对Log4j2RCE 相关问题的补丁修复
- **Kubernetes**:Amazon EKS 已提供针对 Kubernetes 运行环境的热补丁已缓解该漏洞对容器运行环境的影响,该热补丁需要客户选择使用,并会禁用客户容器中 Log4J2 库的 JNDI 查找功能。详情见[<https://github.com/aws-samples/kubernetes-log4j-cve-2021-44228-node-agent>](https://github.com/aws-samples/kubernetes-log4j-cve-2021-44228-node-agent?trk=cndc-detail)
- **MongoDB:DocumentDB**:已完成针对 Log4j2RCE 相关问题的补丁修复
- **Elastic Search**:Amazon OpenSearch Service,已发布修复版本
- **Apache Airflow**:Amazon Managed Workflows for Apache Airflow (MWAA) 已完成针对 Log4j2RCE 相关问题的补丁修复
- **Cassandra**:Amazon Keyspaces (for Apache Cassandra)已完成针对 Log4j2RCE 相关问题的补丁修复
- **Kafka,MSK,** 已完成针对 Log4j2RCE 相关问题的补丁修复
同时,对于基于 Java 开发的应用,如果无法及时升级 Log4J 到修复版本,那么可以考虑使用 Amazon 发布的热修复(不需要重启应用)工具。[<https://aws.amazon.com/blogs/security/open-source-hotpatch-for-apache-log4j-vulnerability/>](https://aws.amazon.com/blogs/security/open-source-hotpatch-for-apache-log4j-vulnerability/?trk=cndc-detail)
5. 参考资料
1. Amazon 针对 Log4JRCE 的说明
[<https://aws.amazon.com/cn/security/security-bulletins/AWS-2021-006/>](https://aws.amazon.com/cn/security/security-bulletins/AWS-2021-006/?trk=cndc-detail)
2. Amazon 针对 Log4JRCE 热补丁指引
[<https://aws.amazon.com/blogs/security/open-source-hotpatch-for-apache-log4j-vulnerability/>](https://aws.amazon.com/blogs/security/open-source-hotpatch-for-apache-log4j-vulnerability/?trk=cndc-detail)
3. Amazon WAF 使用说明
[<https://aws.amazon.com/waf/>](https://aws.amazon.com/waf/?trk=cndc-detail)
4. Log4j 2 官网针对产品安全相关说明
[<https://logging.apache.org/log4j/2.x/security.html>](https://logging.apache.org/log4j/2.x/security.html?trk=cndc-detail)
5. [<https://www.lunasec.io/docs/blog/log4j-zero-day/>](https://www.lunasec.io/docs/blog/log4j-zero-day/?trk=cndc-detail)
6. [<https://aws.amazon.com/cn/blogs/security/using-aws-security-services-to-protect-against-detect-and-respond-to-the-log4j-vulnerability/>](https://aws.amazon.com/cn/blogs/security/using-aws-security-services-to-protect-against-detect-and-respond-to-the-log4j-vulnerability/?trk=cndc-detail)