Showing posts with label JBOSS. Show all posts
Showing posts with label JBOSS. Show all posts

Monday, August 22, 2016

JBOSS Security Password Generator

Ever struggling to generate Encrypted password using JBOSS Security Login Module ??
Here is how you can do it, go to JBOSS_INSTALLATION directory.

Run below command in Unix (some jars are required, locate that and give proper path in below command):
dmodi__Jboss$ java -cp ./DEPLOY_NAME/lib/jboss-common.jar:./DEPLOY_NAME/lib/jboss-jca.jar:./DEPLOY_NAME/lib/jbosssx.jar org.jboss.resource.security.SecureIdentityLoginModule PASSWORD
Encoded password: 5f78dc15b9a559cbdf8592078de921bc


//That's it. You are done with. But do you see any problem here, yes people KNOW what is PASSWORD, when you set this in PRODUCTION environment, where many people were present.
To hide that, you need to write a Shell Script, assume file name is "HidePassword.sh"

vi HidePassword.sh
echo "Enter Password to Encrypt for followed by Enter:"
stty -echo
read pass
stty echo
java -cp ./DEPLOY_NAME/lib/jboss-common.jar:./DEPLOY_NAME/lib/jboss-jca.jar:./DEPLOY_NAME/lib/jbosssx.jar  org.jboss.resource.security.SecureIdentityLoginModule $pass
echo 'Done'

//EXIT now=>   :wq

Run Now:

dmodi__Jboss$    sh HidePassword.sh
Enter Password to Encrypt for followed by Enter:   ( I entered same PASSWORD, but it will not be visible in console)
Encoded password: 5f78dc15b9a559cbdf8592078de921bc
Done


//Now this password you need to put into Databse security Domain files. That you can see in many links. 
For reference:    https://docs.jboss.org/jbosssecurity/docs/6.0/security_guide/html/Encrypting_Data_Source_Passwords.html
=======================END============================


Wednesday, July 30, 2014

Removing JMX Console and EJBInvokerServlet in JBOSS

Removing JMX Console and EJBInvokerServlet in JBOSS

To Remove:
    invoker/EJBInvokerServlet
    invoker/JMXInvokerServlet
From JBOSS Servers for security and VA Scan:

Remove below services(If available): 
JBOSS/server/WEB_COMPONENT_NAME/deploy/           //WEB_COMPONENT_NAME is your web app name
    jmx-console.war
    web-console.war
    http-invoker.sar
    jmx-invoker-adaptor-server.sar   
  
Restart JBoss AS 5.    
Now check the URL: 
http://X.X.X.2:18081/invoker/EJBInvokerServlet
http://X.X.X.2:18081/invoker/JMXInvokerServlet 
http://X.X.X.2:18081/jmx-console/