Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
secrules
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
tools
secrules
Commits
81216b540ebe
Commit
81216b540ebe
authored
5 years ago
by
Jean-Francois Pieronne
Browse files
Options
Downloads
Patches
Plain Diff
secrules/rules09.py initial version
parent
0432c3f7e9b8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
secrules/rules09.py
+86
-0
86 additions, 0 deletions
secrules/rules09.py
with
86 additions
and
0 deletions
secrules/rules09.py
0 → 100644
+
86
−
0
View file @
81216b54
# -*- coding: iso-8859-1 -*-
__version__
=
'
1.0
'
from
common
import
level_rule
import
os
from
vms
import
starlet
from
vms.rtl
import
lib
from
vms
import
itemList
from
vms
import
ossdef
from
FindFile
import
FindFile
,
file_exists
@level_rule
(
2
)
def
rule0901
(
fo
,
fmt
):
"""
The integrity of VMS startup files is critical to the security and
integrity of the operating environment. Improper access to startup files
can allow unauthorized users to modify their own or another user
'
s execution
environment.
"""
if
not
fmt
:
print
>>
fo
print
>>
fo
,
'
RULE 0901
'
print
>>
fo
,
'
=========
'
it
=
[
itemList
.
itemList
(
code
=
ossdef
.
OSS__PROTECTION
,
dtype
=
itemList
.
il_unsignedWord
),]
with
FindFile
(
'
Sys$Startup:*.*
'
,
''
)
as
ifn
:
for
fn
in
ifn
:
prot
=
starlet
.
get_security
(
objnam
=
fn
,
clsnam
=
'
FILE
'
,
itmlst
=
it
)[
1
][
ossdef
.
OSS__PROTECTION
]
if
not
((
prot
&
0x8000
)
and
(
prot
&
0x4000
)
and
(
prot
&
0x2000
)
and
(
prot
&
0x1000
)):
if
fmt
:
print
>>
fo
,
'
0901¨2¨
'
,
fn
else
:
print
>>
fo
,
fn
print
>>
fo
,
'
'
*
10
,
lib
.
format_sogw_prot
(
prot
)[
1
]
@level_rule
(
3
)
def
rule0902
(
fo
,
fmt
):
"""
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
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.
"""
if
not
fmt
:
print
>>
fo
print
>>
fo
,
'
RULE 0902
'
print
>>
fo
,
'
=========
'
pok
=
True
with
os
.
popen
(
'
Search Sys$System:Startup.Log -FNF/Win=(1,0) /noHead
'
)
as
p
:
for
pi
in
p
:
if
pok
:
if
fmt
:
print
>>
fo
,
'
0902¨3¨
'
,
pi
,
else
:
print
>>
fo
,
pi
,
pok
=
not
pok
@level_rule
(
2
)
def
rule0903
(
fo
,
fmt
):
"""
This indicates either a system configuration inconsistency or an
inconsistency in the review criteria.
"""
if
not
fmt
:
print
>>
fo
print
>>
fo
,
'
RULE 0903
'
print
>>
fo
,
'
=========
'
lsf
=
(
'
SYS$SYSTEM:STARTUP.COM
'
,
'
SYS$MANAGER:SYSTARTUP_VMS.COM
'
,
'
SYS$SYSTEM:IA64VMSSYS.PAR
'
)
for
fn
in
lsf
:
if
not
file_exists
(
fn
):
if
fmt
:
print
>>
fo
,
'
0903¨2¨
'
,
fn
else
:
print
>>
fo
,
fn
if
__name__
==
'
__main__
'
:
import
sys
fo
=
open
(
sys
.
argv
[
1
],
'
w
'
)
if
len
(
sys
.
argv
)
>
1
else
sys
.
stdout
rule0901
(
fo
,
len
(
sys
.
argv
)
>
2
)
rule0903
(
fo
,
len
(
sys
.
argv
)
>
2
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment