def configure(self, env):
        import params
        env.set_params(params)

        if params.monitor_security_enabled and self.component == 'monitor':
            import os
            import random
            import string

            basedir = Environment.get_instance().config.basedir
            keystore_file = os.path.join(basedir, "files", "keystore.jks")
            truststore_file = os.path.join(basedir, "files", "cacerts.jks")
            cert_file = os.path.join(basedir, "files", "server.cer")

            if os.path.exists(keystore_file) or os.path.exists(
                    truststore_file) or os.path.exists(cert_file):
                self.fail_with_error(
                    "trying to create monitor certs but they already existed")

            goodchars = string.lowercase + string.uppercase + string.digits + '#%+,-./:=?@^_'
            keypass = ''.join(random.choice(goodchars) for x in range(20))
            storepass = ''.join(random.choice(goodchars) for x in range(20))

            https_params = {}
            https_params[params.keystore_property] = params.keystore_path
            https_params[params.truststore_property] = params.truststore_path
            https_params[params.keystore_password_property] = keypass
            https_params[params.truststore_password_property] = storepass

            setup_conf_dir(name=self.component, extra_params=https_params)

            Execute(format(
                "{java64_home}/bin/keytool -genkey -alias \"default\" -keyalg RSA -keypass {keypass} -storepass {storepass} -keystore {keystore_file} -dname \"CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown\""
            ),
                    user=params.accumulo_user)
            Execute(format(
                "{java64_home}/bin/keytool -export -alias \"default\" -storepass {storepass} -file {cert_file} -keystore {keystore_file}"
            ),
                    user=params.accumulo_user)
            Execute(format(
                "echo \"yes\" | {java64_home}/bin/keytool -import -v -trustcacerts -alias \"default\" -file {cert_file} -keystore {truststore_file} -keypass {keypass} -storepass {storepass}"
            ),
                    user=params.accumulo_user)

            accumulo_StaticFile("keystore.jks")
            accumulo_StaticFile("cacerts.jks")

        else:
            setup_conf_dir(name=self.component)
  def configure(self, env):
    import params
    env.set_params(params)

    if params.monitor_security_enabled and self.component == 'monitor':
      import os
      import random
      import string

      basedir = Environment.get_instance().config.basedir
      keystore_file = os.path.join(basedir, "files", "keystore.jks")
      truststore_file = os.path.join(basedir, "files", "cacerts.jks")
      cert_file = os.path.join(basedir, "files", "server.cer")

      if os.path.exists(keystore_file) or os.path.exists(truststore_file) or os.path.exists(cert_file):
        self.fail_with_error("trying to create monitor certs but they already existed")

      goodchars = string.lowercase + string.uppercase + string.digits + '#%+,-./:=?@^_'
      keypass = ''.join(random.choice(goodchars) for x in range(20))
      storepass = ''.join(random.choice(goodchars) for x in range(20))

      https_params = {}
      https_params[params.keystore_property] = params.keystore_path
      https_params[params.truststore_property] = params.truststore_path
      https_params[params.keystore_password_property] = keypass
      https_params[params.truststore_password_property] = storepass

      setup_conf_dir(name=self.component, extra_params=https_params)

      Execute( format("{java64_home}/bin/keytool -genkey -alias \"default\" -keyalg RSA -keypass {keypass} -storepass {storepass} -keystore {keystore_file} -dname \"CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown\""),
               user=params.accumulo_user)
      Execute( format("{java64_home}/bin/keytool -export -alias \"default\" -storepass {storepass} -file {cert_file} -keystore {keystore_file}"),
               user=params.accumulo_user)
      Execute( format("echo \"yes\" | {java64_home}/bin/keytool -import -v -trustcacerts -alias \"default\" -file {cert_file} -keystore {truststore_file} -keypass {keypass} -storepass {storepass}"),
               user=params.accumulo_user)

      accumulo_StaticFile("keystore.jks")
      accumulo_StaticFile("cacerts.jks")

    else:
      setup_conf_dir(name=self.component)
  def configure(self, env):
    import params
    env.set_params(params)

    setup_conf_dir(name='client')
Exemple #4
0
    def configure(self, env):
        import params
        env.set_params(params)

        setup_conf_dir(name=self.component)
Exemple #5
0
 def configure(self, env):
     setup_conf_dir(name=self.component)
  def configure(self, env):
    import params
    env.set_params(params)

    setup_conf_dir(name=self.component)
Exemple #7
0
  def configure(self, env):
    import params
    env.set_params(params)

    setup_conf_dir(name='client')
Exemple #8
0
 def configure(self, env):
     setup_conf_dir(name=self.component)
Exemple #9
0
 def configure(self, env):
     import params
     env.set_params(params)
     install_accumulo()
     setup_conf_dir(name='client')