-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add oracle check_privilege_revoke_all_source
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
class check_privilege_revoke_all_source(): | ||
""" | ||
check_privilege_revoke_all_source | ||
Ensure 'ALL' Is Revoked from Unauthorized 'GRANTEE' on SOURCE$ | ||
The SOURCE$ table contains the PL/SQL source for all packages, | ||
procedures and functions. | ||
""" | ||
# References: | ||
# http://www.davidlitchfield.com/AddendumtotheOracle12cCISGuidelines.pdf | ||
# http://www.davidlitchfield.com/oracle_backdoors.pdf | ||
|
||
TITLE = 'Revoke ALL from SOURCE$' | ||
CATEGORY = 'Privilege' | ||
TYPE = 'sql' | ||
SQL = "SELECT GRANTEE, PRIVILEGE FROM DBA_TAB_PRIVS WHERE TABLE_NAME = 'SOURCE$'" | ||
|
||
verbose = False | ||
skip = False | ||
result = {} | ||
|
||
def do_check(self, *results): | ||
self.result['level'] = 'GREEN' | ||
output = '' | ||
|
||
for rows in results: | ||
for row in rows: | ||
self.result['level'] = 'RED' | ||
output += row[0] + ' with ' + row[1] + 'on SOURCE$\n' | ||
|
||
if 'GREEN' == self.result['level']: | ||
output = 'No user with grants to SOURCE$.' | ||
|
||
self.result['output'] = output | ||
|
||
return self.result | ||
|
||
def __init__(self, parent): | ||
print('Performing check: ' + self.TITLE) |