2 Replies Latest reply on May 19, 2014 1:03 PM by shweta gupta

    Jboss AS 7.0 Encrypting Data Source Passwords

    shweta gupta Newbie

      I'm trying to encrypt my database password using a JBOSS security domain.

      My standalone.xml looks like:

      <datasources>
        
      <datasource jndi-name="java:jboss/datasources/integration-ds" pool-name="integration-ds" enabled="true" use-java-context="true">
        
      <connection-url>jdbc:sqlserver://localhost:1433;DatabaseName=INTEGRATION_DEV;?autoReconnect=true&amp;characterSetResults=UTF-8&amp;characterEncoding=UTF-8&amp;useUnicode=yes</connection-url>
        
      <driver>sqlserver</driver>
        
      <security>
        
      <security-domain>Encrypt</security-domain>
        
      </security>
        
      </datasource>
        
      <drivers>
        
      <driver name="sqlserver" module="com.test.sqlserver">
        
      <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</xa-datasource-class>
        
      </driver>
        
      </drivers>
      </datasources>

      <security-domain name="Encrypt"  cache-type="default">
        
      <authentication>
        
      <login-module code="SecureIdentityLoginModule" flag="required">
        
      <module-option name="username" value="INTEGRATION_DEV"/>
        
      <module-option name="password" value="encrypted-password"/>
        
      </login-module>
        
      </authentication>
      </security-domain>



      When starting Jboss, I am getting the following error:


      Access Denied:Unauthenticated caller:null: java.lang.SecurityException: PB00024: Access Denied:Unauthenticated caller:null at org.jboss.security.plugins.JBossSecuritySubjectFactory.createSubject(JBossSecuritySubjectFactory.java:89) at org.jboss.jca.deployers.common.AbstractDsDeployer$1.run(AbstractDsDeployer.java:1020) at org.jboss.jca.deployers.common.AbstractDsDeployer$1.run(AbstractDsDeployer.java:1015) at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.6.0_45] at org.jboss.jca.deployers.common.AbstractDsDeployer.createSubject(AbstractDsDeployer.java:1014) at org.jboss.jca.deployers.common.AbstractDsDeployer.deployDataSource(AbstractDsDeployer.java:563) at org.jboss.jca.deployers.common.AbstractDsDeployer.createObjectsAndInjectValue(AbstractDsDeployer.java:283) at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer.deploy(AbstractDataSourceService.java:271) at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.start(AbstractDataSourceService.java:111) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45] at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]



      On https://issues.jboss.org/browse/AS7-1072 , the issue is marked as resolve but fixed versions are not mentioned. I wanted to know as for which version of Jboss AS the issue is resolved?