Skip to content

Commit

Permalink
[BeatsCM] check for security after license, add support for standard …
Browse files Browse the repository at this point in the history
…license (elastic#24210)
  • Loading branch information
mattapperson authored Oct 18, 2018
1 parent 46d1a81 commit 612bd74
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,25 +115,13 @@ export class KibanaBackendFrameworkAdapter implements BackendFrameworkAdapter {
};
}

const VALID_LICENSE_MODES = ['trial', 'gold', 'platinum'];
const VALID_LICENSE_MODES = ['trial', 'standard', 'gold', 'platinum'];

const isLicenseValid = xPackInfo.license.isOneOf(VALID_LICENSE_MODES);
const isLicenseActive = xPackInfo.license.isActive();
const licenseType = xPackInfo.license.getType();
const isSecurityEnabled = xPackInfo.feature('security').isEnabled();

// Security is not enabled in ES
if (!isSecurityEnabled) {
const message =
'Security must be enabled in order to use Beats centeral management features.' +
' Please set xpack.security.enabled: true in your elasticsearch.yml.';
return {
securityEnabled: false,
licenseValid: true,
message,
};
}

// License is not valid
if (!isLicenseValid) {
return {
Expand All @@ -152,6 +140,18 @@ export class KibanaBackendFrameworkAdapter implements BackendFrameworkAdapter {
};
}

// Security is not enabled in ES
if (!isSecurityEnabled) {
const message =
'Security must be enabled in order to use Beats centeral management features.' +
' Please set xpack.security.enabled: true in your elasticsearch.yml.';
return {
securityEnabled: false,
licenseValid: true,
message,
};
}

// License is valid and active
return {
securityEnabled: true,
Expand Down

0 comments on commit 612bd74

Please sign in to comment.