This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
/
x-macos-pkgutil.xsd
158 lines (158 loc) · 12.8 KB
/
x-macos-pkgutil.xsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:oval="http://oval.mitre.org/XMLSchema/oval-common-5" xmlns:oval-def="http://oval.mitre.org/XMLSchema/oval-definitions-5" xmlns:oval-sc="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5" xmlns:macos-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#macos" xmlns:macos-sc="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#macos" xmlns:x-macos-pkgutil="http://oval.mitre.org/XMLSchema/x-macos-pkgutil" xmlns:sch="http://purl.oclc.org/dsdl/schematron" targetNamespace="http://oval.mitre.org/XMLSchema/x-macos-pkgutil" elementFormDefault="qualified" version="5.11">
<xsd:import namespace="http://oval.mitre.org/XMLSchema/oval-definitions-5" schemaLocation="oval-definitions-schema.xsd"/>
<xsd:import namespace="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5" schemaLocation="oval-system-characteristics-schema.xsd"/>
<xsd:annotation>
<xsd:documentation>The following is a proposal for the experimental macos-def:pkgutil_test and macos-sc:pkgutil_item that will support checking a Mac OS system to see if a particular package is installed.</xsd:documentation>
<xsd:appinfo>
<schema>Experimental Schema for the Mac OS Pkgutil Test</schema>
<version>5.11</version>
<date>3/4/2012 8:00:00 PM</date>
<terms_of_use>Copyright (c) 2002-2012, The MITRE Corporation. All rights reserved. The contents of this file are subject to the terms of the OVAL License located at http://oval.mitre.org/oval/about/termsofuse.html. See the OVAL License for the specific language governing permissions and limitations for use of this schema. When distributing copies of the OVAL Schema, this license header must be included.</terms_of_use>
<sch:ns prefix="oval-def" uri="http://oval.mitre.org/XMLSchema/oval-definitions-5"/>
<sch:ns prefix="oval-sc" uri="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5"/>
<sch:ns prefix="macos-def" uri="http://oval.mitre.org/XMLSchema/oval-definitions-5#macos"/>
<sch:ns prefix="macos-sc" uri="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#macos"/>
<sch:ns prefix="x-macos-pkgutil" uri="http://oval.mitre.org/XMLSchema/x-macos-pkgutil"/>
<sch:ns prefix="xsi" uri="http://www.w3.org/2001/XMLSchema-instance"/>
</xsd:appinfo>
</xsd:annotation>
<!-- =============================================================================== -->
<!-- =============================== PKGUTIL TEST ================================ -->
<!-- =============================================================================== -->
<xsd:element name="pkgutil_test" substitutionGroup="oval-def:test">
<xsd:annotation>
<xsd:documentation>This test supports the collection of system state information related to packages installed using the pkgutil utility on Mac OS systems. See pkgutil(1) for more information.</xsd:documentation>
<xsd:appinfo>
<oval:element_mapping>
<oval:test>pkgutil_test</oval:test>
<oval:object>pkgutil_object</oval:object>
<oval:state>pkgutil_state</oval:state>
<oval:item>pkgutil_item</oval:item>
</oval:element_mapping>
</xsd:appinfo>
<xsd:appinfo>
<sch:pattern id="x-macos-pkgutil_pkgutil_test">
<sch:rule context="x-macos-pkgutil:pkgutil_test/x-macos-pkgutil:object">
<sch:assert test="@object_ref=ancestor::oval-def:oval_definitions/oval-def:objects/x-macos-pkgutil:pkgutil_object/@id"><sch:value-of select="../@id"/> - the object child element of an pkgutil_test must reference an pkgutil_object</sch:assert>
</sch:rule>
<sch:rule context="x-macos-pkgutil:pkgutil_test/x-macos-pkgutil:state">
<sch:assert test="@state_ref=ancestor::oval-def:oval_definitions/oval-def:states/x-macos-pkgutil:pkgutil_state/@id"><sch:value-of select="../@id"/> - the state child element of an pkgutil_test must reference an pkgutil_state</sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:TestType">
<xsd:sequence>
<xsd:element name="object" type="oval-def:ObjectRefType" />
<xsd:element name="state" type="oval-def:StateRefType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="pkgutil_object" substitutionGroup="oval-def:object">
<xsd:annotation>
<xsd:documentation>The pkgutil_object element is used by an pkgutil_test to define the items to be collected.</xsd:documentation>
<xsd:documentation>An pkgutil_object consists of a single package ID entity that identifies the package(s) on the system to collect.</xsd:documentation>
<xsd:appinfo>
<sch:pattern id="x-macos-pkgutil_pkgutil_object_verify_filter_state">
<sch:rule context="x-macos-pkgutil:pkgutil_object//oval-def:filter">
<sch:let name="parent_object" value="ancestor::x-macos-pkgutil:pkgutil_object"/>
<sch:let name="parent_object_id" value="$parent_object/@id"/>
<sch:let name="state_ref" value="."/>
<sch:let name="reffed_state" value="ancestor::oval-def:oval_definitions/oval-def:states/*[@id=$state_ref]"/>
<sch:let name="state_name" value="local-name($reffed_state)"/>
<sch:let name="state_namespace" value="namespace-uri($reffed_state)"/>
<sch:assert test="(($state_namespace='http://oval.mitre.org/XMLSchema/oval-definitions-5#macos') and ($state_name='pkgutil_state'))">State referenced in filter for <sch:value-of select="name($parent_object)"/> '<sch:value-of select="$parent_object_id"/>' is of the wrong type. </sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:ObjectType">
<xsd:sequence>
<xsd:choice>
<xsd:element ref="oval-def:set"/>
<xsd:sequence>
<xsd:element name="pkg_id" type="oval-def:EntityObjectStringType">
<xsd:annotation>
<xsd:documentation>Specifies the installed package(s) on the system to collect.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="oval-def:filter" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:choice>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="pkgutil_state" substitutionGroup="oval-def:state">
<xsd:annotation>
<xsd:documentation>The pkgutil_state element defines the different system information that can be used to evaluate the specified packages.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:StateType">
<xsd:sequence>
<xsd:element name="pkg_id" type="oval-def:EntityStateStringType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Specifies the package ID of a package installed on the system.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<!-- =============================================================================== -->
<!-- =============================== PKGUTIL ITEM ================================ -->
<!-- =============================================================================== -->
<xsd:element name="pkgutil_item" substitutionGroup="oval-sc:item">
<xsd:annotation>
<xsd:documentation>This item stores system state information associated with packages installed on a Mac OS system.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-sc:ItemType">
<xsd:sequence>
<xsd:element name="pkg_id" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Specifies the package ID of a package installed on the system.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="version" type="oval-sc:EntityItemVersionType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Specifies the version of the package installed on the system.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="volume" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Specifies the volume where the installed package is located on the system.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="location" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Specifies the location of the installed package on the system.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="install_time" type="oval-sc:EntityItemIntType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Specifies the time when the package was installed on the system.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="group" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>Specifies the package groups that the installed package is part of on the system.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
</xsd:schema>