Schema For REST Collector Plug-in Mapper File

See how to set up a schema for a REST collector plug-in mapper file for Oracle Database Security Central.

In the following example, you can see how to set up a schema:

Example 7 REST Collector Plug-in Mapper File

<?xml version="1.0"?>

<!--
 Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
-->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<xsd:include schemaLocation="ezCollectorTemplate_schema.xsd" />

	<!-- Field ValueTransformation Type-->
	<xsd:complexType name="ParamType">
		<xsd:attribute name="Name" type="xsd:string" use="required"/>
		<xsd:attribute name="Value" type="xsd:string" use="required"/>
	</xsd:complexType>
	<!-- Field Transformation Type-->
	<xsd:complexType name="AuthenticationParamType">
		<xsd:sequence>
			<xsd:element name="Param" type="ParamType" minOccurs="0" maxOccurs="20" />
		</xsd:sequence>
	</xsd:complexType>
	<!-- XML Document Structure -->
	<xsd:element name="AVRESTCollectorTemplate">
		<xsd:complexType>
			<xsd:all>
				<xsd:element name="ResourceName" type="xsd:string"
					minOccurs="1" maxOccurs="1" />
				<xsd:element name="HeaderInfo" minOccurs="0" maxOccurs="1">
					<xsd:complexType>
						<xsd:all>
							<!-- StartTag tag contains Root element of XML Audit data file -->
							<xsd:element name="StartTag" type="xsd:string"
								minOccurs="0" maxOccurs="1" />
						</xsd:all>
					</xsd:complexType>
				</xsd:element>
				<xsd:element name="RecordInfo" minOccurs="1" maxOccurs="1">
					<xsd:complexType>
						<xsd:all>
							<!-- start tag of xml audit record in XML audit file -->
							<xsd:element name="StartTag" type="xsd:string"
								minOccurs="1" maxOccurs="1" />
						</xsd:all>
					</xsd:complexType>
				</xsd:element>
				<xsd:element name="ServiceDetails" minOccurs="1"
					maxOccurs="1">
					<xsd:complexType>
						<xsd:all>
							<xsd:element name="QueryFormat" type="xsd:string"
								minOccurs="1" maxOccurs="1" />
							<xsd:element name="TimeFormat" type="xsd:string"
								minOccurs="1" maxOccurs="1" />
							<xsd:element name="NextLink" minOccurs="0" maxOccurs="1">
								<xsd:complexType>
									<xsd:all>
										<xsd:element name="NextLinkStartTag" type="xsd:string"
											minOccurs="0" maxOccurs="1" />
										<xsd:element name="NextLinkPattern" type="xsd:string"
											minOccurs="1" maxOccurs="1" />
									</xsd:all>
								</xsd:complexType>
							</xsd:element>
							<xsd:element name="RESTAuthentication" minOccurs="1"
								maxOccurs="1">
								<xsd:complexType>
									<xsd:all>
									    <xsd:element name="BasicAuth" minOccurs="0" maxOccurs="1"> </xsd:element>
										<xsd:element name="OAuth2.0" minOccurs="0"
											maxOccurs="1">
											<xsd:complexType>
												<xsd:all>
												   <xsd:element name="grant_type" type="xsd:string"
														minOccurs="0" maxOccurs="1" />
												   <xsd:element name="scope" type="xsd:string"
														minOccurs="0" maxOccurs="1" />
												</xsd:all>
											</xsd:complexType>
										</xsd:element>
										<xsd:element name="Custom" minOccurs="0" maxOccurs="1">
											<xsd:complexType>
												<xsd:all>
													<xsd:element name="authentication_class" type="xsd:string"
														minOccurs="1" maxOccurs="1" />
													<xsd:element name="AuthenticationParam" type="AuthenticationParamType"
														minOccurs="0" maxOccurs="1" />
												</xsd:all>
											</xsd:complexType>
										</xsd:element>
									</xsd:all>
								</xsd:complexType>
							</xsd:element>
						</xsd:all>
					</xsd:complexType>
				</xsd:element>
				<!-- Secured Target to AV server fields Mapping for Core, Large, Extension
					fields and Marker -->
				<xsd:element name="FieldMappingInfo" type="FieldMappingInfoType"
					minOccurs="1" maxOccurs="1" />
				<!-- Event Filter. This is optional. If it is not used, all the audit
					events will be collected -->
				<xsd:element name="EventFilter" type="EventFilterType"
					minOccurs="0" maxOccurs="1" />
			</xsd:all>
			<!-- Secured Target Type -->
			<xsd:attribute name="securedTargetType" type="xsd:string"
				use="required" />
			<!-- Max Secured Target version supported by the template -->
			<xsd:attribute name="maxSecuredTargetVersion" type="xsd:string"
				use="required" />
			<!-- Min Secured Target version supported by the template -->
			<xsd:attribute name="minSecuredTargetVersion" type="xsd:string" />
			<!-- Template file version -->
			<xsd:attribute name="version" type="xsd:string" use="required" />
		</xsd:complexType>
	</xsd:element>
</xsd:schema>