![](bg8.png)
quire context knowledge was already acknowledged
in (Hallstrom et al., 2004) and (Ostroff et al., 2009)
which served as inspiration for our work.
Formal definitions of security patterns are pro-
vided by several authors (Cheng et al., 2019),
(Behrens, 2018), (Da Silva J
´
unior et al., 2013). The
purpose of these formal definitions is to analyze the
behavior of the patterns at design level or to enable
automatic analysis operations. On the contrary, our
proposal to formalize security patterns with a Design
by Contract approach aims at ensuring a secure im-
plementation of the patterns. Thus, we can see these
approaches as complementary.
More related to the implementation level,
in (Mongiello et al., 2015), the authors propose AC-
contract, an approach for the run-time verification
of (adaptive) context-aware applications. It uses
pre-defined patterns in order to derive contracts on
components which are verified at run-time depending
on a set of event and states. Compared to ours, apart
from implementations details (e.g., their approach
integrate contract components in separate XML docu-
ments), their approach is more coarse-grained (works
at the component level), focuses in self-adaptation,
and does not deal with security. Close to our work
from an implementation point of view, in (Hallstrom
et al., 2004) the authors propose an AoP approach to
monitor pattern contracts. Each pattern contract is
associated with a dedicated pattern and is defined in
an aspect. This aspect is used to monitor, at run-time,
the applied pattern. Nevertheless, this approach is
focused exclusively on the implementation without
a will to provide abstraction related to the contract
definition. Note that none of the aforementioned
approaches focuses on security. In (Dikanski et al.,
2012), the authors evaluate Spring Security in order
to identify existing security patterns to provide a
mapping with Spring security mechanisms. However,
they do not provide any supporting mechanism for
implementation or monitoring of the patterns.
6 CONCLUSION & FUTURE
WORK
In this paper we have presented Security Contracts, a
novel extension of the Design by Contract paradigm
aimed at supporting security patterns. Our approach
provides a mechanism for the specification of re-
usable and extensible abstract patterns, their deploy-
ment on host applications and their monitoring at run-
time, in what we call, Execution under Contract. A
prototype implementation for the Java ecosystem and
its application to a case study involving the enhance-
ment of the authentication mechanism provided by
the Spring Security framework are presented as well.
Concretely, we have shown how we can define the
Authenticator pattern as a Security Contract in an
abstract way, deploy it by the means of annotations
in both new and existing applications and monitor
and enforce its properties (including temporal ones)
at run-time.
As future work we envision the exploration of the
following research lines: 1) Pattern composition. We
intend to investigate an extension of our framework in
order to give support to the composition of patterns.
This will enable the possibility of creating complex
patterns as a composition of simpler, easier to ver-
ify ones. 2) Annotation enhancement. We aim to
research the feasibility of the integration of a given
(temporal) logic directly in the annotations used to
deploy the pattern, so that the user can add/modify
its properties.
ACKNOWLEDGMENTS
The authors thank Caine Silva and Henri Stoven for
their help in this work.
REFERENCES
Behrens, A. (2018). What are security patterns? a formal
model for security and design of software. In Proceed-
ings of the 13th International Conference on Avail-
ability, Reliability and Security, pages 1–6.
Cheng, B. H., Doherty, B., Polanco, N., and Pasco, M.
(2019). Security patterns for automotive systems. In
2019 ACM/IEEE 22nd International Conference on
Model Driven Engineering Languages and Systems
Companion (MODELS-C), pages 54–63. IEEE.
Da Silva J
´
unior, L. S., Gu
´
eh
´
eneuc, Y.-G., and Mullins, J.
(2013). An approach to formalise security patterns.
Technical report, Citeseer.
Dikanski, A., Steinegger, R., and Abeck, S. (2012). Identi-
fication and implementation of authentication and au-
thorization patterns in the spring security framework.
In The Sixth International Conference on Emerging
Security Information, Systems and Technologies (SE-
CURWARE 2012), pages 14–30.
Fernandez, E. B., Yoshioka, N., Washizaki, H., and Yoder,
J. (2018). An abstract security pattern for authenti-
cation and a derived concrete pattern, the credential-
based authentication. In Asian pattern languages of
programs conference (AsianPLoP).
Fernandez-Buglioni, E. (2013). Security patterns in prac-
tice: designing secure architectures using software
patterns. John Wiley & Sons.
Gu
´
erin, S., Polet, G., Silva, C., Champeau, J., Bach,
J.-C., Mart
´
ınez, S., Dagnat, F., and Beugnard, A.
ICISSP 2024 - 10th International Conference on Information Systems Security and Privacy
110