Actions over Core-closed Knowledge Bases

We present new results on the application of semantic- and knowledge-based reasoning techniques to the analysis of cloud deployments. In particular, to the security of Infrastructure as Code configuration files, encoded as description logic knowledge bases. We introduce an action language to model mutating actions; that is, actions that change the structural configuration of a given deployment by adding, modifying, or deleting resources. We mainly focus on two problems: the problem of determining whether the execution of an action, no matter the parameters passed to it, will not cause the violation of some security requirement (static verification), and the problem of finding sequences of actions that would lead the deployment to a state where (un)desirable properties are (not) satisfied (plan existence and plan synthesis). For all these problems, we provide definitions, complexity results, and decision procedures.


Introduction
The use of automated reasoning techniques to analyze properties of cloud infrastructure is gaining increasing attention [6,4,7,5,17].Despite that, more effort needs to be put into the modeling and verification of generic security requirements over cloud infrastructure pre-deployment.The availability of formal techniques, providing strong security guarantees, would assist complex system-level analyses such as threat modeling and data flow, which now require considerable time, manual intervention, and expert domain knowledge.
We continue our research on the application of semantic-based and knowledgebased reasoning techniques to cloud deployment Infrastructure as Code configuration files.In [14], we reported on our experience using expressive description logics to model and reason about Amazon Web Services' proprietary Infrastructure as Code framework (AWS CloudFormation).We used the rich constructs of these logics to encode domain knowledge, simulate closed-world reasoning, and express mitigations and exposures to security threats.Due to the high complexity of basic tasks [25,3], we found reasoning in such a framework to be not efficient at cloud scale.In [15], we introduced core-closed knowledge bases-a lightweight description logic combining closed-and open-world reasoning, that is tailored to model cloud infrastructure and efficiently query its security properties.Coreclosed knowledge bases enable partially-closed predicates whose interpretation is closed over a core part of the knowledge base but open elsewhere.To encode potential exposure to security threats, we studied the query satisfiability problem and (together with the usual query entailment problem) applied it to a new class of conjunctive queries that we called Must/May queries.We were able to answer such queries over core-closed knowledge bases in LogSpace in data complexity and NP in combined complexity, improving on the required NExptime complexity for satisfiability over ALCOIQ (used in [14]).
Here, we enhance the quality of the analyses done over pre-deployment artifacts, giving users and practitioners additional precise insights on the impact of potential changes, fixes, and general improvements to their cloud projects.To do so, we enrich core-closed knowledge bases with the notion of core-completeness, which is needed to ensure that updates are consistent.We define the syntax and semantics of an action language that is expressive enough to encode mutating API calls, i.e., operations that change a cloud deployment configuration by creating, modifying, or deleting existing resources.As part of our effort to improve the quality of automated analysis, we also provide relevant reasoning tools to identify and predict the consequences of these changes.To this end, we consider procedures that determine whether the execution of a mutating operation always preserves given properties (static verification); determine whether there exists a sequence of operations that would lead a deployment to a configuration meeting certain requirements (plan existence); and find such sequences of operations (plan synthesis).
The paper is organized as follows.In Section 2 we provide background on core-closed knowledge bases, conjunctive queries, and Must/May queries.In Section 3 we motivate and introduce the notion of core-completeness.In Section 4 we define the action language.In Section 5 we describe the static verification problem and characterize its complexity.In Section 6 we address the planning problem and concentrate on the synthesis of minimal plans satisfying a given requirement expressed using Must/May queries.We discuss related works in Section 7 and conclude in Section 8.

Background
Description logics (DLs) are a family of logics for encoding knowledge in terms of concepts, roles, and individuals; analogous to first-order logic unary predicates, binary predicates, and constants, respectively.Standard DL knowledge bases (KBs) have a set of axioms, called TBox, and a set of assertions, called ABox.The TBox contains axioms that relate to concepts and roles.The ABox contains assertions that relate individuals to concepts and pairs of individuals to roles.KBs are usually interpreted under the open-world assumption, meaning that the asserted facts are not assumed to be complete.

