Skip to content

Commit d15fef2

Browse files
authored
Merge pull request #277 from AxelNennker/patch-3
Update Subscription Security Considerations
2 parents 9e343b7 + d18d602 commit d15fef2

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

documentation/API-design-guidelines.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -2001,12 +2001,32 @@ Note: There is no normative enforcement to use any of these patterns, and they c
20012001
20022002
#### Security Considerations
20032003
2004-
As notification may carry sensitive information, privacy and security constraints have to be considered. CloudEvents specification provides some guidance there: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#privacy-and-security
2004+
As notifications may carry sensitive information, privacy and security have to be considered.
2005+
2006+
CloudEvents specification only provide some limited privacy and security guidance there: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#privacy-and-security
2007+
2008+
This document restricts the allowed values of `protocol` to `HTTP`. CloudEvents allows many protocols which each have their own security measures.
2009+
This Security Considerations need to be reconsidered if other protocols than `HTTP` are allowed.
2010+
Camara Notifications MUST use HTTPS. The value of `sink` MUST be an URL with url-scheme `https`.
2011+
The implementation of the Notification Sender MUST follow [10.2 Security Implementation](#102-security-implementation).
2012+
2013+
This document restricts the `credendentialType` to `ACCESSTOKEN`. Neither `PLAIN`nor `REFRESHTOKEN` are allowed.
2014+
This Security Considerations need to be reconsidered if other `credentialsType` values are allowed.
2015+
2016+
CloudEvent Security and Privacy considerations RECOMMEND protecting event **data** through signature and encryption. The value of the `data` field of the notifications SHOULD be signed and encrypted.
2017+
As Camara Notifications are JSON, Camara RECOMMENDS that the Camara Notification is signed and then encrypted using [JSON Web Signature (JWS)](https://datatracker.ietf.org/doc/html/rfc7515) and [JSON Web Encryption (JWE)](https://datatracker.ietf.org/doc/html/rfc7516).
2018+
The API Consumer and event producer have to agree which keys to use for signing and encryption e.g. at onboarding time or at subscription time.
2019+
2020+
It is RECOMMENDED that the API consumer inspects all the fields of the notification, especially `source` and `type`. It is RECOMMENDED that if the notification event data is signed, that then the `source` and the signature key are associated.
2021+
2022+
API Consumers SHOULD validate the schema of the notification event data that is defined by the API subproject. It is RECOMMENDED that additional fields are ignored. Reliance on additional fields is an interoperability issue. Additional fields can lead to security issues.
20052023
20062024
#### Abuse Protection
20072025
20082026
Any system permitting the registration and delivery of notifications to arbitrary HTTP endpoints holds the potential for abuse. This could occur if someone, either intentionally or unintentionally, registers the address of a system unprepared for such requests, or for which the registering party lacks authorization to perform such registration.
20092027
2028+
To prevent notification-replay attacks the API Consumer SHOULD inspect the notification's `id` and `time` fields. Whether to reject or ignore notifications that have already been received or that are too old is a API Consumer's policy decision.
2029+
20102030
To protect the sender, CloudEvents specification provides some guidance there: https://github.com/cloudevents/spec/blob/main/cloudevents/http-webhook.md#4-abuse-protection
20112031
20122032
Event Producers shall choose based on their internal security guidelines to implement measures based on the above guidance to ensure abuse protection. For e.g., An event producer might ask the subscriber to pre-register the notification URL at the time of app onboarding. If this registered notification URL doesn't match later with the notification URL in the request, the event producer can choose to reject the request with the relevant error code.

0 commit comments

Comments
 (0)