forked from OpenSCAP/openscap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[probe] fix process58_item session_id
get session_id from /proc/id/stat instead of /proc/id/sessionid /proc/id/stat is used by 'ps'
- Loading branch information
Showing
5 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<oval_definitions xmlns:oval="http://oval.mitre.org/XMLSchema/oval-common-5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:unix-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix" xmlns:ind-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent" xmlns:lin-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5" xsi:schemaLocation="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix unix-definitions-schema.xsd http://oval.mitre.org/XMLSchema/oval-definitions-5#independent independent-definitions-schema.xsd http://oval.mitre.org/XMLSchema/oval-definitions-5#linux linux-definitions-schema.xsd http://oval.mitre.org/XMLSchema/oval-definitions-5 oval-definitions-schema.xsd http://oval.mitre.org/XMLSchema/oval-common-5 oval-common-schema.xsd"> | ||
<generator> | ||
<oval:product_name>My hands</oval:product_name> | ||
<oval:product_version>1.0</oval:product_version> | ||
<oval:schema_version>5.10.1</oval:schema_version> | ||
<oval:timestamp>2013-11-27T11:48:00+01:00</oval:timestamp> | ||
</generator> | ||
<definitions> | ||
<definition id="oval:x:def:1" version="1" class="compliance"> | ||
<metadata> | ||
<title>Test</title> | ||
<description>Collect info about process 1</description> | ||
</metadata> | ||
<criteria> | ||
<criterion test_ref="oval:x:tst:1" comment="Test"/> | ||
</criteria> | ||
</definition> | ||
</definitions> | ||
<tests> | ||
<unix-def:process58_test id="oval:x:tst:1" version="1" check="all" comment="Test."> | ||
<unix-def:object object_ref="oval:x:obj:1"/> | ||
<unix-def:state state_ref="oval:x:ste:1"/> | ||
</unix-def:process58_test> | ||
</tests> | ||
<objects> | ||
<unix-def:process58_object id="oval:x:obj:1" version="1"> | ||
<unix-def:command_line operation="pattern match">.*</unix-def:command_line> | ||
<unix-def:pid datatype="int">1</unix-def:pid> | ||
</unix-def:process58_object> | ||
</objects> | ||
<states> | ||
<unix-def:process58_state id="oval:x:ste:1" version="1"> | ||
<unix-def:session_id datatype="int">1</unix-def:session_id> | ||
</unix-def:process58_state> | ||
</states> | ||
</oval_definitions> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
set -e -o pipefail | ||
|
||
name=$(basename $0 .sh) | ||
result=$(mktemp ${name}.out.XXXXXX) | ||
echo "result file: $result" | ||
stderr=$(mktemp ${name}.err.XXXXXX) | ||
echo "stderr file: $stderr" | ||
|
||
echo "Eval:" | ||
$OSCAP oval eval --results $result $srcdir/$name.oval.xml 2> $stderr | ||
[ -f $stderr ]; | ||
|
||
rm $stderr | ||
|
||
[ -f $result ] | ||
assert_exists 1 '/oval_results/results/system/definitions/definition[@result="true"]' | ||
|
||
rm $result |