-
Notifications
You must be signed in to change notification settings - Fork 710
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10085 from jan-cerny/shorthand_to_oval
Introduce script shorthand to OVAL
- Loading branch information
Showing
6 changed files
with
95 additions
and
53 deletions.
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,22 @@ | ||
<def-group> | ||
<definition class="compliance" id="no_empty_passwords" version="1"> | ||
<metadata> | ||
<title>Prevent Login to Accounts With Empty Password</title> | ||
<affected family="unix"> | ||
<platform>multi_platform_all</platform> | ||
</affected> | ||
<description>The file /etc/pam.d/system-auth should not contain the nullok option</description> | ||
</metadata> | ||
<criteria> | ||
<criterion comment="make sure the nullok option is not used in /etc/pam.d/system-auth" test_ref="test_no_empty_passwords"/> | ||
</criteria> | ||
</definition> | ||
<ind:textfilecontent54_test check="all" check_existence="none_exist" version="1" id="test_no_empty_passwords" comment="make sure nullok is not used in /etc/pam.d/system-auth"> | ||
<ind:object object_ref="object_no_empty_passwords"/> | ||
</ind:textfilecontent54_test> | ||
<ind:textfilecontent54_object id="object_no_empty_passwords" version="1"> | ||
<ind:filepath operation="pattern match">^/etc/pam.d/(system|password)-auth$</ind:filepath> | ||
<ind:pattern operation="pattern match">^[^#]*\bnullok\b.*$</ind:pattern> | ||
<ind:instance datatype="int">1</ind:instance> | ||
</ind:textfilecontent54_object> | ||
</def-group> |
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,20 @@ | ||
#!/usr/bin/python3 | ||
|
||
import argparse | ||
import os | ||
|
||
import ssg.build_ovals | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser( | ||
description="Convert shorthand OVAL file to a valid full OVAL.") | ||
parser.add_argument("input", help="Input shorthand OVAL file") | ||
parser.add_argument("output", help="Output OVAL file") | ||
args = parser.parse_args() | ||
env_yaml = {"rule_id": os.path.basename(args.input)} | ||
ssg.build_ovals.expand_shorthand(args.input, args.output, env_yaml) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |