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

Add rule template assets to cloud_security_posture #3257

Merged
merged 4 commits into from
May 3, 2022

Conversation

eyalkraft
Copy link
Contributor

@eyalkraft eyalkraft commented May 3, 2022

What does this PR do?

Add rule template assets to the integration package

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

Screenshots

Screen Shot 2022-05-03 at 15 33 17

Screen Shot 2022-05-03 at 15 39 35

One of the saved object rule template for example:

{
  "id": "0434fc0b-4b72-5a73-8bee-8c8c40345165",
  "type": "csp-rule-template",
  "namespaces": [],
  "updated_at": "2022-05-03T12:34:34.643Z",
  "version": "WzkxNywxXQ==",
  "attributes": {
    "id": "0434fc0b-4b72-5a73-8bee-8c8c40345165",
    "name": "Ensure that the --profiling argument is set to false (Automated)",
    "profile_applicability": "* Level 1 - Master Node\n",
    "description": "Disable profiling, if not needed.\n",
    "rationale": "Profiling allows for the identification of specific performance bottlenecks. It generates a significant amount of program data that could potentially be exploited to uncover system and program details. If you are not experiencing any bottlenecks and do not need the profiler for troubleshooting purposes, it is recommended to turn it off to reduce the potential attack surface.\n",
    "audit": "Run the following command on the control plane node:\n```\nps -ef | grep kube-apiserver\n```\nVerify that the `--profiling` argument is set to `false`.\n",
    "remediation": "Edit the API server pod specification file\n`/etc/kubernetes/manifests/kube-apiserver.yaml` \non the control plane node and set the below parameter.\n```\n--profiling=false\n```\n",
    "impact": "Profiling information would not be available.\n",
    "default_value": "By default, profiling is enabled.\n",
    "references": "1. [https://kubernetes.io/docs/admin/kube-apiserver/](https://kubernetes.io/docs/admin/kube-apiserver/)\n2. [https://github.com/kubernetes/community/blob/master/contributors/devel/profiling.md](https://github.com/kubernetes/community/blob/master/contributors/devel/profiling.md)\n",
    "section": "API Server",
    "version": "1.0",
    "tags": [
      "CIS",
      "Kubernetes",
      "CIS 1.2.18",
      "API Server"
    ],
    "benchmark": {
      "name": "CIS Kubernetes V1.23",
      "version": "v1.0.0"
    },
    "enabled": true,
    "muted": false,
    "rego_rule_id": "cis_1_2_18"
  },
  "references": [],
  "coreMigrationVersion": "8.3.0"
}

For some reason there are only two concrete rules. This is to be investigated in our Kibana plugin code.

@eyalkraft eyalkraft added the enhancement New feature or request label May 3, 2022
@elasticmachine
Copy link

elasticmachine commented May 3, 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-05-03T12:55:41.306+0000

  • Duration: 15 min 52 sec

Test stats 🧪

Test Results
Failed 0
Passed 1
Skipped 0
Total 1

🤖 GitHub comments

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

  • /test : Re-trigger the build.

@eyalkraft eyalkraft marked this pull request as ready for review May 3, 2022 13:01
@eyalkraft eyalkraft requested a review from a team as a code owner May 3, 2022 13:01
@eyalkraft
Copy link
Contributor Author

@CohenIdo wdyt about only 2 concrete rules created? any ideas?

@eyalkraft eyalkraft requested a review from CohenIdo May 3, 2022 13:02
@elasticmachine
Copy link

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (0/0) 💚
Files 100.0% (0/0) 💚 3.186
Classes 100.0% (0/0) 💚 3.186
Methods 33.333% (1/3) 👎 -54.979
Lines 100.0% (0/0) 💚 11.071
Conditionals 100.0% (0/0) 💚

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.

LGTM

@eyalkraft eyalkraft merged commit 8dd73d6 into elastic:main May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants