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 Posture] Remove runtime_cfg var #4496

Merged
merged 11 commits into from
Nov 8, 2022

Conversation

ofiriro3
Copy link
Contributor

@ofiriro3 ofiriro3 commented Oct 25, 2022

What does this PR do?

The following PR removes the usage of runtime_cfg and moves the configuration to be generated per kubernetes deployment using the hbs files

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

# Conflicts:
#	packages/cloud_security_posture/changelog.yml
#	packages/cloud_security_posture/manifest.yml
@ofiriro3 ofiriro3 added 8.6 candidate Team:Cloud Security Label for the Cloud Security team labels Oct 25, 2022
@@ -11,7 +11,7 @@ categories:
- kubernetes
- security
conditions:
kibana.version: "^8.5.0"
kibana.version: "^8.6.0"
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

I think this change is necessary here since it's a breaking change.

WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree

@ofiriro3 ofiriro3 marked this pull request as ready for review October 25, 2022 14:30
@ofiriro3 ofiriro3 requested a review from a team as a code owner October 25, 2022 14:30
@elasticmachine
Copy link

elasticmachine commented Oct 25, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-11-07T07:47:02.081+0000

  • Duration: 19 min 20 sec

Test stats 🧪

Test Results
Failed 0
Passed 2
Skipped 0
Total 2

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented Oct 25, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (0/0) 💚
Files 100.0% (0/0) 💚 2.694
Classes 100.0% (0/0) 💚 2.694
Methods 25.0% (1/4) 👎 -66.012
Lines 100.0% (0/0) 💚 8.422
Conditionals 100.0% (0/0) 💚

runtimeCfg:
activated_rules:
cis_eks:
- cis_3_1_4
Copy link
Contributor

Choose a reason for hiding this comment

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

I might be wrong but I think you're missing indentation 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.

It also works this way, but I'll change the indentation to be aligned with the original format

activated_rules:
cis_eks:
- cis_3_1_4
- cis_5_4_5
Copy link
Contributor

Choose a reason for hiding this comment

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

do you mind sorting all the rules? it could be really helpful for scanning the list

@@ -11,7 +11,7 @@ categories:
- kubernetes
- security
conditions:
kibana.version: "^8.5.0"
kibana.version: "^8.6.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree

Copy link
Contributor

@kfirpeled kfirpeled left a comment

Choose a reason for hiding this comment

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

We should remove the declaration of runtimeCfg - otherwise it will still be present in the UI

@ofiriro3
Copy link
Contributor Author

We should remove the declaration of runtimeCfg - otherwise it will still be present in the UI

I am not sure that I understand what you meant. RuntimeCfg only appears in the .hbs files, so the rule configuration will be under runTimeConfig. Can you elaborate ?

@kfirpeled
Copy link
Contributor

We should remove the declaration of runtimeCfg - otherwise it will still be present in the UI

I am not sure that I understand what you meant. RuntimeCfg only appears in the .hbs files, so the rule configuration will be under runTimeConfig. Can you elaborate ?

Did you check it doesn't appear in the fleet UI? while editing/adding kspm integration

{{runtimeCfg}}
{{/if}}

runtimeCfg:
Copy link
Contributor

Choose a reason for hiding this comment

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

looking at cloudbeat tests I believe the key is runtime_cfg.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, I only caught it when I run the E2E test

@ofiriro3
Copy link
Contributor Author

ofiriro3 commented Nov 6, 2022

Finish working on this one - it is blocked until we will deal with the forward-compatible mechanism

@olegsu
Copy link
Contributor

olegsu commented Nov 7, 2022

Finish working on this one - it is blocked until we will deal with the forward-compatible mechanism
What is the forward compatibility issue here?

It's more a deprecation of a feature, not changes in the structure, right?

@kfirpeled kfirpeled changed the title Remove data yaml [Cloud Posture] Remove runtime_cfg var Nov 7, 2022
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "1.0.6"
changes:
- description: Removing the rule data yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- description: Removing the rule data yaml
- description: Removed `runtime_cfg` variable

@ofiriro3 ofiriro3 merged commit 92ceebb into elastic:main Nov 8, 2022
@ofiriro3
Copy link
Contributor Author

ofiriro3 commented Nov 9, 2022

/test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.6 candidate Team:Cloud Security Label for the Cloud Security team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants