2017-01-09 2 views
1

私はSCAP実装を進めており、ARFレポートにベンダー資産タ​​イプを追加する必要があります。資産タイプの実装をして: 資産識別XSDは、ここで(AI接頭辞を使用)別のNSから抽象的なxsd要素を拡張する方法

だから、私はいくつかのベンダーを追加して達成することができないことは愛https://scap.nist.gov/schema/asset-identification/1.1/asset-identification_1.1.0.xsdある ARFスキーマは次の場所にあります。https://scap.nist.gov/schema/asset-reporting-format/1.1/asset-reporting-format_1.1.0.xsd(ARF接頭辞を使用します) ARFスキーマを検証するARFレポート。私は、ai:asset-typeを拡張し、substitutionGroup = "ai:asset"属性を持つ要素を定義するだけのベンダー名前空間を書きましたが、このベンダー要素をARFスキーマに対して使用するレポートを検証すると、資産ID NSで定義されているすべての子のみを返します。しかし、AIスキーマは拡張を可能にすることになっています。何か案が ?

編集:

<?xml version="1.0" encoding="UTF-8"?> 
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ai="http://scap.nist.gov/schema/asset-identification/1.1" 
      xmlns:my-ns="http://mydomain/schema/scap/asset-identification/1.0" 
      targetNamespace="http://mydomain/schema/scap/asset-identification/1.0" elementFormDefault="qualified" 
      attributeFormDefault="unqualified" version="1.1.1" xmlns:cpe-name="http://cpe.mitre.org/naming/2.0"> 
    <xs:import namespace="http://scap.nist.gov/schema/asset-identification/1.1" schemaLocation="https://scap.nist.gov/schema/asset-identification/1.1/asset-identification_1.1.0.xsd"/> 
    <xs:element name="my-asset" type="my-ns:my-asset-type" substitutionGroup="ai:asset" /> 
    <xs:complexType name="my-asset-type"> 
     <xs:complexContent> 
      <xs:extension base="ai:asset-type"> 
       <xs:sequence> 
        <xs:element ref="ai:cpe" maxOccurs="unbounded" /> 
       </xs:sequence> 
       <xs:attribute name="id" type="xs:string" /> 
       <xs:anyAttribute namespace="##other"/> 
      </xs:extension> 
     </xs:complexContent> 
    </xs:complexType> 
</xs:schema> 

編集2:

私はARFスキーマに対して検証しようとしているインスタンス

ここ

は私が私の資産のカスタムベンダー要素を追加しようとした方法です:

<?xml version="1.0" encoding="UTF-8"?> 
<arf:asset-report-collection xmlns:ai="http://scap.nist.gov/schema/asset-identification/1.1" 
    xmlns:arf="http://scap.nist.gov/schema/asset-reporting-format/1.1" 
    xmlns:core="http://scap.nist.gov/schema/reporting-core/1.1" 
    xmlns:my-ns="http://mydomain/schema/scap/asset-identification/1.0" 
    xmlns:xlink="http://www.w3.org/1999/xlink" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation=" 
    http://mydomain/schema/scap/asset-identification/1.0 
    http://mydomain/schema/scap/asset-identification/1.0/asset-identification_1.0.a.xsd 
    http://scap.nist.gov/schema/asset-reporting-format/1.1 
    https://scap.nist.gov/schema/asset-reporting-format/1.1/asset-reporting-format_1.1.0.xsd 
    "> 
    <core:relationships xmlns:arfvocab="http://scap.nist.gov/specifications/arf/vocabulary/relationships/1.0#" 
     xmlns:aivocab="https://scap.nist.gov/specifications/ai/vocabulary/relationships/1.0/#" 
     xmlns:myvocab="https://mydomain/riskmanager/relationships/#"> 
    <core:relationship type="myvocab:supports" subject="asset_id_generated_by_app_2"> 
     <core:ref>asset_id_generated_by_app_3</core:ref> 
    </core:relationship> 
    <core:relationship type="aivocab:installedOnDevice" subject="asset_2"> 
     <core:ref>asset_1</core:ref> 
    </core:relationship> 
    </core:relationships> 
    <arf:assets> 
    <arf:asset id="asset_id_generated_by_app_1"> 
     <my-ns:my-asset id="uniq_vendor_id_1"> 
     <ai:cpe>cpe:/a:linux:debian:7.0</ai:cpe> 
     <ai:cpe>cpe:/a:apache:http_server:2.2</ai:cpe> 
     </my-ns:my-asset> 
    </arf:asset> 
    <arf:asset id="asset_id_generated_by_app_2"> 
     <my-ns:my-asset id="uniq_vendor_id_2"> 
     <ai:cpe>cpe:/a:linux:debian:7.0</ai:cpe> 
     </my-ns:my-asset> 
    </arf:asset> 
    <arf:asset id="asset_id_generated_by_app_3"> 
     <my-ns:my-asset id="uniq_vendor_id_3"> 
     <ai:cpe>cpe:/a:apache:http_server:2.2</ai:cpe> 
     </my-ns:m-asset> 
    </arf:asset> 
    <arf:asset id="asset_1"> 
     <ai:computing-device> 
     <ai:connections> 
      <ai:connection> 
      <ai:ip-address> 
       <ai:ip-v4>192.168.2.10</ai:ip-v4> 
      </ai:ip-address> 
      </ai:connection> 
     </ai:connections> 
     <ai:fqdn>comp1234.tempuri.org</ai:fqdn> 
     </ai:computing-device> 
    </arf:asset> 
    <arf:asset id="asset_2"> 
     <ai:software> 
     <ai:cpe>cpe:/a:apache:http_server:2.2</ai:cpe> 
     </ai:software> 
    </arf:asset> 
    </arf:assets> 
    <arf:reports> 
    <arf:report id="report_1"> 
     <arf:content> 
     <report xmlns="http://mydomain/riskmanager/report" /> 
     </arf:content> 
    </arf:report> 
    </arf:reports> 