Core-closed Knowledge Bases
In [15], we introduced core-closed knowledge bases (ccKBs) as a suitable description logic formalism to encode cloud deployments.
The main characteristic of ccKBs is to allow for a combination of open-and closed-world reasoning that ensures tractability.A DL-Lite F ccKB is the tuple K = T , A, S, M built from the standard knowledge base T , A and the core system S, M .The former encodes incomplete terminological and assertional knowledge.The latter is, in turn, composed of two parts: S, containing axioms that encode the core structural specifications, and M, containing positive concept and role assertions that encode the core configuration.Syntactically, M is similar to an ABox but, semantically, is assumed to be complete with respect to the specifications in S. The ccKB K is defined over the alphabets C (of concepts), R (of roles), and where A denotes a concept name and p is either a role name r or its inverse r − .The syntax of axioms provides for the three following axioms: respectively called: positive inclusion axioms, negative inclusion axioms, and functionality axioms.From now on, we denote symbols from the alphabet X X with the subscript X , and symbols from the generic alphabet X with no subscript.In core-closed knowledge bases, axioms and assertions fall into the scope of a different set depending on the predicates and individuals that they refer to, according to the set definitions below.
As mentioned earlier, M-assertions are assumed to be complete and consistent with respect to the terminological knowledge given in S; whereas the usual openworld assumption is made for A-assertions.The semantics of a DL-Lite F coreclosed KB is given in terms of interpretations I, consisting of a non-empty domain ∆ I and an interpretation function • I .The latter assigns to each concept A a subset A I of ∆ I , to each role r a subset r I of ∆ I ×∆ I , and to each individual a a node a I in ∆ I , and it is extended to concept expressions in the usual way.An interpretation I is a model of an inclusion axiom An interpretation I is a model of a membership assertion A(a), (resp.r(a, b)) if a I ∈ A I (resp.(a I , b I ) ∈ r I ).We say that I models T , S, and A if it models all axioms or assertions contained therein.We say that I models M, denoted I |= CWA M, when it models an M-assertion f if and only if f ∈ M. Finally, I models K if it models T , S, A, and M. When K has at least one model, we say that K is satisfiable.
In the application presented in [14], description logic KBs are used to encode machine-readable deployment files containing multiple resource declarations.Every resource declaration has an underlying tree structure, whose leaves can potentially link to the roots of other resource declarations.Let I r ⊆ I M be the set of all resource nodes, we encode their resource declarations in M, and formalize the resulting forest structure by partitioning M into multiple subsets {M i } i∈I r , each representing a tree of assertions rooted at a resource node i (we generally refer to constants in M as nodes).For the purpose of this work, we will refer to core-closed knowledge bases where M is partitioned as described; that is, ccKBs such that K = T , A, S, {M i } i∈I r .
Conjunctive Queries A conjunctive query (CQ) is an existentially-quantified formula q[ x] of the form ∃ y.conj( x, y), where conj is a conjunction of positive atoms and potentially inequalities.A union of conjunctive queries (UCQ) is a disjunction of CQs.The variables in x are called answer variables, those in y are the existentially-quantified query variables.A tuple c of constants appearing in the knowledge base K is an answer to q if for all interpretations I model of K we have I |= q[ c].We call these tuples the certain answers of q over K, denoted ans(K, q), and the problem of testing whether a tuple is a certain answer query entailment.A tuple c of constants appearing in K satisfies q if there exists an interpretation I model of K such that I |= q[ c].We call these tuples the sat answers of q over K, denoted sat−ans(K, q), and the problem of testing whether a given tuple is a sat answer query satisfiability.
Must/ May Queries A Must/May query ψ ( [15]) is a Boolean combination of nested UCQs in the scope of a Must or a May operator as follows: where ϕ and ϕ ≈ are unions of conjunctive queries potentially containing inequalities.The reasoning needed for answering the nested queries can be decoupled from the reasoning needed to answer the higher-level formula: nested queries Must ϕ are reduced to conjunctive query entailment, and nested queries May ϕ ≈ are reduced to conjunctive query satisfiability.We denote by ANS(ψ, K) the answers of a Must/May query ψ over the core-closed knowledge base K.

