Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
Jim Hahn | daee922 | 2018-04-19 11:28:41 -0400 | [diff] [blame^] | 2 | <!-- |
| 3 | ============LICENSE_START================================================== |
| 4 | ONAP Policy Engine |
| 5 | =========================================================================== |
| 6 | Copyright (C) 2017-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 | --> |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 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"> |
Tej, Tarun | e038592 | 2017-09-15 00:52:13 -0400 | [diff] [blame] | 37 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">(?i)${actor}</AttributeValue> |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 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"> |
Tej, Tarun | e038592 | 2017-09-15 00:52:13 -0400 | [diff] [blame] | 41 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">(?i)${recipe}</AttributeValue> |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 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> |
| 67 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:not"> |
| 68 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:and"> |
| 69 | <Apply FunctionId="urn:oasis:names:tc:xacml:2.0:function:time-in-range"> |
| 70 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:time-one-and-only"> |
| 71 | <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"/> |
| 72 | </Apply> |
| 73 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#time">${guardActiveStart}</AttributeValue> |
| 74 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#time">${guardActiveEnd}</AttributeValue> |
| 75 | </Apply> |
| 76 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-greater-than-or-equal"> |
| 77 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-one-and-only"> |
| 78 | <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="count" DataType="http://www.w3.org/2001/XMLSchema#integer" Issuer="org:onap:xacml:guard:historydb:tw:${twValue}:${twUnits}" MustBePresent="false"/> |
| 79 | </Apply> |
| 80 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">${limit}</AttributeValue> |
| 81 | </Apply> |
| 82 | </Apply> |
| 83 | </Apply> |
| 84 | </Condition> |
| 85 | </Rule> |
| 86 | <Rule RuleId="urn:com:xacml:rule:id:284d9393-f861-4250-b62d-fc36640a363a" Effect="Deny"> |
| 87 | <Target> |
| 88 | <AnyOf> |
| 89 | <AllOf> |
| 90 | <Match MatchId="urn:oasis:names:tc:xacml:3.0:function:string-equal-ignore-case"> |
| 91 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">DECIDE</AttributeValue> |
| 92 | <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"/> |
| 93 | </Match> |
| 94 | </AllOf> |
| 95 | </AnyOf> |
| 96 | </Target> |
| 97 | <Condition> |
| 98 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:not"> |
| 99 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:not"> |
| 100 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:and"> |
| 101 | <Apply FunctionId="urn:oasis:names:tc:xacml:2.0:function:time-in-range"> |
| 102 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:time-one-and-only"> |
| 103 | <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"/> |
| 104 | </Apply> |
| 105 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#time">${guardActiveStart}</AttributeValue> |
| 106 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#time">${guardActiveEnd}</AttributeValue> |
| 107 | </Apply> |
| 108 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-greater-than-or-equal"> |
| 109 | <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:integer-one-and-only"> |
| 110 | <AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" AttributeId="count" DataType="http://www.w3.org/2001/XMLSchema#integer" Issuer="org:onap:xacml:guard:historydb:tw:${twValue}:${twUnits}" MustBePresent="false"/> |
| 111 | </Apply> |
| 112 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">${limit}</AttributeValue> |
| 113 | </Apply> |
| 114 | </Apply> |
| 115 | </Apply> |
| 116 | </Apply> |
| 117 | </Condition> |
| 118 | <AdviceExpressions> |
| 119 | <AdviceExpression AdviceId="GUARD_YAML" AppliesTo="Deny"> |
| 120 | <AttributeAssignmentExpression AttributeId="guard.response" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource"> |
| 121 | <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Denied!</AttributeValue> |
| 122 | </AttributeAssignmentExpression> |
| 123 | </AdviceExpression> |
| 124 | </AdviceExpressions> |
| 125 | </Rule> |
| 126 | </Policy> |