Providing security and privacy to wireless sensor nodes (WSNs) is very
challenging, due to the heterogeneity of sensor nodes and their limited capabilities in terms
of energy, processing power and memory. The applications for these systems run in a
myriad of sensors with different low-level programming abstractions, limited capabilities
and different routing protocols. This means that applications for WSNs need mechanisms
for self-adaptation and for self-protection based on the dynamic adaptation of the algorithms
used to provide security. Dynamic software product lines (DSPLs) allow managing both
variability and dynamic software adaptation, so they can be considered a key technology
in successfully developing self-protected WSN applications. In this paper, we propose a
self-protection solution for WSNs based on the combination of the INTER-TRUST security
framework (a solution for the dynamic negotiation and deployment of security policies) and
the FamiWare middleware (a DSPL approach to automatically configure and reconfigure
instances of a middleware for WSNs).We evaluate our approach using a case study from the
intelligent transportation system domain.