私はXCCDF出力ファイルから情報を解析しようとしていますが、Linq-to-Xmlクエリは空のまま戻り続けます。ここで私は、この時点まで試したもののいくつかされていますXCCDF上のC#Linq-to-XML
私も試してみました:
var findingDetails = from f in findings.Descendants(ns + "Benchmark")
select f;
var findingDetails = from f in findings.Descendants("Benchmark")
select new
{
title = f.Element("title").Value
};
var findingDetails = from f in findings.Elements(ns + "Benchmark")
select new
{
title = f.Element("title").Value
};
var findingDetails = from f in findings.Elements(ns + "Benchmark")
select f;
ここxccdf.xmlファイルの要約版です。このバージョンに基づいて、どのようにタイトル "Red Hat ..."(5行目)とタイトル "daemon umask"(19行目)を得ることができますか? (私は
<?xml version="1.0" encoding="UTF-8"?>
<cdf:Benchmark style="SCAP_1.1" resolved="1" id="RHEL_6_STIG" xsi:schemaLocation="http://checklists.nist.gov/xccdf/1.1 http://nvd.nist.gov/schema/xccdf-1.1.4.xsd http://cpe.mitre.org/dictionary/2.0 http://scap.nist.gov/schema/cpe/2.2/cpe-dictionary_2.2.xsd" xmlns:cdf="http://checklists.nist.gov/xccdf/1.1" xmlns:cpe="http://cpe.mitre.org/dictionary/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<cdf:status date="2016-04-22">accepted</cdf:status>
<cdf:title>Red Hat Enterprise Linux 6 Security Technical Implementation Guide</cdf:title>
<cdf:description>The Red Hat Enterprise Linux 6 Security Technical Implementation Guide (STIG) is published as a tool to improve the security of Department of Defense (DoD) information systems. Comments or proposed revisions to this document should be sent via e-mail to the following address: [email protected]</cdf:description>
<cdf:notice id="terms-of-use"></cdf:notice>
<cdf:reference href="http://iase.disa.mil">
<dc:publisher>DISA</dc:publisher>
<dc:source>STIG.DOD.MIL</dc:source>
</cdf:reference>
<cdf:plain-text id="release-info">Release: 11 Benchmark Date: 22 Apr 2016</cdf:plain-text>
<cdf:platform idref="cpe:/o:redhat:enterprise_linux:6"></cdf:platform>
<cdf:version>1</cdf:version>
<cdf:Profile id="MAC-1_Classified">
<cdf:title>I - Mission Critical Classified</cdf:title>
</cdf:Profile>
<cdf:Value id="var_umask_for_daemons">
<cdf:title>daemon umask</cdf:title>
<cdf:description>Enter umask for daemons</cdf:description>
<cdf:value>022</cdf:value>
<cdf:value selector="022">022</cdf:value>
<cdf:value selector="027">027</cdf:value>
</cdf:Value>
</cdf:Benchmark>
あなたの助けてくれてありがとう、私は昨夜、私はあるポイントを考えていましたが、私はこれらのラインに沿って何かを試しましたが、何かを見逃しているに違いありません。 – Chris