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

[FR] Manage Exceptions in an as-code way #1738

Closed
operatorequals opened this issue Jan 28, 2022 · 8 comments · Fixed by #3407
Closed

[FR] Manage Exceptions in an as-code way #1738

operatorequals opened this issue Jan 28, 2022 · 8 comments · Fixed by #3407
Assignees
Labels
backlog community enhancement New feature or request help wanted Extra attention is needed python Internal python for the repository

Comments

@operatorequals
Copy link

operatorequals commented Jan 28, 2022

related to #3405

Is your feature request related to a problem? Please describe.
We have created a CD pipeline for rules using the CLI tool.
We manage rules as TOML files and deploy them to the SIEM in every git push.
It would be great if we could do the same with the exceptions

Describe the solution you'd like
I would like extra functionality that also manages the Exceptions and Exception List from the CLI kibana subcommand.
Or any documentation on the matter (if this already exists).
I have seen them the TOML [[rule.exceptions_list]] directive is somehow working but I do not know in what extend. Does it support the Exception comment and conditions as well? I tried something like:

[rule]
...
[[rule.exceptions_list]]
id = "<uuid>"
namespace_type = "single"
type = "detection"
list_id = "<another uuid>"

  [[rule.exception_list.comments]]
  comment = "This IP is hosted by... and should excepted "
  created_by = "<me>"

  [[rule.exception_list.entries]]
  field = "agent.hostname"
  operator = "included"
  type = "match_any"
  value = [ "host1", "host2", "host3" ]

  [[rule.exception_list.entries]]
  field = "destination.ip"
  operator = "included"
  type = "match_any"
  value = [ "<ip1", "<ip2>" ]

and didn't work

Describe alternatives you've considered
I have tried adding them as raw Kibana Objects. This didn't work for me.

@operatorequals operatorequals added the enhancement New feature or request label Jan 28, 2022
@botelastic
Copy link

botelastic bot commented Mar 29, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@botelastic botelastic bot added the stale 60 days of inactivity label Mar 29, 2022
@w0rk3r w0rk3r added backlog and removed stale 60 days of inactivity labels Mar 29, 2022
@operatorequals
Copy link
Author

I created a Terraform Provider for Elastic Rules and Exceptions
https://github.com/operatorequals/terraform-provider-elastic-siem#why

@ar3diu
Copy link
Contributor

ar3diu commented Oct 27, 2022

Interested in this as well.
It would be very helpful to use the same detection_rules tool to create and link exceptions to Elastic prebuilt rules.

@Mikaayenson
Copy link
Contributor

Adding a little more context, this method is preferred as it can add exceptions in a structured way vs editing the query. I think to do this correctly, we'd have to do a few things.

Anything else?

@brokensound77
Copy link
Contributor

Parts of this were completed in #3407 - however, since it remains in a feature branch during testing, we can leave the issue open until merged to main (or deemed as not viable)

In the meantime you should check out #3298 for how to use the updates and provide feedback

@slawomirbabicz
Copy link

Managing this and rule actions creates complexity.
I guess any reasonable company want to manage it using github / gitlab and CICD release process after approval.

Codifications of those exception lists in a nice streamlined way would be fantastic to have.

@tsigouris007
Copy link

Managing this and rule actions creates complexity. I guess any reasonable company want to manage it using github / gitlab and CICD release process after approval.

Codifications of those exception lists in a nice streamlined way would be fantastic to have.

Hi @slawomirbabicz ,
based on @operatorequals inspiration I created a native go tf provider that can do this trick for you.
Check it here: https://github.com/tsigouris007/terraform-provider-elastic-siem-detection

@eric-forte-elastic
Copy link
Contributor

With this new feature #3889, exceptions and exceptions lists can now be managed via our CLI for both local and kibana API usage. These commands can also be easily wrapped in the Terraform providers above. If you run into any issues with managing exceptions lists, please re-open the issue or create a new one. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog community enhancement New feature or request help wanted Extra attention is needed python Internal python for the repository
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants