|
@@ 140-164 (lines=25) @@
|
| 137 |
|
print("\n") |
| 138 |
|
|
| 139 |
|
|
| 140 |
|
def process_product_names(args, known_rules): |
| 141 |
|
result = rds.walk_rules_stats(args, known_rules, rds.product_names_oval, rds.product_names_remediation) |
| 142 |
|
affected_rules = result[0] |
| 143 |
|
affected_ovals = result[1] |
| 144 |
|
affected_remediations = result[2] |
| 145 |
|
affected_remediations_type = result[4] |
| 146 |
|
verbose_output = result[5] |
| 147 |
|
|
| 148 |
|
if not args.summary_only: |
| 149 |
|
print("Product Names Specifics:") |
| 150 |
|
for line in verbose_output: |
| 151 |
|
print(line) |
| 152 |
|
print("\n") |
| 153 |
|
|
| 154 |
|
print("Product Names Summary:") |
| 155 |
|
print("Total affected rules: %d" % affected_rules) |
| 156 |
|
if not args.fixes_only: |
| 157 |
|
print("Rules with differing products and OVAL names: %d / %d" % (affected_ovals, affected_rules)) |
| 158 |
|
if not args.ovals_only: |
| 159 |
|
print("Rules with differing product and remediation names: %d / %d" % (affected_remediations, affected_rules)) |
| 160 |
|
for r_type in ssg.build_remediations.REMEDIATION_TO_EXT_MAP: |
| 161 |
|
r_missing = affected_remediations_type[r_type] |
| 162 |
|
print("Rules with differing product and %s remediation names: %d / %d" % (r_type, r_missing, affected_rules)) |
| 163 |
|
|
| 164 |
|
print("\n") |
| 165 |
|
|
| 166 |
|
|
| 167 |
|
def process_introspection(args, known_rules): |
|
@@ 113-137 (lines=25) @@
|
| 110 |
|
print("\n") |
| 111 |
|
|
| 112 |
|
|
| 113 |
|
def process_prodtypes(args, known_rules): |
| 114 |
|
result = rds.walk_rules_stats(args, known_rules, rds.prodtypes_oval, rds.prodtypes_remediation) |
| 115 |
|
affected_rules = result[0] |
| 116 |
|
affected_ovals = result[1] |
| 117 |
|
affected_remediations = result[2] |
| 118 |
|
affected_remediations_type = result[4] |
| 119 |
|
verbose_output = result[5] |
| 120 |
|
|
| 121 |
|
if not args.summary_only: |
| 122 |
|
print("Prodtypes Object Specifics:") |
| 123 |
|
for line in verbose_output: |
| 124 |
|
print(line) |
| 125 |
|
print("\n") |
| 126 |
|
|
| 127 |
|
print("Prodtypes Objects Summary:") |
| 128 |
|
print("Total affected rules: %d" % affected_rules) |
| 129 |
|
if not args.fixes_only: |
| 130 |
|
print("Rules with differing prodtypes between YAML and OVALs: %d / %d" % (affected_ovals, affected_rules)) |
| 131 |
|
if not args.ovals_only: |
| 132 |
|
print("Rules with differing prodtypes between YAML and remediations: %d / %d" % (affected_remediations, affected_rules)) |
| 133 |
|
for r_type in ssg.build_remediations.REMEDIATION_TO_EXT_MAP: |
| 134 |
|
r_missing = affected_remediations_type[r_type] |
| 135 |
|
print("Rules with differing prodtypes between YAML and %s remediations: %d / %d" % (r_type, r_missing, affected_rules)) |
| 136 |
|
|
| 137 |
|
print("\n") |
| 138 |
|
|
| 139 |
|
|
| 140 |
|
def process_product_names(args, known_rules): |
|
@@ 86-110 (lines=25) @@
|
| 83 |
|
print("\n") |
| 84 |
|
|
| 85 |
|
|
| 86 |
|
def process_two_plus(args, known_rules): |
| 87 |
|
result = rds.walk_rules_stats(args, known_rules, rds.two_plus_oval, rds.two_plus_remediation) |
| 88 |
|
affected_rules = result[0] |
| 89 |
|
affected_ovals = result[1] |
| 90 |
|
affected_remediations = result[2] |
| 91 |
|
affected_remediations_type = result[4] |
| 92 |
|
verbose_output = result[5] |
| 93 |
|
|
| 94 |
|
if not args.summary_only: |
| 95 |
|
print("Two Plus Object Specifics:") |
| 96 |
|
for line in verbose_output: |
| 97 |
|
print(line) |
| 98 |
|
print("\n") |
| 99 |
|
|
| 100 |
|
print("Two Plus Objects Summary:") |
| 101 |
|
print("Total affected rules: %d" % affected_rules) |
| 102 |
|
if not args.fixes_only: |
| 103 |
|
print("Rules with two or more OVALs: %d / %d" % (affected_ovals, affected_rules)) |
| 104 |
|
if not args.ovals_only: |
| 105 |
|
print("Rules with two or more remediations: %d / %d" % (affected_remediations, affected_rules)) |
| 106 |
|
for r_type in ssg.build_remediations.REMEDIATION_TO_EXT_MAP: |
| 107 |
|
r_missing = affected_remediations_type[r_type] |
| 108 |
|
print("Rules with two or more %s remediations: %d / %d" % (r_type, r_missing, affected_rules)) |
| 109 |
|
|
| 110 |
|
print("\n") |
| 111 |
|
|
| 112 |
|
|
| 113 |
|
def process_prodtypes(args, known_rules): |
|
@@ 60-83 (lines=24) @@
|
| 57 |
|
return parser.parse_args() |
| 58 |
|
|
| 59 |
|
|
| 60 |
|
def process_missing(args, known_rules): |
| 61 |
|
result = rds.walk_rules_stats(args, known_rules, rds.missing_oval, rds.missing_remediation) |
| 62 |
|
affected_rules = result[0] |
| 63 |
|
affected_ovals = result[1] |
| 64 |
|
affected_remediations = result[3] |
| 65 |
|
affected_remediations_type = result[4] |
| 66 |
|
verbose_output = result[5] |
| 67 |
|
|
| 68 |
|
if not args.summary_only: |
| 69 |
|
print("Missing Objects Specifics:") |
| 70 |
|
for line in verbose_output: |
| 71 |
|
print(line) |
| 72 |
|
print("\n") |
| 73 |
|
|
| 74 |
|
print("Missing Objects Summary:") |
| 75 |
|
print("Total affected rules: %d" % affected_rules) |
| 76 |
|
if not args.fixes_only: |
| 77 |
|
print("Rules with no OVALs: %d / %d" % (affected_ovals, affected_rules)) |
| 78 |
|
if not args.ovals_only: |
| 79 |
|
print("Rules without any remediations: %d / %d" % (affected_remediations, affected_rules)) |
| 80 |
|
for r_type in ssg.build_remediations.REMEDIATION_TO_EXT_MAP: |
| 81 |
|
r_missing = affected_remediations_type[r_type] |
| 82 |
|
print("Rules with no %s remediations: %d / %d" % (r_type, r_missing, affected_rules)) |
| 83 |
|
print("\n") |
| 84 |
|
|
| 85 |
|
|
| 86 |
|
def process_two_plus(args, known_rules): |