Core-complete Knowledge Bases
The algorithm Consistent presented in [15] computes satisfiability of DL-Lite F core-closed knowledge bases relying on the assumption that M is complete and consistent with respect to S. Such an assumption effectively means that the information contained in M is explicitly present and cannot be completed by inference.The algorithm relies on the existence of a theoretical object, the canonical interpretation, in which missing assertions can always be introduced when they are logically implied by the positive inclusion axioms.As a matter of fact, positive inclusion axioms are not even included in the inconsistency formula built for the satisfiability check, as it is proven that the canonical interpretation always satisfies them ( [15], Lemma 3).When the assumption that M is consistent with respect to S is dropped, the algorithm Consistent becomes insufficient to check satisfiability.We illustrate this with an example.
Example 1 (Required Configuration).Let us consider the axioms constraining the AWS resource type S3::Bucket.In particular, the S-axiom S3::Bucket ⊑ ∃loggingConfiguration prescribing that all buckets must have a required logging configuration.For a set M = {S3::Bucket(b)}, according to the partiallyclosed semantics of core-closed knowledge bases, the absence of an assertion loggingConfiguration(b, x), for some x, is interpreted as the assertion being false in M, which is therefore not consistent with respect to S. However, the algorithm Consistent will check the lts interpretation of M for an empty formula (as there are no negative inclusion or functionality axioms) and return true.
In essence, the algorithm Consistent does not compute the full satisfiability of the whole core-closed knowledge base, but only of its open part.Satisfiability of M with respect to the positive inclusion axioms in S needs to be checked separately.We introduce a new notion to denote when a set M is complete with respect to S that is distinct from the notion of consistency.Let K = T , A, S, M be a DL-Lite F core-closed knowledge base; we say that K is core-complete when M models all positive inclusion axioms in S under a closed-world assumption; we say that K is open-consistent when M and A model all negative inclusion and functionality axioms in K's negative inclusion closure.Finally, we say that K is fully satisfiable when is both core-complete and open-consistent.
Lemma 1.In order to check full satisfiability of a DL-Lite F core-closed KB, one simply needs to check if K is core-complete (that is, if M models all positive axioms in S under a closed-world assumption) and if K is open-consistent (that is, to run the algorithm Consistent).
Proof.Dropping the assumption that M is consistent w.r.t.S causes Lemma 3 from [15] to fail.In particular, the canonical interpretation of K, can(K), would still be a model of P I T , A, and M, but may not be a model of P I S .This is due to the construction of the canonical model that is based on the notion of applicable axioms.In rules c5-c8 of [15] Definition 1, axioms in P I S are defined as applicable to assertions involving open nodes a K but not to model nodes a M in I M .As a result, if the implications of such axioms on model nodes are not included in M itself, then they will not be included in can(K) either, and can(K) will not be a model of P I S .On the other hand, one can easily verify that Lemmas 1,2,4,5,6,7 and Corollary 1 would still hold as they do not rely on the assumption.However, since it is not guaranteed anymore that M satisfies all positive inclusion axioms from S, the if direction of [15] Theorem 1 does not hold anymore: there can be an unsatisfiable ccKB K such that db(A) ∪ lts(M) |= cln(T ∪ S), A, M. For instance, the knowledge base from Example 1.We also note that the negative inclusion and functionality axioms from S will be checked anyway by the consistency formula, both on db(A) and on lts(M).
Lemma 2. Checking whether a DL-Lite F core-closed knowledge base is corecomplete can be done in polynomial time in M. As a consequence, checking full satisfiability is also done in polynomial time in M.
Proof.One can write an algorithm that checks core-completeness by searching for the existence of a positive inclusion axiom , where the relation |= is defined over DL-Lite F concept expressions as follows: The knowledge base is core-complete if such a node cannot be found.

Actions
We now introduce a formal language to encode mutating actions.Let us remind ourselves that, in our application of interest, the execution of a mutating action modifies the configuration of a deployment by either adding new resource instances, deleting existing ones, or modifying their settings.Here, we introduce a framework for DL-Lite F core-closed knowledge base updates, triggered by the execution of an action that enables all the above mentioned effects.The only component of the core-closed knowledge base that is modified by the action execution is M; while T , S, and A remain unchanged.As a consequence of updating M, actions can introduce new individuals and delete old ones, thus updating the set I M as well.Note that this may force changes outside I M due to the axioms in T and S. The effects of applying an action over M depend on a set of input parameters that will be instantiated at execution time, resulting in different assertions being added or removed from M. As a consequence of assertions being added, fresh individuals might be introduced in the active domain of M, including both model nodes from I M and boundary nodes from I B .Differently, as a consequence of assertions being removed, individuals might be removed from the active domain of M, including model nodes from I M but not including boundary nodes from I B .In fact, boundary nodes are owned by the open portion of the knowledge base and are known to exist regardless of them being used in M. We invite the reader to review the set definitions for Aand M-assertions (Section 2) to note that it is indeed possible for a generic boundary individual a involved in an M-assertion to also be involved in an A-assertion.

