Problem
DeviceClassifierService.java contains four hardcoded Set<String> collections used to classify devices by the nDPI application names observed in their traffic:
MOBILE_APPS — 13 entries (Instagram, TikTok, WhatsApp, etc.)
DESKTOP_APPS — 18 entries (Zoom, Teams, Steam, SSH, etc.)
SERVER_APPS — 12 entries (PostgreSQL, MySQL, Redis, Kafka, etc.)
IOT_CATEGORIES — 2 entries (IoT-Scada, Cloud)
Any new nDPI application that should influence device classification (e.g. a new messaging app) requires a Java recompile and redeployment.
Proposed Solution
Move these lists to a dedicated YAML configuration file loaded by Spring's @ConfigurationProperties. This makes classification rules configurable without touching Java code.
Example config (application.yml or dedicated device-classification.yml):
device-classification:
mobile-apps:
- Instagram
- TikTok
- Snapchat
- WhatsApp
- WeChat
- Line
- Viber
- Telegram
- Signal
- iMessage
- FaceTime
- AirDrop
- Siri
desktop-apps:
- Zoom
- Teams
- Slack
- Discord
- Skype
- WebEx
- GoToMeeting
- BitTorrent
- Steam
- Battle.net
- League of Legends
- Valorant
- Remote Desktop
- SSH
- SMB
- NFS
- VNC
- TeamViewer
server-apps:
- PostgreSQL
- MySQL
- MongoDB
- Redis
- Elasticsearch
- Kafka
- RabbitMQ
- Memcached
- LDAP
- Kerberos
- SNMP
- Syslog
iot-categories:
- IoT-Scada
- Cloud
Implementation
@ConfigurationProperties(prefix = "device-classification")
@Component
public class DeviceClassificationProperties {
private Set<String> mobileApps = new HashSet<>();
private Set<String> desktopApps = new HashSet<>();
private Set<String> serverApps = new HashSet<>();
private Set<String> iotCategories = new HashSet<>();
// getters/setters
}
Inject DeviceClassificationProperties into DeviceClassifierService and replace the static Set references.
Files to Change
backend/src/main/java/com/tracepcap/analysis/service/DeviceClassifierService.java
backend/src/main/resources/application.yml (or new device-classification.yml)
- New
DeviceClassificationProperties.java config class
Acceptance Criteria
Problem
DeviceClassifierService.javacontains four hardcodedSet<String>collections used to classify devices by the nDPI application names observed in their traffic:MOBILE_APPS— 13 entries (Instagram, TikTok, WhatsApp, etc.)DESKTOP_APPS— 18 entries (Zoom, Teams, Steam, SSH, etc.)SERVER_APPS— 12 entries (PostgreSQL, MySQL, Redis, Kafka, etc.)IOT_CATEGORIES— 2 entries (IoT-Scada, Cloud)Any new nDPI application that should influence device classification (e.g. a new messaging app) requires a Java recompile and redeployment.
Proposed Solution
Move these lists to a dedicated YAML configuration file loaded by Spring's
@ConfigurationProperties. This makes classification rules configurable without touching Java code.Example config (
application.ymlor dedicateddevice-classification.yml):Implementation
Inject
DeviceClassificationPropertiesintoDeviceClassifierServiceand replace the staticSetreferences.Files to Change
backend/src/main/java/com/tracepcap/analysis/service/DeviceClassifierService.javabackend/src/main/resources/application.yml(or newdevice-classification.yml)DeviceClassificationProperties.javaconfig classAcceptance Criteria
MOBILE_APPS,DESKTOP_APPS,SERVER_APPS,IOT_CATEGORIESstatic sets removed from Java@ConfigurationProperties