JBOSS Security

JBOSS SERVER GÜVENLİK AYARLARI

Günümüzde yazılım uygulamalarını local ortamdan canlı ortama geçirirken uygulama sunucularının standart ayarlarını değiştirmeden taşıdığımızda, uygulama dış tehditlere karşı açık kalır, yazımızda bu tehditlere karşı nasıl korunabiliriz, hangi güvenlik ayarlarını yapmalıyız, temel başlıklar altında inceleyeceğiz.

1.Securing jmx-console

Jmx –console web arayüzünden uygulamayı yönetme aracıdır. Güvenlik ayarları yapılmadıgında tehdit oluştaracak konular; yeni uygulamalar yüklenebilir, mevcut uygulama silinebilir. Bu yüzden bu web arayüzünü şifreyle korumak önemlidir. Güvenlik için önemli bir adımdır.

Yapılması gerekenler dosya dizinleri ve değiştirilmesi gereken dosyalarla aşağıda belirtilmiştir.

Dosya Dizin:/apps/jboss-4.2.3.GA/server/jboos_home /conf/props

Dosya:jmx-console-roles.properties (modified)

Açıklama: kullanıcı ve rol bilgilerini çeren dosyadır, dosyadaki default değerler ve update edlimiş değerler aşağıda belirtilmiştir.

Default:

admin=JBossAdmin,HttpInvoker

Modified: xxAdmin diye belirttiğimiz rol ismini kendiniz belirleyiniz.

xxAdmin=JBossAdmin,HttpInvoker

Dosya Dizin://apps/jboss-4.2.3.GA/server/it4em/deploy/jmx-console.war/WEB-INF

Dosya: jboss-web.xml (modified)

Açıklama : Login içinde böyle bir configirasyon vardır, User ve rolleri nereden alacagını gösterir.

<security-domain>java:/jaas/jmx-console</security-domain>

// Yukardaki ifade default commentlenmiş gelir ve commenti açılmalıdır.

Dosya: web.xml (modified, GET and POST methods comment out)

<!-<http-method>GET</http-method>->

<!-<http-method>POST</http-method>->

//Yukardaki ifade commentlenir, Son zamanlarda açık kaynak kod uygulama sunucularında belirlenen http metodlarını kullanarak yapılan atakları engellemek adına yapılmıştır. Güvenlik bütün http metodlarına uygulanmıştır.

Jmx- console güvenliği ile ilgili ayrıntılı bilgiye ulaşmak için aşağıdaki linklerin okunması tavsiye edilir.

http://java.dzone.com/articles/jboss-jmx-console

http://threatpost.com/en_us/blogs/jboss-worm-exploiting-old-bug-infect-unpatched-servers-102111

2.Securing web-console

Web-console istatistiklerin görülebildiği araçtır. Uygulama için tehlike arz etmez fakat içerdiği bilgiler şirket için önem arz edebilir.

Dosya Dizin:/apps/jboss-4.2.3.GA/server/it4em/conf/props

Dosya:web-console-roles.properties // Bu dosya yeni yaratılır ve içeriği aşagıdaki gibi olmalıdır

xxAdmin=JBossAdmin

Dosya:web-console-users.properties // Bu dosya da yeni eklenecektir. Admin şifrenizi kendiniz belirleyeceksiniz.

xxAdmin =sifre

Dosya Dizin:/apps/jboss-4.2.3.GA/server/it4em/deploy/management/console-mgr.sar/web-console.war/WEB-INF

Dosya: jboss-web.xml (modified)

<security-domain>java:/jaas/web-console</security-domain>

//Yukardaki ifade comment açılmalıdır.

Dosya: web.xml (modified)

<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 web console

</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>

//Yukarda belirtilen ifadenin Commenti açılmalıdır.

3.Securing jbossws

Dosya Dizin:/apps/jboss-4.2.3.GA/server/it4em/conf/props

Dosya:jbossws-roles.properties (modified)

kermit=friend

xxAdmin=friend

Dosya: jbossws-users.properties (modified)

xxAdmin =şifre

kermit=thefrog