Syntax
An action is defined by a signature and a body.The signature consists of an action name and a list of formal parameters, which will be replaced with actual parameters at execution time.The body, or action effect, can include conditional statements and concatenation of atomic operations over M-assertions.For example, let α be the action act( x) = γ; that is, the action denoted by signature act( x) and body γ, with signature name act, signature parameters x, and body effect γ. Since it contains unbound parameters, or free variables, action α is ungrounded and needs to be instantiated with actual values in order to be executed over a set M. In the following, we assume the existence of a set Var, of variable names, and consider a generic input parameters substitution θ : Var → I, which replaces each variable name by an individual node.For simplicity, we will denote an ungrounded action by its effect γ, and a grounded action by the composition of its effect with an input parameter substitution γ θ.Action effects can either be complex or basic.The syntax of complex action effects γ and basic effects β is constrained by the following grammar.
The complex action effects γ include: the empty effect ( ǫ ), the execution of a basic effect followed by a complex one ( β • γ ), and the conditional execution of a basic effect upon evaluation of a formula ϕ over the set M ( [ ϕ β ] • γ ).The basic action effects β include: the addition of a set S of M-assertions to the subset M x ( ⊕ x S ), the removal of a set S of M-assertions from the subset M x ( ⊖ x S ), the addition of a fresh subset M xnew containing all the M-assertions in the set S ( ⊙ xnew S ), and the removal of an existing M x subset in its entirety ( ⊖ x ).The set S, the formula ϕ, and the operators ⊕/⊖ might contain free variables.These variables are of two types: (1) variables that are replaced by the grounding of the action input parameters, and (2) variables that are the answer variables of the formula ϕ and appear in the nested effect β.
Example 2. The following is the definition of the action createBucket from the API reference of the AWS resource type S3::Bucket.The input parameters are two: the new bucket name "name" and the canned access control list "acl" (one of Private, PublicRead, PublicReadWrite, AuthenticatedRead, etc.).The effect of the action is to add a fresh subset M x for the newly introduced individual x containing the two assertions S3::Bucket(x) and accessControl(x, y).createBucket(x : name, y : acl) = ⊙ x { S3::Bucket(x), accessControl(x, y) } • ǫ The action needs to be instantiated by a specific parameter assignment, for example the substitution θ = [ x ← DataBucket, y ← P rivate ], which binds the variable x to the node DataBucket and the variable y to the node P rivate, both taken from a pool of inactive nodes in I.
Action Query ϕ The syntax introduced in the previous paragraph allows for complex actions that conditionally execute a basic effect β depending on the evaluation of a formula ϕ over M.This is done via the construct [ ϕ β ] • γ.The formula ϕ might have a set y of answer variables that appear free in its body and are then bound to concrete tuples of nodes during evaluation.The answer tuples are in turn used to instantiate the free variables in the nested effect β.We call ϕ the action query since we use it to select all the nodes that will be involved in the action effect.According to the grammar below, ϕ is a boolean combination of M-assertions potentially containing free variables.
In particular, A S is a symbol from the set C S of partially-closed concepts; R S is a symbol from the set R S of partially-closed roles; and t, t 1 , t 2 are either individual or variable names from the set I ⊎ Var, chosen in such a way that the resulting assertion is an M-assertion.Since the formula ϕ can only refer to M-assertions, which are interpreted under a closed semantics, its evaluation requires looking at the content of the set M. A formula ϕ with no free variables is a boolean formula and evaluates to either true or false.A formula ϕ with answer variables y and arity ar(ϕ) evaluates to all the tuples t, of size equal the arity of ϕ, that make the formula true in M. The free variables of ϕ can only appear in the action β such that ϕ β.We denote by ANS(ϕ, M) the set of answers to the action query ϕ over M. It is easy to see that the maximum number of tuples that could be returned by the evaluation (that is, the size of the set ANS(ϕ, M)) is bounded by |I M ⊎ I B | ar(ϕ) , in turn bounded by ( 2|M| ) 2|ϕ| .
Example 3. The following example shows the encoding of the S3 API operation called deleteBucketEncryption, which requires as unique input parameter the name of the bucket whose encryption configuration is to be deleted.Since a bucket can have multiple encryption configuration rules (each prescribing different encryption keys and algorithms to be used) we use an action query ϕ to select all the nodes that match the assertions structure to be removed.
The query ϕ is instantiated by the specific bucket instance (which will replace the variable x) and returns all the triples (y, k, z) of encryption rule, key, and algorithm, respectively, which identify the assertions corresponding to the different encryption configurations that the bucket has.The answer variables are then used in the action effect to instantiate the assertions to remove from M x : So far, we have described the syntax of our action language and provided two examples that showcase the encoding of real-world API calls.Now, we define the semantics of action effects with respect to the changes that they induce over a knowledge base.Let us recall that given a substitution θ for the input parameters of an action γ, we denote by γ θ the grounded action where all the input variables are replaced according to what prescribed by θ.Let us also recall that the effects of an action apply only to assertions in M and individuals from I M , and cannot affect nodes and assertions from the open portion of the knowledge base.The execution of a grounded action γ θ over a DL-Lite F core-closed knowledge base K = (T , A, S, M), defined over the set I M of partially-closed individuals, generates a new knowledge base K γ θ = (T , A, S, M γ θ ), defined over an updated set of partially-closed individuals I M γ θ .Let S be a set of M-assertions, γ a complex action, θ an input parameter substitution, and ρ a generic substitution that potentially replaces all free variables in the action γ.Let ρ 1 and ρ 2 be two substitutions with signature Var → I such that dom( ρ 1 )∩dom( ρ 2 ) = ∅; we denote their composition by ρ 1 ρ 2 and define it as the new substitution such that We formalize the application of the grounded action γ θ as the transformation T γ θ that maps the pair M, I M into the new pair M ′ , I M ′ .We sometimes use the notation T γ θ (M) or T γ θ (I M ) to refer to the updated MBox or to the updated set of model nodes, respectively.The rules for applying the transformation depend on the structure of the action γ and are reported below.The transformation starts with an initial generic substitution ρ = θ.As the transformation progresses, the generic substitution ρ can be updated only as a result of the evaluation of an action query ϕ over M. Precisely, all the tuples t 1 , ..., t n making ϕ true in M will be considered and composed with the current substitution ρ generating n fresh substitutions ρt 1 , ..., ρt n which are used in the subsequent application of the nested effect β.
Since the core M of the knowledge base K changes at every action execution, its domain of model nodes I M changes as well.The execution of an action γ θ over the knowledge base K = (T , A, S, M) with set of model nodes I M could generate a new K γ θ = (T , A, S, M γ θ ) with a new set of model nodes I M ′ that is not core-complete or not open-consistent (see Section 3 for the corresponding definitions).We illustrate two examples next.
Example 4 (Violation of core-completeness).Consider the case where the general specifications of the system require all objects of type bucket to have a logging configuration, and an action that removes the logging configuration from a bucket.Consider the core-closed knowledge base K where S = {S3::Bucket ⊑ ∃loggingConfiguration} and M = {S3::Bucket(b), loggingConfiguration(b, c)} (consistent wrt S) and the action γ defined as For the input parameter substitution θ = [ x ← b ], it is easy to see that the transformation T γ θ applied to M results in the update M γ θ = {S3::Bucket(b)}, which is not core-complete.

