towerops/test
mayor 8044a6d140
Add strict protobuf validation for agent messages
Implements comprehensive validation layer on top of protobuf schema to
prevent malformed data, DoS attacks, and business logic violations.

Changes:
- Created Towerops.Agent.Validator module with strict validation for all
  agent message types (AgentHeartbeat, MetricBatch, SnmpResult, AgentError,
  CredentialTestResult, MikrotikResult)
- Added validation limits to prevent memory exhaustion and DoS attacks
  (max string lengths, collection sizes, numeric ranges)
- Added format validation for UUIDs, IP addresses, versions, hostnames
- Added enum validation for status and protocol fields
- Modified AgentChannel handlers to validate all incoming messages before
  processing
- Added comprehensive typespecs to AgentChannel for better static analysis
- Created safe_base64_decode/1 helper with error handling
- Added 32 comprehensive tests covering valid cases, invalid inputs, and
  edge cases

Security improvements:
- Prevents memory exhaustion via oversized strings and collections
- Validates all numeric fields are within expected ranges
- Checks UUID format for all ID fields
- Validates IP addresses and hostnames against RFC standards
- Rejects future timestamps and excessive values

Backward compatibility:
- Empty version and hostname strings allowed for older agents
2026-02-06 09:26:04 -06:00
..
integration make devices site optional and many test fix 2026-02-04 15:05:42 -06:00
mix/tasks more tests 2026-02-03 10:19:56 -06:00
snmpkit test: expand MIB.Compiler tests (46.15%) 2026-02-06 09:12:26 -06:00
support Add comprehensive tests for API authentication and authorization 2026-02-05 16:39:01 -06:00
towerops Add strict protobuf validation for agent messages 2026-02-06 09:26:04 -06:00
towerops_web Add comprehensive tests for API authentication and authorization 2026-02-05 16:39:01 -06:00
test_helper.exs complete overhaul of snmp engine to C nif 2026-01-30 12:27:12 -06:00
towerops_native_test.exs complete overhaul of snmp engine to C nif 2026-01-30 12:27:12 -06:00