Skip to content

Conversation

@rjjaegeraws
Copy link
Contributor

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This pull requests implements a new configuration values "guardduty-eks" and "guardduty-eks-excl-regions".

example:

 "guardduty-eks": true,
 "guardduty-eks-excl-regions": [],

This enabled GuardDuty Kubernetes Protection.

Note this PR builds on #1057

@rjjaegeraws rjjaegeraws linked an issue Sep 16, 2022 that may be closed by this pull request
@rjjaegeraws rjjaegeraws changed the title Guardduty eks feature: Add GuardDuty Kubernetes Protection Sep 16, 2022
await updateMemberDataSource(requiredMemberAccounts, detectorId, s3Protection);
}

await updateMemberDataSource(existingMembers, detectorId, s3Protection, eksProtection);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved updateMemberDataSource outside the previous if statement and updated to iterate over all existing members. This will enable EKS for existing members. Without this, it will only get enabled on new accounts.

}

async function updateMemberDataSource(memberAccounts: AccountDetail[], detectorId: string, s3Protection: boolean) {
if (s3Protection) {
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's not clear why this statement was here. I feel that this would have originally not enabled S3 protection on existing members if it was previously not enabled. Removing this check.

"@aws-accelerator/custom-resource-runtime-cfn-response": "workspace:*",
"aws-lambda": "1.0.6",
"aws-sdk": "2.944.0"
"aws-sdk": "2.1217.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.

I had to bump up the sdk version as 2.944.0 does not contain the GuardDuty Kubernetes API.

"main": "dist/index.js",
"types": "src/index.ts",
"scripts": {
"build": "pnpx esbuild --minify --bundle --platform=node --target=node14 --external:aws-sdk --outfile=./dist/index.js src/index.ts",
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 current Lambda runtime includes nodejs AWS SDK v2.1055.0, but the GuardDuty EKS is introduced in v.2.1063.0. Therefore, this Lambda bundles the SDK library.

@Brian969 Brian969 changed the title feature: Add GuardDuty Kubernetes Protection enhancement: Add GuardDuty Kubernetes Protection Sep 29, 2022
@Brian969 Brian969 changed the title enhancement: Add GuardDuty Kubernetes Protection (enhancement): Add GuardDuty Kubernetes Protection Sep 29, 2022
hickeydh-aws and others added 3 commits September 30, 2022 14:49
* exponential backoff fix

* exponential backoff fix

* Fixed backoff for lambdas

* added backoff in other location

* fixed lambda timeouts and added timeout aspect

* fixed typo

* tweak default max jitter delay to 2s from 5s

Co-authored-by: hickeydh-aws <hickeydh@amazon.com>
Co-authored-by: Brian969 <56414362+Brian969@users.noreply.github.com>
* added Elastic Beanstalk entry to FAQ

* Update index.md

Co-authored-by: Jahnke <ejahnke@909c4acec9cf.ant.amazon.com>
* added CW Alarms

* fix typo

Co-authored-by: Brian969 <56414362+Brian969@users.noreply.github.com>
Copy link
Contributor

@dliggat dliggat left a comment

Choose a reason for hiding this comment

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

LGTM @rjjaegeraws. Just verified feature in a test environment including region disabling.

rjjaegeraws and others added 3 commits October 3, 2022 19:59
…les#1057)

* add frequency for GuardDuty

* update sample config files with new config option
@Brian969 Brian969 merged commit 8d9fbc1 into aws-samples:main Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add Guardduty EKS support

6 participants