Michael Mokry | e957a1d | 2018-09-10 15:23:15 -0500 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
| 2 | <!-- |
| 3 | ============LICENSE_START================================================== |
| 4 | ONAP Policy Engine |
| 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:xacml:policy:id:d56af069-6cf1-430c-ba07-e26602e06a52" Version="1" RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:permit-unless-deny"> |
| 22 | <Description>${description}</Description> |
| 23 | <Target> |
| 24 | <AnyOf> |
| 25 | <AllOf> |
| 26 | <Match MatchId="org.onap.function.regex-match"> |
| 27 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">${PolicyName}</AttributeValue> |
| 28 | <AttributeDesignator Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" AttributeId="PolicyName" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/> |
| 29 | </Match> |
| 30 | </AllOf> |
| 31 | <AllOf> |
| 32 | <Match MatchId="org.onap.function.regex-match"> |
| 33 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">${ONAPName}</AttributeValue> |
| 34 | <AttributeDesignator Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" AttributeId="ONAPName" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/> |
| 35 | </Match> |
| 36 | <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match"> |
| 37 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">(?i)${actor}</AttributeValue> |
| 38 | <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="actor" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/> |
| 39 | </Match> |
| 40 | <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match"> |
| 41 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">(?i)${recipe}</AttributeValue> |
| 42 | <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="recipe" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/> |
| 43 | </Match> |
| 44 | <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match"> |
| 45 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">${targets}</AttributeValue> |
| 46 | <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="target" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/> |
| 47 | </Match> |
| 48 | <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match"> |
| 49 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">${clname}</AttributeValue> |
| 50 | <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="clname" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/> |
| 51 | </Match> |
| 52 | </AllOf> |
| 53 | </AnyOf> |
| 54 | </Target> |
| 55 | <Rule RuleId="urn:com:xacml:rule:id:284d9393-f861-4250-b62d-fc36640a363a" Effect="Permit"> |
| 56 | <Target> |
| 57 | <AnyOf> |
| 58 | <AllOf> |
| 59 | <Match MatchId="urn:oasis:names:tc:xacml:3.0:function:string-equal-ignore-case"> |
| 60 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">DECIDE</AttributeValue> |
| 61 | <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/> |
| 62 | </Match> |
| 63 | </AllOf> |
| 64 | </AnyOf> |
| 65 | </Target> |
| 66 | <Condition> |
Michael Mokry | a290a5f | 2018-09-11 15:25:58 -0500 | [diff] [blame^] | 67 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:and"> |
| 68 | <Apply FunctionId="urn:oasis:names:tc:xacml:2.0:function:time-in-range"> |
| 69 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:time-one-and-only"> |
| 70 | <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"/> |
| 71 | </Apply> |
| 72 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#time">${guardActiveStart}</AttributeValue> |
| 73 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#time">${guardActiveEnd}</AttributeValue> |
| 74 | </Apply> |
| 75 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-greater-than-or-equal"> |
| 76 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-one-and-only"> |
| 77 | <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="vfCount" DataType="http://www.w3.org/2001/XMLSchema#integer" MustBePresent="false"/> |
| 78 | </Apply> |
| 79 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">${min}</AttributeValue> |
| 80 | </Apply> |
| 81 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-less-than-or-equal"> |
| 82 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-one-and-only"> |
| 83 | <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="vfCount" DataType="http://www.w3.org/2001/XMLSchema#integer" MustBePresent="false"/> |
| 84 | </Apply> |
| 85 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">${max}</AttributeValue> |
| 86 | </Apply> |
| 87 | </Apply> |
| 88 | </Condition> |
| 89 | </Rule> |
| 90 | <Rule RuleId="urn:com:xacml:rule:id:284d9393-f861-4250-b62d-fc36640a363a" Effect="Deny"> |
| 91 | <Target> |
| 92 | <AnyOf> |
| 93 | <AllOf> |
| 94 | <Match MatchId="urn:oasis:names:tc:xacml:3.0:function:string-equal-ignore-case"> |
| 95 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">DECIDE</AttributeValue> |
| 96 | <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="false"/> |
| 97 | </Match> |
| 98 | </AllOf> |
| 99 | </AnyOf> |
| 100 | </Target> |
| 101 | <Condition> |
Michael Mokry | e957a1d | 2018-09-10 15:23:15 -0500 | [diff] [blame] | 102 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:not"> |
| 103 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:and"> |
| 104 | <Apply FunctionId="urn:oasis:names:tc:xacml:2.0:function:time-in-range"> |
| 105 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:time-one-and-only"> |
| 106 | <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"/> |
| 107 | </Apply> |
| 108 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#time">${guardActiveStart}</AttributeValue> |
| 109 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#time">${guardActiveEnd}</AttributeValue> |
| 110 | </Apply> |
| 111 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-greater-than-or-equal"> |
| 112 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-one-and-only"> |
| 113 | <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="vfCount" DataType="http://www.w3.org/2001/XMLSchema#integer" MustBePresent="false"/> |
| 114 | </Apply> |
| 115 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">${min}</AttributeValue> |
| 116 | </Apply> |
| 117 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-less-than-or-equal"> |
| 118 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-one-and-only"> |
| 119 | <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="vfCount" DataType="http://www.w3.org/2001/XMLSchema#integer" MustBePresent="false"/> |
| 120 | </Apply> |
| 121 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">${max}</AttributeValue> |
| 122 | </Apply> |
| 123 | </Apply> |
| 124 | </Apply> |
| 125 | </Condition> |
Michael Mokry | e957a1d | 2018-09-10 15:23:15 -0500 | [diff] [blame] | 126 | <AdviceExpressions> |
| 127 | <AdviceExpression AdviceId="GUARD_MIN_MAX" AppliesTo="Deny"> |
| 128 | <AttributeAssignmentExpression AttributeId="guard.response" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource"> |
| 129 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Denied By Guard</AttributeValue> |
| 130 | </AttributeAssignmentExpression> |
| 131 | </AdviceExpression> |
| 132 | </AdviceExpressions> |
| 133 | </Rule> |
| 134 | </Policy> |