A valid honeypot name, date, makes feed-type statistics return HTTP 500
SensorCreateSerializer accepts honeypot_software="date". Event processing can use this value to create an active Honeypot named date.
On a cache miss, GET /api/statistics/feeds_types builds annotation aliases from active honeypot names. The statistics query first uses date for its time-bucket annotation, so the honeypot annotation conflicts with it and the endpoint returns HTTP 500:
ValueError: The annotation 'date' conflicts with a field on the model.
Reproduction: Create an active Honeypot named date, then request /api/statistics/feeds_types with an empty or invalidated cache. The request is unauthenticated. A valid sensor/event ingestion path can introduce this name; registering a sensor requires an authenticated user with an active APISource.
Expected: HTTP 200, with a date feed-type count (or rejection of the reserved value at ingestion).
Suggested fix: Use safe internal ORM aliases and map those aliases back to honeypot names in the response. Add a regression test for an active Honeypot named date.
Verification note: The actual Django view returned HTTP 500 with an active date Honeypot supplied. The serializer acceptance and event-processing path were checked separately; the full database-backed ingestion flow was not run in that environment.
Hey @ABHIGYA0205 ! Good catch! You want to work on the fix?
Yes, I’ll take this on. I’ll add a regression test for an active honeypot named date, change the aggregation to use safe internal aliases while preserving the response keys, and run the focused statistics tests. I’ll open a PR against develop using the repository’s PR template and link it here.