Skip to content

EKS node diagnostics MCP: human-in-the-loop collection approval#35

Open
shyamkulkarni wants to merge 1 commit into
aws-samples:mainfrom
shyamkulkarni:eks-mcp-collection-approval
Open

EKS node diagnostics MCP: human-in-the-loop collection approval#35
shyamkulkarni wants to merge 1 commit into
aws-samples:mainfrom
shyamkulkarni:eks-mcp-collection-approval

Conversation

@shyamkulkarni

Copy link
Copy Markdown

Summary

Follow-up to #27. Replaces the restricted tcpdump tools with a human-in-the-loop approval flow for the two mutating tools (collect, batch_collect):

  • Removes tcpdump_capture / tcpdump_analyze and the ENABLED_RESTRICTED_TOOLS mechanism (21 tools -> 19)
  • New approval flow: first collect call writes a PENDING record to DynamoDB and notifies approvers via SNS with a single-use capability URL (only the SHA-256 of the token is stored server-side); the agent re-calls with the approvalId after human approval
  • Separate approval Lambda (Function URL) with no SSM/collection permissions; requests auto-expire via DynamoDB TTL
  • batch_collect now defaults to dry-run
  • Stricter EKS instance validation: user-settable kubernetes.io/cluster/* tag is rejected unless ALLOW_SELF_MANAGED_NODES=true (cross-checked via EKS API)
  • ReDoS-safe search regex validation and log-key path traversal checks
  • README, architecture docs, and runbooks updated accordingly

Testing

  • npm run build (tsc) passes
  • Jest: 12/12 passed (including CDK construct IAM property tests)
  • Pytest: 37/37 passed (includes new tests/test_collection_approval.py covering the approval flow)

…proval

Remove the restricted tcpdump_capture/tcpdump_analyze tools and
gate the two mutating tools (collect, batch_collect) behind an
out-of-band human approval flow instead:

- Approval Lambda + Function URL with capability-URL tokens
  (SHA-256 stored server-side, single-use, DynamoDB TTL expiry)
- SNS topic notifies approvers with approve/deny links
- batch_collect defaults to dry-run
- Stricter EKS instance validation: user-settable
  kubernetes.io/cluster/* tag rejected unless
  ALLOW_SELF_MANAGED_NODES=true
- ReDoS-safe search regex validation and log-key path checks
- Update README, architecture docs, and runbooks accordingly
- Add pytest coverage for the approval flow
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.

1 participant