Example 5 (Violation of open-consistency).
Consider the case where an action application indirectly affects boundary nodes and their properties, leading to inconsistencies in the open portion of the knowledge base.For example, when the knowledge base prescribes that buckets used to store logs cannot be public; however, a change in the configuration of a bucket instance causes a second bucket (initially known to be public) to also become a log store.In particular, this happens when the knowledge base K contains the T -axiom ∃loggingDestination − ⊑ ¬PublicBucket and the A-assertion PublicBucket(b), and we apply an action that introduces a new bucket storing its logs to b, defined as follows: createBucketWithLogging(x : name, y : log) = ⊙ x {S3::Bucket(x), loggingDestination(x, y)} For the input parameter substitution θ = [ x ← newBucket, y ← b ], the result of applying the transformation T γ θ is the set M = { S3::Bucket(newBucket), loggingDestination(newBucket, b) } which, combined with the pre-existing and unchanged sets T and A, causes the updated K γ θ to be not open-consistent.
From a practical point of view, the examples highlight the need to re-evaluate core-completeness and open-consistency of a core-closed knowledge base after each action execution.Detecting a violation to core-completeness signals that we have modeled an action that is inconsistent with respect to the systems specifications, which most likely means that the action is missing something and needs to be revised.Detecting a violation to open-consistency signals that our action, even when consistent with respect to the specifications, introduces a change that conflicts with other assumptions that we made about the system, and generally indicates that we should either revise the assumptions or forbid the application of the action.Both cases are important to consider in the development life cycle of the core-closed KB and the action definitions.