</arf:asset-report-collection> 
+0

あなたが書いたベンダーの名前空間のスキーマを提供できるのであれば、多分そこに何かがあるかもしれません。 –

答えて

0

インスタンスに問題がある可能性があります。スキーマは上手く見えます。私の側のmy-nsスキーマに対して以下の検証が成功しました。これはおそらく助けになるだろうか?

<?xml version="1.0" encoding="UTF-8"?> 
<arf:asset-report-collection 
    xmlns:arf="http://scap.nist.gov/schema/asset-reporting-format/1.1" 
    xmlns:my-ns="http://mydomain/schema/scap/asset-identification/1.0" 
    xmlns:ai="http://scap.nist.gov/schema/asset-identification/1.1" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://mydomain/schema/scap/asset-identification/1.0 test.xsd http://scap.nist.gov/schema/asset-reporting-format/1.1 asset-reporting-format_1.1.0.xsd.xml"> 
    <arf:assets> 
     <arf:asset id="a"> 
      <my-ns:my-asset> 
       <ai:cpe>cpe:/</ai:cpe> 
      </my-ns:my-asset> 
     </arf:asset> 
    </arf:assets> 
    <arf:reports> 
     <arf:report id="foo"> 
      <arf:content><my-ns:foo/></arf:content> 
     </arf:report> 
    </arf:reports> 
</arf:asset-report-collection> 
+0

インスタンスがhttps://scap.nist.gov/schema/asset-reporting-format/1.1/asset-reporting-format_1.1.0.xsdに対して妥当性を確認しているかどうかは、実際には私の主な問題です。 ai:asset-typeを拡張し、ai:assetで置き換え可能なタイプのカスタム要素は、arf:asset要素のコンテンツとして有効ですが、そうではありません。私の検証ツールは、資産、回路、コンピューティングデバイス、データ、データベース、ネットワーク、組織、人物、サービス、またはソフトウェアのみが子として許可されていることをarf:資産要素が教えてくれることを教えている – Kunai

+0

あなたのものを含むすべてのスキーマのセットに対して、 aiとarf(arfとあなたをエントリポイントとする 'xsi:schemaLocation'属性を見てください)。スキーマがスコープ内にあることも重要です。それ以外の場合、エンジンはこの置換グループが存在する可能性を知ることができません。また、検証エンジンは、スキーマをバインドする方法が異なる場合があります。私はoXygenを使いました。 –

+0

質問で提供したインスタンスが私の側で問題なく検証されましたが、スキーマの要素の名前を 'my-asset'から' supporting-asset'に変更し、スキーマのURLをmyに変更する必要がありましたローカルバージョン。私はこれが役立つことを願っていますあなたが持っている問題はおそらく、使用している検証ソフトウェアでスキーマを正しく設定することに特有です。 XMLスキーマの観点からは、要素名のタイプミスを除いて、すべてがうまく見えます。 –

関連する問題