11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<Context >
3- <!-- BAD: Password of datasource is not encrypted -->
4- <Resource name =" jdbc/exampleDS1" auth =" Container" type =" javax.sql.DataSource" maxTotal =" 100" maxIdle =" 30" maxWaitMillis =" 10000" username =" root" password =" 1234" driverClassName =" com.mysql.jdbc.Driver" url =" jdbc:mysql://www.example1.com:3306/proj" />
3+ <!-- BAD: Password of datasource is in not encrypted -->
4+ <Resource name =" jdbc/exampleDS1" auth =" Container" type =" javax.sql.DataSource"
5+ maxTotal=" 100" maxIdle =" 30" maxWaitMillis =" 10000"
6+ username=" root" password =" 1234"
7+ driverClassName=" com.mysql.jdbc.Driver"
8+ url=" jdbc:mysql://www.example1.com:3306/proj" />
59
6- <!-- GOOD: Password is encrypted and stored in a password vault -->
7- <Resource name =" jdbc/exampleDS2" auth =" Container" type =" javax.sql.DataSource" maxTotal =" 100" maxIdle =" 30" maxWaitMillis =" 10000" username =" root" password =" ${VAULT::exampleDS2::password::N2NhZDYzOTMtNWE0OS00ZGQ0LWE4MmEtMWNlMDMyNDdmNmI2TElORV9CUkVBS3ZhdWx0}" driverClassName =" com.mysql.jdbc.Driver" url =" jdbc:mysql://www.example2.com:3306/proj" />
10+ <!-- GOOD: Password is encrypted and stored in a password vault -->
11+ <Resource name =" jdbc/exampleDS2" auth =" Container" type =" javax.sql.DataSource"
12+ maxTotal=" 100" maxIdle =" 30" maxWaitMillis =" 10000"
13+ username=" root" password =" ${VAULT::exampleDS2::password::N2NhZDYzOTMtNWE0OS00ZGQ0LWE4MmEtMWNlMDMyNDdmNmI2TElORV9CUkVBS3ZhdWx0}"
14+ driverClassName=" com.mysql.jdbc.Driver"
15+ url=" jdbc:mysql://www.example2.com:3306/proj" />
816
9- <!-- GOOD: Password is not stored in the configuration file -->
10- <Resource name =" jdbc/exampleDS3" auth =" Container" type =" javax.sql.DataSource" maxTotal =" 100" maxIdle =" 30" maxWaitMillis =" 10000" username =" root" password =" ${jdbc.password}" driverClassName =" com.mysql.jdbc.Driver" url =" jdbc:mysql://www.example3.com:3306/proj" />
17+ <!-- GOOD: Password is not stored in the configuration file -->
18+ <Resource name =" jdbc/exampleDS3" auth =" Container" type =" javax.sql.DataSource"
19+ maxTotal=" 100" maxIdle =" 30" maxWaitMillis =" 10000"
20+ username=" root" password =" ${jdbc.password}"
21+ driverClassName=" com.mysql.jdbc.Driver"
22+ url=" jdbc:mysql://www.example3.com:3306/proj" />
1123
12- <!-- GOOD: Password is encrypted -->
13- <Resource name =" jdbc/exampleDS4" auth =" Container" type =" javax.sql.DataSource" maxTotal =" 100" maxIdle =" 30" maxWaitMillis =" 10000" username =" root" password =" Tg2Nn7wUZOQ6Xc+1lenkZTQ9ZDf9a2/RBRiqJBCIX6o=" driverClassName =" com.mysql.jdbc.Driver" url =" jdbc:mysql://www.example4.com:3306/proj" />
14-
15- </Context >
24+ <!-- GOOD: Password is encrypted -->
25+ <Resource name =" jdbc/exampleDS4" auth =" Container" type =" javax.sql.DataSource"
26+ maxTotal=" 100" maxIdle =" 30" maxWaitMillis =" 10000"
27+ username=" root" password =" Tg2Nn7wUZOQ6Xc+1lenkZTQ9ZDf9a2/RBRiqJBCIX6o="
28+ driverClassName=" com.mysql.jdbc.Driver"
29+ url=" jdbc:mysql://www.example4.com:3306/proj" />
30+ </Context >
0 commit comments