Skip to content

Commit

Permalink
[BeatsCM] Backport bugfixes (#24210, #24209) (#24221)
Browse files Browse the repository at this point in the history
* merge RPM and DEB as they are the same command (#24209)

* [BeatsCM] check for security after license, add support for standard license (#24210)
  • Loading branch information
mattapperson committed Oct 18, 2018
1 parent de08f17 commit 13e5cca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class EnrollBeat extends React.Component<BeatsProps, any> {
<EuiFlexGroup gutterSize="s" alignItems="center">
<EuiFlexItem grow={false}>
<EuiTitle size="xs">
<h3>Select your operating system:</h3>
<h3>Select your platform:</h3>
</EuiTitle>
</EuiFlexItem>
</EuiFlexGroup>
Expand All @@ -149,7 +149,7 @@ export class EnrollBeat extends React.Component<BeatsProps, any> {
options={[
{
value: `sudo ${this.state.beatType}`,
label: 'DEB',
label: 'DEB / RPM',
},
{
value: `PS C:\\Program Files\\${capitalize(this.state.beatType)}> ${
Expand All @@ -161,10 +161,6 @@ export class EnrollBeat extends React.Component<BeatsProps, any> {
value: `./${this.state.beatType}`,
label: 'MacOS',
},
{
value: `sudo ${this.state.beatType}`,
label: 'RPM',
},
]}
onChange={(e: any) => this.setState({ command: e.target.value })}
fullWidth={true}
Expand Down
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 13e5cca

Please sign in to comment.