JBOSS安全配置
1、jmx-console登录的用户名和密码设置
默认情况访问http://localhost:8080/jmx-console就可以浏览jboss的部署管理的一些信息,不需要输入用户名和密码,使用起来有点安全隐患。下面我们针对此问题对jboss进行配置,使得访问jmx-console也必须要知道用户名和密码才可进去访问。步骤如下:
(1)找到JBoss安装目录/server/default/deploy/jmx-console.war/WEB-INF/jboss-web.xml文件,去掉<security-domain>java:/jaas/jmx-console</security-domain>的注释。修改后的该文件内容为:
<jboss-web>
<!-- Uncomment the security-domain to enable security. You will
need to edit the htmladaptor login configuration to setup the
login modules used to authentication users.
-->
<security-domain>java:/jaas/jmx-console</security-domain>
</jboss-web>
(2)修改与(1)中的jboss-web.xml同级目录下的web.xml文件,查找到<security-constraint>节点,去掉它的注释,修改后该部分内容为:
<!-- A security constraint that restricts access to the HTML JMX console
to users with the role JBossAdmin. Edit the roles to what you want and
uncomment the WEB-INF/jboss-web.xml/security-domain element to enable
secured access to the HTML JMX console.
-->
<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>
(3) 在第一步中的jmx-console安全域和第二步中的运行角色JBossAdmin都是在login-config.xml中配置,我们在JBoss安装目录/server/default/config下找到它。查找名字为:jmx-console的application-policy:
<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-roles.properties和jmx-console-users.properties文件中设置,分别打开这两个文件。
其中jmx-console-users.properties文件的内容如下:
# A sample users.properties file for use with the UsersRolesLoginModule
admin=admin
该文件定义的格式为:用户名=密码,在该文件中,默认定义了一个用户名为admin,密码为admin的用户,可以自行修改成所需的用户名和密码。
jmx-console-roles.properties的内容如下:
# A sample roles.properties file for use with the UsersRolesLoginModule
admin=JBossAdmin, HttpInvoker
该文件定义的格式为:用户名=角色,多个角色以“,”隔开,该文件默认为admin用户定义了JBossAdmin和HttpInvoker这两个角色。
配置完成后读者可以通过访问:http://localhost:8088/jmx-console/,输入jmx-console-roles.properties文件中定义的用户名和密码,访问jmx-console的页面。
2、web-console登录的用户名和密码设置
默认情况下,用户访问JBoss的web-console时,不需要输入用户名和密码,为了安全起见,我们通过修改配置来为其加上用户名和密码。步骤如下:
(1)找到JBoss安装目录F:\JBoss\server\default\deploy\management\console-mgr.sar\web-console.war\WEB-INF\jboss-web.xml文件,去掉<security-domain>java:/jaas/web-console</security-domain>的注释,修改后的文件内容为:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE jboss-web
PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">
<jboss-web>
<!-- Uncomment the security-domain to enable security. You will
need to edit the htmladaptor login configuration to setup the
login modules used to authentication users.
-->
<security-domain>java:/jaas/web-console</security-domain>
<!-- The war depends on the -->
<depends>jboss.admin:service=PluginManager</depends>
</jboss-web>
(2)修改与(1)中的jboss-web.xml同级目录下的web.xml文件,去掉<security-constraint>部分的注释,修改后的该部分内容为:
<!-- A security constraint that restricts access to the HTML JMX console
to users with the role JBossAdmin. Edit the roles to what you
JBOSS安全配置的更多相关文章
- JBoss/Wildfly 配置SQLserver服务器
JBoss/Wildfly 配置SQLserver服务器 http://blog.csdn.net/haitaolang/article/details/60467118 wildfly standa ...
- jboss jndi配置部分参数详解
使用的是jboss7.1.1, jndi的配置在$JBOSS_HOME/standalone/configuration/standalone.xml中进行配置.配置jndi时有很多参数,解释下用到的 ...
- JBOSS安装配置详细教程
首先在http://jbossas.jboss.org/downloads/下载相关程序我下载的是 JBoss AS 6.1.0.Final 1.配置jboss环境 1.1用户变量path后面添加 ; ...
- Jboss安装配置以及相关的问题
下载地址:(目前最新版本是jboss-as-7.1.1.Final) http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss- ...
- JBOSS 数据源配置并使用JNDI调用
-- 本文出自sleest (感谢yangjj ^_^) 场景分析: 某天系统的数据库维护方要求进行DG备库容灾演练,要把生产用RAC库模拟宕机并转移至DG备库上,由于是failover而不是swit ...
- JBoss 7 配置成windows启动服务
将Jboss7 server 配置成一个windows启动服务的两个文件,部署步骤如下: 1. 先检查是否配置java_home和jboss_home的环境变量,如没配置上先配置,如我的是JBO ...
- Jboss 7配置日志
1. Jboss7配置日志理论知识介绍 Jboss 7日志能够在XML配置文件和日志管理属性文件内配置.默认日志配置在configuration文件夹的logging.properties文件内. 通 ...
- wildfly jboss 优化配置
参考调优:http://www.mastertheboss.com/jboss-server/jboss-performance/jboss-as-7-performance-tuning?showa ...
- 在同一个机器上运行两个jboss修改配置
http://blog.sina.com.cn/s/blog_8ebe17aa0101mnft.html 解决办法:修改 \jboss-4.0.4.GA\server\default\conf 目录下 ...
随机推荐
- hdu Oil Deposits
因为这道题中给的数据比较小,所以可以直接用枚举的方式进行dfs搜索,每出现一个‘@’,就进行一次dfs的搜索,将所有相邻的‘@’全部变成‘*’. #include"iostream" ...
- hdu 最大报销额
本题也是一个背包的问题,我觉得这道题的核心就是根据精确度将浮点型转化为整型然后利用动态规划进行求解,注意对题意的理解,有3种支票是不能够报销的. 我开始照着这个思路进行思考,但是敲出来的第一个代码居然 ...
- 关于 swift 的图片多选问题
http://stackoverflow.com/questions/20756899/how-to-select-multiple-images-from-uiimagepickercontroll ...
- Canvas - 气泡
Main.html <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> & ...
- fastjson格式化bean的简易属性过滤器
fastjson的bean属性过滤器 有的时候,我们在接口开发时,一个完整的bean会包含很多属性,但是前端接口只需要其中的某几个属性时,应该在对json的返回要进行精简.下面直接看代码 packag ...
- Scrum会议10(Beta版本) 补交
组名:天天向上 组长:王森 组员:张政.张金生.林莉.胡丽娜 代码地址:HTTPS:https://git.coding.net/jx8zjs/llk.git SSH:git@git.coding.n ...
- Eclipse问题提示
记录下来以下两种方法: 一.只弹出简单的单词提示(如输入system.的时候自动弹出out.in等字段的那种): 点击eclipse上面的windows --> preferences --&g ...
- linux系统
● ubuntu提示"sudo: unable to resolve host volcano: No such file or directory" 修改/etc/hosts,在 ...
- Apache服务器安装配置
Apache服务器安装 1.Apache服务器安装 在Linux系统下,apache服务器的安装方式比较灵活,可以使用二进制包安装,比如:rpm包.deb包.已编译好的包.也可以简单的使用y ...
- PureBasic—数控编辑框与调节块和进度条
三个有关上下限问题的控件,它们也是主要控件的组成部分,分别为:SpinGadget() 数控编辑框TrackBarGadget() 调节块控件ProgressBarGadget() ...