Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-12124

Security is not support dynamicProperties

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.7.2
    • Fix Version/s: None
    • Component/s: Command Line Client
    • Labels:
      None
    • Docs Text:
      Hide
      Because I have the need to register Kerberos dynamically,
      so I want to use -D or -yD toset "security.kerberos.login.principal" and "security.kerberos.login.keytab",
      but I test it doesn't work,
      I look for the “CliFrontend.main” source code ,
      it only load configuration from flink-conf.yaml.

      “CliFrontend.main” source code:

      https://github.com/apache/flink/blob/master/flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java#L1098

      EnvironmentInformation.logEnvironmentInfo(LOG, "Command Line Client", args);

      // 1. find the configuration directory
      final String configurationDirectory = getConfigurationDirectoryFromEnv();

      // 2. load the global configuration
      final Configuration configuration = GlobalConfiguration.loadConfiguration(configurationDirectory);

      // 3. load the custom command lines
      final List<CustomCommandLine<?>> customCommandLines = loadCustomCommandLines(
      configuration,
      configurationDirectory);

      try {
      final CliFrontend cli = new CliFrontend(
      configuration,
      customCommandLines);

      SecurityUtils.install(new SecurityConfiguration(cli.configuration));
      int retCode = SecurityUtils.getInstalledContext()
      .runSecured(() -> cli.parseParameters(args));
      System.exit(retCode);
      }
      catch (Throwable t) {
      final Throwable strippedThrowable = ExceptionUtils.stripException(t, UndeclaredThrowableException.class);
      LOG.error("Fatal error while running command line interface.", strippedThrowable);
      strippedThrowable.printStackTrace();
      System.exit(31);
      }
      Show
      Because I have the need to register Kerberos dynamically, so I want to use -D or -yD toset "security.kerberos.login.principal" and "security.kerberos.login.keytab", but I test it doesn't work, I look for the “CliFrontend.main” source code , it only load configuration from flink-conf.yaml. “CliFrontend.main” source code: https://github.com/apache/flink/blob/master/flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java#L1098 EnvironmentInformation.logEnvironmentInfo(LOG, "Command Line Client", args); // 1. find the configuration directory final String configurationDirectory = getConfigurationDirectoryFromEnv(); // 2. load the global configuration final Configuration configuration = GlobalConfiguration.loadConfiguration(configurationDirectory); // 3. load the custom command lines final List<CustomCommandLine<?>> customCommandLines = loadCustomCommandLines( configuration, configurationDirectory); try { final CliFrontend cli = new CliFrontend( configuration, customCommandLines); SecurityUtils.install(new SecurityConfiguration(cli.configuration)); int retCode = SecurityUtils.getInstalledContext() .runSecured(() -> cli.parseParameters(args)); System.exit(retCode); } catch (Throwable t) { final Throwable strippedThrowable = ExceptionUtils.stripException(t, UndeclaredThrowableException.class); LOG.error("Fatal error while running command line interface.", strippedThrowable); strippedThrowable.printStackTrace(); System.exit(31); }

      Attachments

        Issue Links

          Activity

            People

            • Assignee:
              ZhenqiuHuang Zhenqiu Huang
              Reporter:
              zhouqi silence
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: