Add missing license headers
[policy/drools-applications.git] / controlloop / common / guard / src / test / resources / blacklist_template.xml
1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 <!--
3   ============LICENSE_START=======================================================
4   drools-applications
5   ================================================================================
6   Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
7   ================================================================================
8   Licensed under the Apache License, Version 2.0 (the "License");
9   you may not use this file except in compliance with the License.
10   You may obtain a copy of the License at
11   
12        http://www.apache.org/licenses/LICENSE-2.0
13   
14   Unless required by applicable law or agreed to in writing, software
15   distributed under the License is distributed on an "AS IS" BASIS,
16   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17   See the License for the specific language governing permissions and
18   limitations under the License.
19   ============LICENSE_END=========================================================
20   -->
21 <Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="urn:com:att:xacml:policy:id:25e12b06-11d5-4895-b2a2-6f6c594de069" Version="1" RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:permit-unless-deny">
22         <Description>Policy for frequency limiter.</Description>
23         <Target>
24             <AnyOf>
25                 <AllOf>
26                         <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match">
27                         <!-- <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">.*</AttributeValue>-->
28                         <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">${clname}</AttributeValue>
29                         <AttributeDesignator Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" AttributeId="urn:oasis:names:tc:xacml:1.0:clname:clname-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
30                         </Match>
31              
32                         <!--  <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">-->
33                         <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match">
34                         <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">${actor}</AttributeValue>
35                         <AttributeDesignator Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" AttributeId="urn:oasis:names:tc:xacml:1.0:actor:actor-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
36                     </Match>
37                     <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match">
38                         <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">${recipe}</AttributeValue>
39                         <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" AttributeId="urn:oasis:names:tc:xacml:1.0:operation:operation-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
40                     </Match>
41                 </AllOf>
42             </AnyOf>
43         </Target>
44         <Rule RuleId="urn:com:att:xacml:rule:id:e1e8c5c0-e2ba-47d5-9289-6c015305ed21" Effect="Deny">
45             <Description>DENY -  only if target is in black list and guard is active.</Description>
46             <Condition>
47                 <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:and">
48                         <VariableReference VariableId="isGuardActive"/>
49                         <VariableReference VariableId="isInBlackList"/>
50                 </Apply>
51             </Condition>
52         </Rule>
53          <VariableDefinition VariableId="isInBlackList">
54                         <Apply FunctionId="urn:oasis:names:tc:xacml:3.0:function:any-of">
55                                 <Function FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal"/>
56                                         <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-one-and-only">
57                                                 <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="urn:oasis:names:tc:xacml:1.0:target:target-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/>
58                                         </Apply>
59                                         <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag">
60                                                 ${blackListElement}
61                                                 <!-- <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">vserver.vserver-name</AttributeValue>-->
62                                         </Apply>
63                    </Apply>
64                 </VariableDefinition>
65         <VariableDefinition VariableId="isGuardActive"> 
66                 <Apply FunctionId="urn:oasis:names:tc:xacml:2.0:function:time-in-range">
67                         <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:time-one-and-only">
68                         <AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:environment:current-time" DataType="http://www.w3.org/2001/XMLSchema#time" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:environment" MustBePresent="false"/>
69                                 </Apply>
70                                 <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#time">${guardActiveStart}</AttributeValue>
71                                 <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#time">${guardActiveEnd}</AttributeValue>
72                 </Apply>
73         </VariableDefinition> 
74 </Policy>