| 网站首页 | 测试咨讯 | 新手入门 | 专注性能 | 测试技术 | 测试管理 | 测试工具 | 开发社区 | 工具下载 | 资料下载 | 测试论坛 | 

[CNTester联盟群]交流群:34446273/21968356/64461572 白盒群:18400216 自动化群:2706508 性能群:4498858 外包群:59649884 管理群(需有管理经验):64442523

新手入门
 入门指南
 经验之谈
测试咨讯
 行业新闻
 网站动态
 人才就业
 CNTester基金
 标准规范
专注性能
 性能测试知识
 性能测试工具
 程序设计性能
 数据库性能
 Web应用服务器性能
 操作系统性能
 服务器与网络性能
测试技术
 用例设计
 性能测试
 自动化测试
 Web测试
 面向对象测试
 综合技术
 阶段性测试
 行业类测试
测试管理
 项目管理
 项目案例
 质量管理
 软件过程
测试工具
 Mercury系列
 Rational系列
 测试管理工具
 性能测试工具
 功能测试工具
 单元测试工具
 其它测试工具
开发社区
 Java技术
 DotNet技术
 C技术
 数据库技术
 操作系统
 服务器与中间件
工具下载
 测试工具
 开发工具
 企业工程
 网络通信
 媒体桌面
 游戏娱乐
 其他工具
资料下载
 测试资料
 程序设计
 数据库
 操作系统
 应用服务器
 电子期刊
 其他资料
 
 
您现在的位置: 中国测试员网站 >> 开发社区 >> 服务器与中间件 >> 文章正文
  Jboss安全性配置           ★★★ 【字体:
Jboss安全性配置
作者:未知    文章来源:未知    点击数:    更新时间:2007-10-18    

jboss默认配置了以下服务:
JMX Console
JBoss Web Console
为了安全起见,需要用户通过授权进行访问。
一、JMX安全配置
STEP 1:
    找到%JBOSS_HOME%/server/default/deploy/jmx-console.war/WEB-INF/jboss-web.xml文件,根据说明,去掉注释。

 

<jboss-web>  
   <security-domain>java:/jaas/jmx-console</security-domain>  
</jboss-web>  
STEP 2:
    与jboss-web.xml同级目录下还有一个文件web.xml,找到其中的节点,根据说明,取消注释。

