1<?xml version="1.0" encoding="UTF-8"?> 2<!-- Copyright (c) 2021 Huawei Device Co., Ltd. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15--> 16<!-- OAT(OSS Audit Tool) configuration guide: 17basedir: Root dir, the basedir + project path is the real source file location. 18licensefile: 191.If the project don't have "LICENSE" in root dir, please define all the license files in this project in , OAT will check license files according to this rule. 20 21tasklist(only for batch mode): 221. task: Define oat check thread, each task will start a new thread. 232. task name: Only an name, no practical effect. 243. task policy: Default policy for projects under this task, this field is required and the specified policy must defined in policylist. 254. task filter: Default filefilter for projects under this task, this field is required and the specified filefilter must defined in filefilterlist. 265. task project: Projects to be checked, the path field define the source root dir of the project. 27 28 29policyList: 301. policy: All policyitems will be merged to default OAT.xml rules, the name of policy doesn't affect OAT check process. 312. policyitem: The fields type, name, path, desc is required, and the fields rule, group, filefilter is optional,the default value is: 32<policyitem type="" name="" path="" desc="" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter"/> 333. policyitem type: 34 "compatibility" is used to check license compatibility in the specified path; 35 "license" is used to check source license header in the specified path; 36 "copyright" is used to check source copyright header in the specified path; 37 "import" is used to check source dependency in the specified path, such as import ... ,include ... 38 "filetype" is used to check file type in the specified path, supported file types: archive, binary 39 "filename" is used to check whether the specified file exists in the specified path(support projectroot in default OAT.xml), supported file names: LICENSE, README, README.OpenSource 40 414. policyitem name: This field is used for define the license, copyright, "*" means match all, the "!" prefix means could not match this value. For example, "!GPL" means can not use GPL license. 425. policyitem path: This field is used for define the source file scope to apply this policyitem, the "!" prefix means exclude the files. For example, "!.*/lib/.*" means files in lib dir will be exclude while process this policyitem. 436. policyitem rule and group: These two fields are used together to merge policy results. "may" policyitems in the same group means any one in this group passed, the result will be passed. 447. policyitem filefilter: Used to bind filefilter which define filter rules. 458. filefilter: Filter rules, the type filename is used to filter file name, the type filepath is used to filter file path. 46 47Note:If the text contains special characters, please escape them according to the following rules: 48" == > 49& == > 50' == > 51< == > 52> == > 53--> 54<configuration> 55 <oatconfig> 56 <licensefile>COPYING</licensefile> 57 <policylist> 58 <policy name="projectPolicy" desc=""> 59 <policyitem type="compatibility" name="The curl license" path=".*" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter" desc=""/> 60 <policyitem type="compatibility" name="curl" path=".*" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter" desc=""/> 61 <policyitem type="compatibility" name="ISC License" path=".*" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter" desc=""/> 62 </policy> 63 </policylist> 64 <licensematcherlist> 65 <licensematcher name="The curl license" desc="If the scanning result is InvalidLicense, you can define matching rules here. Note that quotation marks must be escaped."> 66 <licensetext name=" 67 * This software is licensed as described in the file COPYING, which 68 * you should have received as part of this distribution. The terms 69 * are also available at https://curl.se/docs/copyright.html. 70 * 71 * You may opt to use, copy, modify, merge, publish, distribute and/or sell 72 * copies of the Software, and permit persons to whom the Software is 73 * furnished to do so, under the terms of the COPYING file. 74 " desc=""/> 75 <licensetext name=" 76 * Permission to use, copy, modify, and distribute this software for any 77 * purpose with or without fee is hereby granted, provided that the above 78 * copyright notice and this permission notice appear in all copies. 79 * 80 * THE SOFTWARE IS PROVIDED >AS IS> AND INTERNET SOFTWARE CONSORTIUM 81 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL 82 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL 83 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, 84 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 85 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 86 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 87 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 88 " desc=""/> 89 </licensematcher> 90 </licensematcherlist> 91 <filefilterlist> 92 <filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies"> 93 <filteritem type="filename" name="macos_main.cpp" desc=""/> 94 <filteritem type="filename" name="test17" desc=""/> 95 <filteritem type="filename" name="*.sh" desc=""/> 96 <filteritem type="filename" name="*.bat" desc=""/> 97 <filteritem type="filename" name="*.cmd" desc=""/> 98 <filteritem type="filename" name="*.m4" desc=""/> 99 <filteritem type="filepath" name="docs/.*" desc=""/>S 100 </filefilter> 101 <filefilter name="copyrightPolicyFilter" desc="Filters for copyright header policies"> 102 </filefilter> 103 <filefilter name="licenseFileNamePolicyFilter" desc="Filters for LICENSE file policies"> 104 </filefilter> 105 <filefilter name="binaryFileTypePolicyFilter" desc="File not used"> 106 <filteritem type="filepath" name="tests/.*" desc=""/> 107 </filefilter> 108 <filefilter name="publicCAFilePolicyFilter" desc="Filters for public CA file policies"> 109 <filteritem type="filepath" name="cacert.pem" desc="This is a bundle of X.509 certificates of public 110 Certificate Authorities(CA) downloaded from https://curl.se/docs/caextract.html"/> 111 </filefilter> 112 </filefilterlist> 113 </oatconfig> 114</configuration> 115