-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable the Cloud Security Posture Kibana plugin #767
Enable the Cloud Security Posture Kibana plugin #767
Conversation
Maybe this fails because of dependency with this recent change in Elasticsearch? I believe the Elasticsearch SNAPSHOT binaries don't include this change yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please fill in the issue description and link to the original issue?
Please take a look at the build artifacts. It looks like Kibana doesn't support it:
Attaching to elastic-package-stack_kibana_1
�[36mkibana_1 |�[0m [2022-03-30T14:42:56.139+00:00][INFO ][plugins-service] Plugin "metricsEntities" is disabled.
�[36mkibana_1 |�[0m [2022-03-30T14:42:56.207+00:00][FATAL][root] Error: Unknown configuration key(s): "xpack.cloudSecurityPosture.enabled". Check for spelling errors and ensure that expected plugins are installed.
�[36mkibana_1 |�[0m at ensureValidConfiguration (/usr/share/kibana/src/core/server/config/ensure_valid_configuration.js:35:11)
�[36mkibana_1 |�[0m at Server.preboot (/usr/share/kibana/src/core/server/server.js:164:5)
�[36mkibana_1 |�[0m at Root.preboot (/usr/share/kibana/src/core/server/root/index.js:48:14)
�[36mkibana_1 |�[0m at bootstrap (/usr/share/kibana/src/core/server/bootstrap.js:99:9)
�[36mkibana_1 |�[0m at Command.<anonymous> (/usr/share/kibana/src/cli/serve/serve.js:216:5)
�[36mkibana_1 |�[0m
�[36mkibana_1 |�[0m FATAL Error: Unknown configuration key(s): "xpack.cloudSecurityPosture.enabled". Check for spelling errors and ensure that expected plugins are installed.
�[36mkibana_1 |�[0m
Is it generally available in 8.x?
Hey, It's not GA yet (but merged to kibana/main). Kibana 8.2-SNAPSHOT should contain the plugin I believe |
I can confirm that 8.2 stack booted up without issues. That complicates things as we need to support another Kibana config variant. I guess we can help with this one. Sadly Kibana can't ignore unknown configuration properties. Please tell me how urgent is this change as we have other stuff on the board? |
Is this a blocker for merging the integration? If this is not a blocker for merging the integration, We can work with elastic-package just fine configuring the |
Then it's a blocker as correct installation of the integration is required as part of the validation process. If you have spare time to work on this, then please assign us as reviewers. AFAIR here are the required steps:
As we can see, the CI failed already for many steps but succeeded for 8x, as of now it's 8.2.0-SNAPSHOT, which means that it can boot up correctly with the plugin. We just need to strip the entry from the other Kibana config. |
/test |
This reverts commit 1faa0bd.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a small comment around selectStackVersion
. Otherwise, it's ready for shipping. Well done!
internal/stack/variants.go
Outdated
if strings.HasPrefix(version, "8.") { | ||
if len(version) > 2 && (int(version[2])-'0') < 2 { | ||
return "80" | ||
} | ||
return "8x" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that you can also parse the version as a semver version (the library is already used in the project) and check the major and minor. It might be more to catch :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I wasn't too comfortable with this as well.
internal/stack/variants.go
Outdated
@@ -6,20 +6,34 @@ package stack | |||
|
|||
import ( | |||
"fmt" | |||
"strings" | |||
|
|||
"github.com/Masterminds/semver/v3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a small comment, I see you imported the "v3". Is there anything missing in the github.com/Masterminds/semver
as we are using the base release? If not, would you mind switching to that version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I had some trouble finding the correct v1 syntax for the range constraint as it differs from the v3 a bit.
internal/stack/variants.go
Outdated
if strings.HasPrefix(version, "8.") { | ||
return "8x" | ||
if v, err := semver.NewVersion(version); err == nil { | ||
if checkVersion(v, "8.0-0 - 8.1-0") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
much clearer now!
func stackVariantAsEnv(version string) string { | ||
return fmt.Sprintf("STACK_VERSION_VARIANT=%s", selectStackVersion(version)) | ||
} | ||
|
||
func selectStackVersion(version string) string { | ||
if strings.HasPrefix(version, "8.") { | ||
return "8x" | ||
if v, err := semver.NewVersion(version); err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, you can convert these if-conditions into a configurationVariantMap
(key: constraint, value: config variant).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Enable the Cloud Security Posture Kibana plugin by default when using elastic-package.