<security-constraint>  
     <web-resource-collection>  
       <web-resource-name>HtmlAdaptor</web-resource-name>  
       <description>An example security config that only allows users with the   
         role JBossAdmin to access the HTML JMX console web application   
       </description>  
       <url-pattern>/*</url-pattern>  
       <http-method>GET</http-method>  
       <http-method>POST</http-method>  
     </web-resource-collection>  
     <auth-constraint>  
       <role-name>JBossAdmin</role-name>  
     </auth-constraint>  
</security-constraint>  
STEP 3:
    在第一步中的jmx-console安全域和第二步中的运行角色JBossAdmin都是在login-config.xml中配置,我们在%

<application-policy name = "jmx-console">  
       <authentication>  
          <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"  
             flag = "required">  
           <module-option name="usersProperties">props/jmx-console-users.properties</module-option>  
           <module-option name="rolesProperties">props/jmx-console-roles.properties</module-option>  
          </login-module>  
       </authentication>  
    </application-policy>  

文件props/jmx-console-users.properties定义了用户名、密码;props/jmx-console-roles.properties定义了用户所属角色

注:
jmx-console-users.properties 格式是:用户名=密码明文
jmx-console-roles.properties 格式是:用户名=角色1,角色2,角色3

二、WEB-CONSOLE的安全配置
STEP 1:
找到%JBOSS_HOME%/server/default/deploy/ management/console-mgr.sar/web-console.war/WEB-INF/jboss-web.xml文件,根据说明,去掉注释。

<jboss-web>  
   <depends>jboss.admin:service=PluginManager</depends>  
</jboss-web>
STEP 2:
与jboss-web.xml同级目录下还有一个文件web.xml,找到其中的节点,根据说明,取消注释。

<security-constraint>  
   <web-resource-collection>  
   <web-resource-name>HtmlAdaptor</web-resource-name>  
   <description>An example security config that only allows users with the   
   role JBossAdmin to access the HTML JMX console web application   
   </description>  
   <url-pattern>/*</url-pattern>  
   <http-method>GET</http-method>  
   <http-method>POST</http-method>  
   </web-resource-collection>  
   <auth-constraint>  
   <role-name>JBossAdmin</role-name>  
   </auth-constraint>  
   </security-constraint>  

STEP 3:
在本目录的classes文件夹下找到web-console-users.properties和web-console-roles.properties两个文件更名为:

<application-policy name = "web-console">  
       <authentication>  
          <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"  
             flag = "required">  
             <module-option name="usersProperties">users.properties</module-option>  
             <module-option name="rolesProperties">roles.properties</module-option>  
          </login-module>  
       </authentication>  
</application-policy>  
启动服务输入http://localhost:8080/
 然后分别点击JMX Console以及Jboss Web Console测试安全机制

user.properties和role.propertie并修改users.properties其中的用户名和密码修改%JBOSS_HOME%/server/default/conf/login-config.xml中web-console节点修改为以下:
到后自行修改或重新定义用户名、密码。JBOSS_HOME%/server/default/config下找到它。查找名字为:jmx-console的application-policy:

============================================================================

8.10. How to Secure the JBoss Server

JBoss comes with several admin access points that need to be secured or removed to prevent unauthorized access to administrative functions in a deployment. This section describes the various admin services and how to secure them.

8.10.1. The JMX Console

The jmx-console.war found in the deploy directory provides an html view into the JMX microkernel. As such, it provides access to arbitrary admin type access like shutting down the server, stopping services, deploying new services, etc. It should either be secured like any other web application, or removed.

8.10.2. The Web Console

The web-console.war found in the deploy/management directory is another web application view into the JMX microkernel. This uses a combination of an applet and a HTML view and provides the same level of access to admin functionality as the jmx-console.war. As such, it should either be secured or removed. The web-console.war contains commented out templates for basic security in its WEB-INF/web.xml as well as commented out setup for a security domain in WEB-INF/jboss-web.xml.

8.10.3. The HTTP Invokers

The http-invoker.sar found in the deploy directory is a service that provides RMI/HTTP access for EJBs and the JNDI Naming service. This includes a servlet that processes posts of marshalled org.jboss.invocation.Invocation objects that represent invocations that should be dispatched onto the MBeanServer. Effectively this allows access to MBeans that support the detached invoker operation via HTTP since one could figure out how to format an appropriate HTTP post. To security this access point you would need to secure the JMXInvokerServlet servlet found in the http-invoker.sar/invoker.war/WEB-INF/web.xml descriptor. There is a secure mapping defined for the /restricted/JMXInvokerServlet path by default, one would simply have to remove the other paths and configure the http-invoker security domain setup in the http-invoker.sar/invoker.war/WEB-INF/jboss-web.xml descriptor.

8.10.4. The JMX Invoker

The jmx-invoker-adaptor-server.sar is a service that exposes the JMX MBeanServer interface via an RMI compatible interface using the RMI/JRMP detached invoker service. The only way for this service to be secured currently would be to switch the protocol to RMI/HTTP and secure the http-invoker.sar as described in the previous section. In the future this service will be deployed as an XMBean with a security interceptor that supports role based access checks.


 

文章录入:root    责任编辑:root 
  • 上一个文章:

  • 下一个文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
     
    最新热点 最新推荐 相关文章
    · 面向对象设计与编程核心技术
    · Tomcat系统安全管理与权限管理
    · 雅虎公司C#笔试题
    · 利用Java事件处理机制实现录制、回放功能
    · apache+tomcat+mysql负载均衡和集群
    · Linux 指令大全
    · 应用服务器内存泄露问题诊断一例
    · 追求代码质量: 软件架构的代码质量
    · 对话 UNIX
    · 关于一些算法问题与朋友的讨论
    · 对话 UNIX
    · nmon 性能:分析 AIX 和 Linux 性能的免费
    · 追求代码质量: 谨防紧密耦合!
    · 应用服务器内存泄露问题诊断一例
    · Linux 指令大全
    · C 编程最佳实践
    · LPI 证书 101 考试准备,第2部分 [正则表
    · LPI 证书 101 考试准备,第1 部分 [使用L
    · Linux 究竟是什么?
    · 利用Java事件处理机制实现录制、回放功能
    Tomcat系统安全管理与权限管
     
     
     
    ======> [CNTester联盟群]交流群:34446273/21968356/64461572 白盒群:18400216 自动化群:2706508 性能群:4498858 外包群:59649884 管理群(需有管理经验):64442523
    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 管理登录 | 

    Copyright@2007 by CNTester.com 中国测试员网站 桂ICP备07005590

    本站为开源免费网站,非商业赢利性组织。本站文章部分从网络搜索获取,如果您认为某些侵犯了您的权益,麻烦您联系本站,我们会尽快删除相关内容,同时也希望您的谅解,我们的初衷是为了让更多人去学习这方面的知识,让行业有更好的发展。

    联系电话: 15021358905