Skip to content
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

[Cloud Security] handle both rule.references and rule.reference in misconfiguraiton flyout #195932

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

maxcold
Copy link
Contributor

@maxcold maxcold commented Oct 11, 2024

@maxcold maxcold added v9.0.0 Team:Cloud Security Cloud Security team related backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Cloud-Security Cloud Security related features v8.16.0 labels Oct 11, 2024
title: i18n.translate('xpack.csp.findings.findingsFlyout.ruleTab.referencesTitle', {
defaultMessage: 'References',
}),
description: reference ? <CspFlyoutMarkdown>{reference}</CspFlyoutMarkdown> : EMPTY_VALUE,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the only meaningful change in the returned array is here

@@ -37,6 +37,7 @@ export const cspBenchmarkRuleMetadataSchema = schema.object({
profile_applicability: schema.string(),
rationale: schema.string(),
references: schema.maybe(schema.string()),
reference: schema.maybe(schema.string()),
Copy link
Contributor

@kfirpeled kfirpeled Oct 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a suggestion: maybe it would be simpler to fix it in the ingest pipeline and rely on it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kfirpeled do you mean in the ingest pipeline of cloud_security_posture copy the value of rule.references into rule.reference to be able to remove rule.references completely? We could do that, but as the change to support both is quite small, I thought it would be safer just to support both at first and then depreciate rule.references. Otherwise I need to think how the UI will work out with the older version of the integration, as integration update is not a given when you update the stack version. Am I missing smth?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, you are not missing anything.
However, since we do have automatic updates of the integration, after 24 hours all the misconfigurations will have the updated field. so it shortens your migration process.

both ways work

@maxcold maxcold marked this pull request as ready for review October 14, 2024 09:36
@maxcold maxcold requested a review from a team as a code owner October 14, 2024 09:36
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security)

@maxcold maxcold added the release_note:skip Skip the PR/issue when compiling release notes label Oct 14, 2024
@maxcold maxcold enabled auto-merge (squash) October 14, 2024 10:00
@maxcold maxcold merged commit cc46549 into main Oct 14, 2024
23 checks passed
@maxcold maxcold deleted the csp-handle-rule-reference branch October 14, 2024 11:32
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11326667686

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
cloudSecurityPosture 507.8KB 507.9KB +45.0B

History

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 14, 2024
… in misconfiguraiton flyout (#195932) (#196115)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Cloud Security] handle both rule.references and rule.reference in
misconfiguraiton flyout
(#195932)](#195932)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Maxim
Kholod","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-14T11:31:59Z","message":"[Cloud
Security] handle both rule.references and rule.reference in
misconfiguraiton flyout (#195932)\n\n## Summary\r\n\r\nFixes:\r\n-
https://github.com/elastic/security-team/issues/10793","sha":"cc46549c2f293bed7d24d8b1abf02c4d65db7bcb","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Cloud
Security","backport:prev-minor","Feature:Cloud-Security","v8.16.0"],"title":"[Cloud
Security] handle both rule.references and rule.reference in
misconfiguraiton
flyout","number":195932,"url":"https://github.com/elastic/kibana/pull/195932","mergeCommit":{"message":"[Cloud
Security] handle both rule.references and rule.reference in
misconfiguraiton flyout (#195932)\n\n## Summary\r\n\r\nFixes:\r\n-
https://github.com/elastic/security-team/issues/10793","sha":"cc46549c2f293bed7d24d8b1abf02c4d65db7bcb"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195932","number":195932,"mergeCommit":{"message":"[Cloud
Security] handle both rule.references and rule.reference in
misconfiguraiton flyout (#195932)\n\n## Summary\r\n\r\nFixes:\r\n-
https://github.com/elastic/security-team/issues/10793","sha":"cc46549c2f293bed7d24d8b1abf02c4d65db7bcb"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Maxim Kholod <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Cloud-Security Cloud Security related features release_note:skip Skip the PR/issue when compiling release notes Team:Cloud Security Cloud Security team related v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants