System properties are used a lot here, but it would be good to read these things from the SparkConf that is contained in SparkEnv. Then SecurityManager could just take a conf as a constructor. For the standalone cluster you can just create a new SparkConf() and it will load system properties automatically.