aws / amazon-freertos

DEPRECATED - See README.md
https://aws.amazon.com/freertos/
MIT License
2.54k stars 1.1k forks source link

Add additional metrics groups to defender #1987

Open christian-herber opened 4 years ago

christian-herber commented 4 years ago

Currently, defender only supports AWS_IOT_DEFENDER_METRICS_TCP_CONNECTIONS. There is no known way to me to provide other groups such as "Listening UDP ports", "Listening TCP ports", and "Network statistics" (see https://docs.aws.amazon.com/iot/latest/developerguide/device-defender-detect.html#DetectMetricsMessages).

If these cannot be supported out of the box, at least some way to enable this functionality in a platform dependent port should be there. Even if i have e.g. network statistics available on my platform, i don't see a way to publish these right now.

muneebahmed10 commented 4 years ago

Hi @christian-herber

Thank you for your suggestion and feedback; we will consider it for future releases. Metrics collection is handled by the platform, and currently only the TCP connections metrics group is supported.

Although the API does not expose a method for adding other metrics groups, if your platform has other metrics available, then you could try implementing the functionality to publish them. Note that this would require adding code to parts of the Defender library. To start, you could add a new metrics group here and update the count. You would also need to add code to serialize the metrics group.

Let me know if you have any further questions.