diff --git a/secrules/rules09.py b/secrules/rules09.py index 5cbf37fbfc7ce91352c86d66a3a6b24ec0038028_c2VjcnVsZXMvcnVsZXMwOS5weQ==..4f499d0118fc518f433672dc08c96d5a419beefa_c2VjcnVsZXMvcnVsZXMwOS5weQ== 100644 --- a/secrules/rules09.py +++ b/secrules/rules09.py @@ -13,5 +13,5 @@ @level_rule(2) def rule0901(fo, fmt): """Files accessible by non-privileged users - + The integrity of VMS startup files is critical to the security and @@ -17,5 +17,5 @@ The integrity of VMS startup files is critical to the security and - integrity of the operating environment. Improper access to startup files + integrity of the operating environment. Improper access to startup files can allow unauthorized users to modify their own or another user's execution environment.""" @@ -19,6 +19,11 @@ can allow unauthorized users to modify their own or another user's execution environment.""" + ebit = 0x4 + wbit = 0x2 + dbit = 0x8 + rbit = 0x1 + if not fmt: print(file=fo) print('RULE 0901', file=fo) @@ -37,12 +42,8 @@ )[2][ ossdef.OSS__PROTECTION ] # type: ignore - if not ( - (prot & 0x8000) - and (prot & 0x4000) - and (prot & 0x2000) - and (prot & 0x1000) - ): + wprot = (prot & 0xF000) >> 12 + if (wprot & wbit) == 0 or (wprot & dbit) == 0: if fmt: print('0901"2"', fn, file=fo) else: @@ -57,6 +58,6 @@ @level_rule(3) def rule0902(fo, fmt): """Embedded command procedure not found - + During checking of the listed files for non-privileged access, either: 1) An attempt to open the files to check for other called procedures resulted @@ -61,6 +62,8 @@ During checking of the listed files for non-privileged access, either: 1) An attempt to open the files to check for other called procedures resulted - in an open failure, -OR- 2) The listed command procedures reference other + in an open failure, + -OR- + 2) The listed command procedures reference other command procedures which were not found. If a file was required and deleted, a user could create a file with the same name. This file then would run with privileged access allowing a user to gain unauthorized system access.""" @@ -83,7 +86,7 @@ @level_rule(2) def rule0903(fo, fmt): """Startup file not found - + This indicates either a system configuration inconsistency or an inconsistency in the review criteria."""