Static Verification
In this section, we investigate the problem of computing whether the execution of an action, no matter the specific instantiation, always preserves given properties of core-closed knowledge bases.We focus on properties expressed as Must/May queries and define the static verification problem as follows.
Definition 1 (Static Verification).Let K be a DL-Lite F core-closed knowledge base, q be a Must/ May query, and γ be an action with free variables from the language presented above.Let θ be an assignment for the input variables of γ that transforms γ into the grounded action γ θ.Let K γ θ be the DL-Lite F coreclosed knowledge base resulting from the application of the grounded action γ θ onto K.We say that the action γ "preserves q over K" iff for every grounded instance γ θ we have that ANS(q, K) = ANS(q, K γ θ ).The static verification problem is that of determining whether an action γ is q-preserving over K.
An action γ is not q-preserving over K iff there exists a grounding θ for the input variables of γ such that ANS(q, K) = ANS(q, K γ θ ); that is, fixed the grounding θ there exists a tuple t for q's answer variables such that t ∈ ANS(q, K) ANS(q, K γ θ ) or t ∈ ANS(q, K γ θ ) ANS(q, K).
Theorem 1 (Complexity of the Static Verification Problem).The static verification problem, i.e.deciding whether an action γ is q-preserving over K, can be decided in polynomial time in data complexity.
Proof.The proof relies on the fact that one could: enumerate all possible assignments θ; compute the updated knowledge bases K γ θ ; check whether these are fully satisfiable; enumerate all tuples t for the query q; and, finally, check whether there exists at least one such tuple that satisfies q over K but not K γ θ or vice versa.The number of assignments θ is bounded by |I M ⊎ I K | + ar(γ) ar(γ) as it is sufficient to replace each variable appearing in the action γ either by a known object from I M ⊎ I K or by a fresh one.The computation of the updated K γ θ is done in polynomial time in M (and is exponential in the size of the action γ) as it may require the evaluation of an internal action query ϕ and the consecutive re-application of the transformation for a number of tuples that is bounded by a polynomial over the size of M. As explained in Section 3, checking full satisfiability of the resulting core-closed knowledge base is also polynomial in M.
The number of tuples t is bounded by |I M ⊎ I K | + ar(γ) ar(q) as it is enough to consider all those tuples involving known objects plus the fresh individuals introduced by the assignment θ.Checking whether a tuple t satisfies the query q over a core-closed knowledge base is decided in LogSpace in the size of M [15] which is, thus, also polynomial in M.