Dosya Dizin: /apps/jboss-4.2.3.GA/server/it4em/deploy/jbossws.sar/jbossws-management.war/WEB-INF

Dosya: jboss-web.xml (modified)

<security-constraint>

<web-resource-collection>

<web-resource-name>ContextServlet</web-resource-name>

<description>An example security config that only allows users with the role ‘friend’ to access the JBossWS 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>friend</role-name>

</auth-constraint>

</security-constraint>

// Yukardaki ifadenin commenti açılmalıdır.

Dosya: web.xml (modified),

GET and POST methods commentlenir.

4.Securing invokers

Dosya Dizin:/apps/jboss-4.2.3.GA/server/it4em/deploy/http-invoker.sar/invoker.war/WEB-INF

Dosya:jboss-web.xml

<http-method>GET</http-method>

<http-method>POST</http-method>

//Yukarıdaki ifade commentlendi.

Dosya: web.xml

<jboss-web>

<security-domain>java:/jaas/jmx-console</security-domain>

</jboss-web>

//Yukarıdaki ifade commentlendi.

Konu hakkında ayrıntılı bilgiye ulaşmak için aşağıdaki linkin okunması tavsiye edilir.

http://docs.jboss.org/jbossas/docs/Server_Configuration_Guide/4/html/How_to_Secure_the_JBoss_Server-The_HTTP_Invokers.html

5.Securing status servlet

Dosya Dizin: /apps/jboss-4.2.3.GA/server/it4em/deploy/jboss-web.deployer/ROOT.war/WEB-INF

Dosya: web.xml (modified)

<security-constraint>

<web-resource-collection>

<web-resource-name>Status Servlet</web-resource-name>

<description>An example security config that only allows users with the role JBossAdmin to access status servlet

</description>

<url-pattern>/status</url-pattern>

<http-method>GET</http-method>

<http-method>POST</http-method>

</web-resource-collection>

<auth-constraint>

<role-name>TomcatStatus</role-name>

</auth-constraint>

</security-constraint>

<login-config>

<auth-method>BASIC</auth-method>

<realm-name>tomcat-status</realm-name>

</login-config>

<security-role>

<role-name>TomcatStatus</role-name>

</security-role>

Dosya:jboss-web.xml // Bu dosya yeni eklenmiştir ve aşağıdaki ifadeyle doldurulmalıdır.

<jboss-web>

<security-domain>java:/jaas/tomcat-status</security-domain>

</jboss-web>

Dosya Dizin:/apps/jboss-4.2.3.GA/server/it4em/conf/props

Dosya: tomcat-status-users.properties // Bu dosya yukarda belirtilmiş olan dizinde yaratılmalıdır. İçeriği aşagıda belirttiğimiz gibi olmalıdır.

# A sample users.properties file for use with the UsersRolesLoginModule

xxAdmin=şifre

Dosya: tomcat-status-roles.properties // Bu dosya belirtilen dizinde yaratılmalıdır.

# A sample roles.properties file for use with the UsersRolesLoginModule

xxAdmin=TomcatStatus

Dosya Dizin:/apps/jboss-4.2.3.GA/server/it4em/conf/

Dosya:login-config.xml (modified)

<application-policy name = “web-console”>

<authentication>

<login-module code=”org.jboss.security.auth.spi.UsersRolesLoginModule”

flag = “required”>

<module-option name=”usersProperties”>props/web-console-users.properties</module-option>

<module-option name=”rolesProperties”>props/web-console-roles.properties</module-option>

</login-module>

</authentication>

</application-policy>

<application-policy name = “tomcat-status”>

<authentication>

<login-module code=”org.jboss.security.auth.spi.UsersRolesLoginModule”

flag = “required”>

<module-option name=”usersProperties”>props/tomcat-status- users.properties</module-option>

<module-option name=”rolesProperties”>props/tomcat-status-roles.properties</module-option>

</login-module>

</authentication>

</application-policy>

Aşagıdaki link bu konu hakkında ayrıntılı bilgiye ulaşmak için okunması tavsiye edilir.

http://davidghedini.blogspot.com/2011/03/install-jboss-51-on-centos.html