alertmanager icon indicating copy to clipboard operation
alertmanager copied to clipboard

add SNS receiver validation

Open qinxx108 opened this issue 3 years ago • 2 comments

  1. Add validation for subject, if not a validate input, we will replace it with error message
  2. Add validation for message attribute, if not a validate attribute, we will remove the attribute
  3. Add validation for message, if not a validate message, we will replace the message with error message
  4. Add truncation logic that will include message attributes as SNS receiver count 256KB size limit with message body+attribute

qinxx108 avatar Dec 30 '21 21:12 qinxx108

:wave: could you split the change into several pull requests. There are things that make sense to me but others that would need prior discussion and agreement.

Add validation for subject, if not a validate input, we will replace it with error message

I'd be fine to truncate the subject when we detect that it's larger than the max size. I'm less convinced that replacing an invalid subject with an error message is a good approach.

Add validation for message attribute, if not a validate attribute, we will remove the attribute

that might be acceptable.

Add validation for message, if not a validate message, we will replace the message with error message

Same remark as for the subject.

Add truncation logic that will include message attributes as SNS receiver count 256KB size limit with message body+attribute

There could be a discussion about which fields should have priority.

simonpasquier avatar Jan 20 '22 11:01 simonpasquier

I think we can close this PR.

It's been superseded by: https://github.com/prometheus/alertmanager/pull/2829, https://github.com/prometheus/alertmanager/pull/2834, https://github.com/prometheus/alertmanager/pull/2835 and https://github.com/prometheus/alertmanager/pull/2894

gotjosh avatar Jun 14 '22 10:06 gotjosh