Planning
As discussed throughout the paper, the execution of a mutating action modifies the configuration of a deployment and potentially changes its posture with re-spect to a given set of requirements.In the previous two sections, we introduced a language to encode mutating actions and we investigated the problem of checking whether the application of an action preserves the properties of a core-closed knowledge base.In this section, we investigate the plan existence and synthesis problems; that is, the problem of deciding whether there exists a sequence of grounded actions that leads the knowledge base to a state where a certain requirement is met, and the problem of finding a set of such plans, respectively.We start by defining a notion of transition system that is generated by applying actions to a core-closed knowledge base and then use this notion to focus on the mentioned planning problems.As in classical planning, the plan existence problem for plans computed over unbounded domains is undecidable [18,16].The undecidability proof is done via reduction from the Word problem.The problem of deciding whether a deterministic Turing machine M accepts a word w ∈ {0, 1} * is reduced to the plan existence problem.Since undecidability holds even for basic action effects, we can show undecidability over an unbounded domain by using the same encoding of [1].
Transition Systems In the style of the work done in [10,20], the combination of a DL-Lite F core-closed knowledge base and a set of actions can be viewed as the transition system it generates.Intuitively, the states of the transition system correspond to MBoxes and the transitions between states are labeled by grounded actions.A DL-Lite F core-closed knowledge base K = (T , A, S, M 0 ), defined over the possibly infinite set of individuals I (and model nodes I M 0 ⊆ I) and the set Act of ungrounded actions, generates the transition system (TS) Υ K = (I, T , A, S, Σ, M 0 , →) where Σ is a set of fully satisfiable (i.e., core-complete and open-consistent ) MBoxes; M 0 is the initial MBox; and →⊆ Σ × L Act × Σ is a labeled transition relation with L Act the set of all possible grounded actions.The sets Σ and → are defined by mutual induction as the smallest sets such that: if M i ∈ Σ then for every grounded action γ θ ∈ L Act such that the fresh MBox M i+1 resulting from the transformation T γ θ is core-complete and openconsistent, we have that M i+1 ∈ Σ and (M i , γ θ, M i+1 ) ∈→.
Since we assume that actions have input parameters that are replaced during execution by values from I, which contains both known objects from I M ⊎ I K and possibly infinitely many fresh objects, the generated transition system Υ K is generally infinite.To keep the planning problem decidable, we concentrate on a known finite subset D ⊂ I containing all the fresh nodes and value assignments to action variables that are of interest for our application.In the remainder of this paper, we discuss the plan existence and synthesis problem for finite transition systems Υ K = (D, T , A, S, Σ, M 0 , →), whose states in Σ have a domain that is also bounded by D.
The Plan Existence Problem A plan is a sequence of grounded actions whose execution leads to a state satisfying a given property.Let K = (T , A, S, M 0 ) be a DL-Lite F core-closed knowledge base; Act be a set of ungrounded actions; and let Υ K = (D, T , A, S, Σ, M 0 , →) be its generated finite TS.Let π be a finite sequence γ 1 θ 1 • • • γ n θ n of grounded actions taken from the set L Act .We call the sequence π consistent iff there exists a run ρ = M 0 γ1 θ1 Let q be a Must/May query mentioning objects from adom(K) and t a tuple from the set adom(K) ar (q) .A consistent sequence π of grounded actions is a plan from K to ( t, q) iff t ∈ ANS(q, K n = (T , A, S, M n )) with M n the final state of the run induced by π.
Definition 2 (Plan Existence).Given a DL-Lite F core-closed knowledge base K, a tuple t, and a Must/ May query q, the plan existence problem is that of deciding whether there exists a plan from K to ( t, q).Example 6.Let us consider the transition system Υ K generated by the coreclosed knowledge base K = (T , A, S, M 0 ) having the set of partially-closed assertions M 0 defined as { S3::Bucket(b), KMS::Key(k), bucketEncryptionRule(b, r), bucketKey(r, k), bucketKeyEnabled(r, true), enableKeyRotation(k, f alse) } and the set of action labels Act containing the actions deleteBucket, createBucket, deleteKey, createKey, enableKeyRotation, putBucketEncryption, and deleteBucke-tEncryption.Let us assume that we are interested in verifying the existence of a sequence of grounded actions that when applied onto the knowledge base would configure the bucket node b to be encrypted with a rotating key.Formally, this is equivalent to checking the existence of a consistent plan π that when executed on the transition system Υ K leads to a state M n such that the tuple t = b is in the set ANS(q, K n = (T , A, S, M n )) for q the query q[x] = S3 :: Bucket(x) ∧ Must ∃y, z. bucketSSEncryption(x, y) ∧ bucketKey(y, z) ∧ enableKeyRotation(z, true) It is easy to see that the following three sequences of grounded actions are valid plans from K to (b, q): If, for example, a bucket was only allowed to have one encryption (by means of a functional axiom in S), then π 2 would not be a valid plan, as it would generate an inconsistent run leading to a state M i that is not open-consistent w.r.t. S. Lemma 3. The plan existence problem for a finite transition system Υ K generated by a DL-Lite F core-closed knowledge base K and a set of actions Act, over a finite domain of objects D, reduces to graph reachability over a graph whose number of states is at most exponential in the size of D.
The Plan Synthesis Problem We now focus on the problem of finding plans that satisfy a given condition.As discussed in the previous paragraph, we are mostly driven by query answering; in particular, by conditions corresponding to a tuple (of objects from our starting deployment configuration) satisfying a given requirement expressed as a Must/May query.Clearly, this problem is meaningful in our application of interest because it corresponds to finding a set of potential sequences of changes that would allow one to reach a configuration satisfying (resp., not satisfying) one, or more, security mitigations (resp., vulnerabilities).We concentrate on DL-Lite F core-closed knowledge bases and their generated finite transition systems, where potential fresh objects are drawn from a fixed set D. We are interested in sequences of grounded actions that are minimal and ignore sequences that extend these.We sometimes call such mimimal sequences simple plans.A plan π from an initial core-closed knowledge base K to a goal condition b is minimal (or simple) iff there does not exist a plan π ′ (from the same initial K to the same goal condition b) s.t.π = π ′ • σ, for σ a non-empty suffix of grounded actions.
In Algorithm 1, we present a depth-first search algorithm that, starting from K, searches for all simple plans that achieve a given target query membership condition.The transition system Υ K is computed, and stored, on the fly in the Successors sub-procedure and the graph is explored in a depth-first search traversal fashion.We note that the condition t ∈ ANS(q, T , A, S, M ) (line 9) could be replaced by any other query satisfiability condition and that one could easily rewrite the algorithm to be parameterized by a more general boolean goal.For example, the condition that a given tuple t is not an answer to a query q over the analyzed state, with the query q representing an undesired configuration, or a boolean formula over multiple query membership assertions.We also note that Algorithm 1 could be simplified to return only one simple plan, if a plan exists, or NULL, if a plan does not exist, thus solving the so-called plan generation problem.We include the modified algorithm in Appendix A.1 and the proofs of the following Theorems in Appendices A.2 and A.3.
Theorem 2 (Minimal Plan Synthesis Correctness).Let K be a DL-Lite F core-closed knowledge base, D be a fixed finite domain, Act be a set of ungrounded action labels, and t, q be a goal.Then a plan π is returned by the algorithm FindPlans(K, D, Act, t, q ) if and only if π is a minimal plan from K to t, q .
Theorem 3 (Minimal Plan Synthesis Complexity).The FindPlans algorithm runs in polynomial time in M and exponential time in D.

