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

[Enhancement]: Add EKS Runtime monitoring to Guard Duty #32949

Closed
be-aws-architect opened this issue Aug 10, 2023 · 8 comments · Fixed by #31463
Closed

[Enhancement]: Add EKS Runtime monitoring to Guard Duty #32949

be-aws-architect opened this issue Aug 10, 2023 · 8 comments · Fixed by #31463
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/guardduty Issues and PRs that pertain to the guardduty service.
Milestone

Comments

@be-aws-architect
Copy link

Description

Guard Duty now supports EKS Runtime monitoring, but it is not configurable in Terraform at the moment.

Affected Resource(s) and/or Data Source(s)

  • aws_guardduty_detector
  • aws_guardduty_organization_configuration

Potential Terraform Configuration

It currently allows EKS Audit Logs in the format

resource "aws_guardduty_detector" "MyDetector" {
  enable = true

  datasources {
    s3_logs {
      enable = true
    }
    kubernetes {
      audit_logs {
        enable = false
      }
    }


It would look like 

resource "aws_guardduty_detector" "MyDetector" {
  enable = true

  datasources {
    s3_logs {
      enable = true
    }
    kubernetes {
      audit_logs {
        enable = true
      }
      runtime {
       enabled = true
    }

References

https://docs.aws.amazon.com/guardduty/latest/ug/guardduty-eks-runtime-monitoring.html

Would you like to implement a fix?

None

@be-aws-architect be-aws-architect added the enhancement Requests to existing resources that expand the functionality or scope. label Aug 10, 2023
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/guardduty Issues and PRs that pertain to the guardduty service. label Aug 10, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Aug 10, 2023
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Aug 10, 2023
@autarchprinceps
Copy link

This should probably also include not just the runtime, but also the runtime agent deployment:
image

@andrew-ar
Copy link

As EKS Runtime Monitoring is an EKS add-on, I'm wondering if the deployment of the runtime agent would be done by using the existing aws_eks_addon resource? It looks like that's designed in a pretty generic way so maybe it won't need changes.

That said, it would be helpful to have a bit of documentation on how to configure the monitoring agent, as it seems like there are at least a few config options and it would be good to have an example. Perhaps the config would sit under the aws_guardduty_organization_configuration resource, or perhaps some might end up under aws_eks_addon, it would be good to understand where it would go and what it would look like.

@macmiranda
Copy link

As EKS Runtime Monitoring is an EKS add-on, I'm wondering if the deployment of the runtime agent would be done by using the existing aws_eks_addon resource? It looks like that's designed in a pretty generic way so maybe it won't need changes.

That said, it would be helpful to have a bit of documentation on how to configure the monitoring agent, as it seems like there are at least a few config options and it would be good to have an example. Perhaps the config would sit under the aws_guardduty_organization_configuration resource, or perhaps some might end up under aws_eks_addon, it would be good to understand where it would go and what it would look like.

The add-on needs to be enabled for the agent to gather events and send them to Guardduty but the Guardduty feature needs to be enabled nevertheless.

Example CLI command:

aws guardduty update-detector --detector-id 12abc34d567e8fa901bc2d34e56789f0 --acount-ids 555555555555 --features '[{"Name" : "EKS_RUNTIME_MONITORING", "Status" : "ENABLED", "AdditionalConfiguration" : [{"Name" : "EKS_ADDON_MANAGEMENT", "Status" : "DISABLED"}] ]'

@autarchprinceps
Copy link

As EKS Runtime Monitoring is an EKS add-on, I'm wondering if the deployment of the runtime agent would be done by using the existing aws_eks_addon resource? It looks like that's designed in a pretty generic way so maybe it won't need changes.

That said, it would be helpful to have a bit of documentation on how to configure the monitoring agent, as it seems like there are at least a few config options and it would be good to have an example. Perhaps the config would sit under the aws_guardduty_organization_configuration resource, or perhaps some might end up under aws_eks_addon, it would be good to understand where it would go and what it would look like.

No, that is something else. This is the org wide auto enablement of the deployment of that EKS addon and is a guardduty setting. You can of course manually deploy it, but that is not what we are talking about here.

@ewbankkit
Copy link
Contributor

You will be able to use the upcoming aws_guardduty_detector_feature resource (#31463):

resource "aws_guardduty_detector" "example" {
  enable = true
}

resource "aws_guardduty_detector_feature" "example" {
  detector_id = aws_guardduty_detector.example.id
  name        = "EKS_RUNTIME_MONITORING"
  status      = "ENABLED"

  additional_configuration {
    name   = "EKS_ADDON_MANAGEMENT"
    status = "ENABLED"
  }
}

@github-actions github-actions bot added this to the v5.20.0 milestone Sep 29, 2023
@github-actions
Copy link

github-actions bot commented Oct 6, 2023

This functionality has been released in v5.20.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

github-actions bot commented Nov 6, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/guardduty Issues and PRs that pertain to the guardduty service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants