File tree Expand file tree Collapse file tree 1 file changed +0
-16
lines changed Expand file tree Collapse file tree 1 file changed +0
-16
lines changed Original file line number Diff line number Diff line change @@ -19,23 +19,7 @@ class CheckGroupDatabase extends CheckGroup {
1919 const config = Config . get ( Parse . applicationId ) ;
2020 const databaseAdapter = config . database . adapter ;
2121 const databaseUrl = databaseAdapter . _uri ;
22- const MongoClient = require ( 'mongodb' ) . MongoClient ;
2322 return [
24- new Check ( {
25- title : `Database requires authentication` ,
26- warning : 'Database requires no authentication to connect which allows anyone to connect and potentially access data.' ,
27- solution : 'Change database access settings.' ,
28- check : async ( ) => {
29- try {
30- const urlWithoutCredentials = databaseUrl . replace ( / \/ \/ ( \S + : \S + ) @ / , '//' ) ;
31- const client = await MongoClient . connect ( urlWithoutCredentials , { useNewUrlParser : true } ) ;
32- await client . db ( "admin" ) . command ( { ping : 1 } ) ;
33- throw 1 ;
34- } catch {
35- return ;
36- }
37- } ,
38- } ) ,
3923 new Check ( {
4024 title : 'Secure database password' ,
4125 warning : 'The database password is insecure and vulnerable to brute force attacks.' ,
You can’t perform that action at this time.
0 commit comments