## 6 Security Analysis
### Secure Data Access  
The security of HMBAC controlled data access is based on several security building blocks (as detailed in Section 4.2). First, data are encrypted with ABE with the keys assigned to users based on their roles, by applying the MA-ABE scheme in [7]. Then, an additional layer of ABE encryption is performed, with an attribute key assigned to the Key Store Smart Contract (KSSC). This is implemented by applying an additional 'AND' rule on top of the predefined encryption policy. This forces all requests to be performed via the HMBAC system; otherwise, the data retrieved by users will still be partially encrypted. The BC-side attribute keys are securely stored in a Vault and are accessible only by the KSSC. Besides the encryption layer, the user must be authenticated by the system in order to send queries, and also by the user-side Vault to access the attribute keys, in order to decrypt the received partially encrypted data. System authentication is performed through the proxy blockchain using the Trust Management Smart Contract (TMSC). An authenticated user may then send a data access request, which in turn will be validated at the domain blockchain layer, via the Access Control Smart Contract (ACSC), in order to verify that the user has the required roles based on the access policy. The KMSC performs the required partial decryption. Finally, users need access to their attribute certificates, issued by the relevant stakeholders/authorities, to verify their roles with the ACSC (Note that the attribute certificates may also be stored in a user-side Vault for protection). To formalize our analysis of unauthorized access attacks, we use attack trees as in [59]. Attack trees [60] are a conceptual design used to describe attacks on system assets. We distinguish two types of attack nodes, _and-nodes_ and _or-nodes_: the children of an and-node should all be executed to reach the goal of their parent, while any one of the children of an or-node needs to be executed to reach the goal of its parent. An attack on the system is then modeled by a multi-set of compromised nodes. **Definition 1** ([59]). : _Let \(\mathbb{C}\) be a set of attack components of a system. An attack is a finite non-empty multi-set of \(\mathbb{C}\) and an attack suite is a finite set of attacks. Denote the universe of attacks by \(\mathbb{A}=\mathcal{M}^{+}(\mathbb{C})\) and the universe of attack suites by \(\mathbb{S}=\mathcal{P}(\mathbb{A})\)._  
The attack tree for unauthorized data access attacks in HMBAC is shown in Figure 8. Our goal is to analyze all possible attack paths for an adversary, external and/or internal, to compromise the access control mechanism and gain unauthorized data access. As defined in our threat model, accessing the data in ways that are outside the HMBAC system are out of scope, e.g., accessing the data before they are ABE encrypted or before their entry into the system. To construct the attack tree, first we observe that unauthorized data access requires an adversary to concurrently bypass the security mechanisms that: validate a data access query posted to the PBC (denoted by node \(A\)), _and_ access all the attribute keys used to encrypt the data (denoted by node \(B\)). Note that despite the actual attack that may be applied to achieve the above conditions, simultaneously achieving the attack components \(A\) and \(B\) are necessary and sufficient conditions for any successful attack on unauthorized data access against an HMBAC system. Then for each level-1 node we continue our analysis of identifying all possible sets of system components that must be successfully attacked to achieve each the goal of the relevant parent node. The same holds for all nodes of the attack trees, including the leaf nodes. Note that for all nodes, including leaf nodes, we did not examine the actual attack techniques that may be used to achieve the relevant goal. For example, for node \(C\) there exist various implementations of attacks to obtain user credentials for the HMBC service, such as phishing, spoofing, or brute force.