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

Rule: events:source condition for events:PutEvents actions in IAM policies #14

Open
nmoutschen opened this issue May 27, 2021 · 0 comments
Labels
new-rule New Rule

Comments

@nmoutschen
Copy link
Contributor

Key information

  • Rule PR: (leave this empty)
  • Related issue(s), if known:
  • Meets the need of 80% of users: yes
  • Do you need help implementing this rule: no
  • Approved by:
  • Reviewed by:

Summary

As EventBridge now support fine-grained permissions on the events:PutEvents action, this new rule would check if there is at least an events:source condition on that rule. In EventBridge events, source should correspond to a service/domain, and detail-type to a type of event emitted by that source. The two together correspond to a unique event type identifier.

By enforcing an events:source, we could ensure that a given service/domain does not spoof another one.

See here for a list of supported conditions.

Rule level

I'd recommend to use Warning for this rule. If you abstract the payload away and use EventBridge as pure envelope, then you'd use another property within the detail as source identifier. E.g. (based on this blog post):

{
  "version": "0",
  "id": "abc",
  "detail-type": "event",
  "source": "event",
  "account": "123456789012",
  "time": "2021-50-27T10:00:00Z",
  "region": "eu-west-1",
  "resources": [],
  "detail": {
    "metadata": {
      "domain": "ecommerce",
      "service": "orders",
      "type": "ORDER",
      "status": "SUBMITTED"
    },
    "data": {
      "orderNumber": "T123123123",
      "customerId": "23hdfjdf-34ff-34ghj",
      "totalValue": 29.99,
      "items": 5
    }
  }
}

Because you don't use the source type for routing, it doesn't act as a guard against spoofing events from other services, and thus doesn't bring the same value for these use-cases.

@nmoutschen nmoutschen added the new-rule New Rule label Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-rule New Rule
Projects
None yet
Development

No branches or pull requests

1 participant