hadoop未授权访问漏洞

Hadoop 默认开放了很多端口来提供 WebUI 服务,通过访问 NameNode WebUI 管理界面的 50070 端口,可以下载任意文件,所以需要对页面增加访问限制。

修改core-site.xml配置文件,追加以下信息<property>
  <name>hadoop.http.filter.initializers</name>
  <value>org.apache.hadoop.security.AuthenticationFilterInitializer</value>
</property>
<property>
  <name>hadoop.http.authentication.type</name>
  <value>simple</value>
</property>
<property>
  <name>hadoop.http.authentication.token.validity</name>
  <value>3600</value>
</property>
<property>
  <name>hadoop.http.authentication.signature.secret.file</name>
  <value>/home/huser/hadoop/hadoop-http-auth-signature-secret</value>
  <!-- 可动态配置,主从同样配置,并 生成hadoop-http-auth-signature-secret 文件,放到对应位置,内部为允许访问的用户,用user.name=“”访问 -->
</property>
<property>
  <name>hadoop.http.authentication.cookie.domain</name>
  <value></value>
</property>

 

 

ok问题解决了
<property>
  <name>hadoop.http.authentication.simple.anonymous.allowed</name>
  <value>false</value>
</property>:

 

再次访问hadoop页面时需要

posted @ 2020-07-02 20:05  刘亚萌  阅读(5285)  评论(0编辑  收藏  举报