Related Work
The syntax of the action language that we presented in this paper is similar to that of [1,12,13].Differently from their work, we disallow complex action effects to be nested inside conditional statements, and we define basic action effects that consist purely in the addition and deletion of concept and role M-assertions.Thus, our actions are much less general than those used in their framework.
The semantics of their action language is defined in terms of changes applied to instances, and the action effects are captured and encoded through a variant of ALCHOIQ called ALCHOIQ br .In our work, instead, the execution of an action updates a portion of the core-closed knowledge base K-the core M, which is interpreted under a close-world assumption and can be seen as a partial assignment for the interpretations that are models of K. Since we directly manipulate M, the semantics of our actions is more similar to that of [20] and, in general, to ABox updates [21,22].Like the frameworks introduced in [19,11,9,10], our actions are parameterized and when combined with a core-closed knowledge base generate a transition system.In [11], the authors focus on a variant of Knowledge and Action Bases ( [20]) called Explicit-Input KABs (eKABs); in particular, on finite and on state-bounded eKABs, for which planning existence is decidable.Our generated transition systems are an adaptation of the work done in Description Logic based Dynamic Systems, KABs, and eKABs to our setting of core-closed knowledge bases.In [23], the authors address decidability of the plan existence problem for logics that are subset of ALCOI.Their action language is similar to the one presented in this paper; including pre-conditions, in the form of a set of ABox assertions, post-conditions, in the form of basic addition or removal of assertions, concatenation, and input parameters.In [11], the plan synthesis problem is discussed also for lightweight description logics.Relying on the FOL-reducibility of DL-Lite A , it is shown that plan synthesis over DL-Lite A can be compiled into an ADL planning problem [24].This does not seem possible in our case, as not all necessary tests over core-closed knowledge bases are known to be FOL-reducible.In [10] and [9], the authors concentrate on verifying and synthesizing temporal properties expressed in a variant of µ-calculus over description logic based dynamic systems, both problems are relevant in our application scenario and we will consider them in future works.

Conclusion
We focused on the problem of analyzing cloud infrastructure encoded as description logic knowledge bases combining complete and incomplete information.From a practical standpoint, we concentrated on formalizing and foreseeing the impact of potential changes pre-deployment.We introduced an action language to encode mutating actions, whose semantics is given in terms of changes induced to the complete portion of the knowledge base.We defined the static verification problem as that of deciding whether the execution of an action, no matter the specific parameters passed, always preserves a set of properties of the knowledge base.We characterized the complexity of the problem and provided procedural steps to solve it.We then focused on three formulations of the classical AI planning problem; namely, plan existence, generation, and synthesis.In our setting, the planning problem is formulated with respect to the transition system arising from the combination of a core-closed knowledge base and a set of actions; goals are given in terms of one, or more, Must/May conjunctive query membership assertion; and plans of interest are simple sequences of parameterized actions.
(of individuals), all partitioned into an open subset and a partially-closed subset.That is, the set of concepts is partitioned into the open concepts C K and the closed (specification) concepts C S ; the set of roles is partitioned into open roles R K and closed (specification) roles R S ; and the set of individuals is partitioned into open individuals I K and closed (model) individuals I M .We call C S and R S core-closed predicates, or partially-closed predicates, as their extension is closed over the core domain I M and open otherwise.In contrast, we call C K and R K open predicates.The syntax of concept and role expressions in DL-Lite F [2,8] is as follows: