-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now provides a nifty `.pkg` as well as framework for automating the SUID scans.
- Loading branch information
Showing
10 changed files
with
156 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,3 +54,6 @@ docs/_build/ | |
|
||
# Custom | ||
parse_transcripts.py | ||
distribution.xml | ||
resources | ||
scripts |
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,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015 University of Utah, Marriott Library, Apple Support | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>Label</key> | ||
<string>edu.utah.scl.suid_scan.login</string> | ||
<key>ProgramArguments</key> | ||
<array> | ||
<string>/usr/local/bin/suid_scan.logout_wrapper.sh</string> | ||
</array> | ||
<key>RunAtLoad</key> | ||
<true/> | ||
<key>KeepAlive</key> | ||
<dict> | ||
<key>PathState</key> | ||
<dict> | ||
<key>/private/tmp/edu.utah.scl.suid_scan.runatlogout</key> | ||
<false/> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
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,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>Label</key> | ||
<string>edu.utah.scl.suid_scan.logout</string> | ||
<key>LimitLoadToSessionType</key> | ||
<array> | ||
<string>LoginWindow</string> | ||
</array> | ||
<key>ProgramArguments</key> | ||
<array> | ||
<string>/usr/local/bin/suid_scan.logout_wrapper.sh</string> | ||
</array> | ||
<key>RunAtLoad</key> | ||
<false/> | ||
<key>KeepAlive</key> | ||
<dict> | ||
<key>PathState</key> | ||
<dict> | ||
<key>/private/tmp/edu.utah.scl.suid_scan.runatlogout</key> | ||
<true/> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
<plist version="1.0"> | ||
<dict> | ||
<key>Label</key> | ||
<string>edu.utah.scl.suid_scan_periodic</string> | ||
<string>edu.utah.scl.suid_scan.periodic</string> | ||
<key>ProcessType</key> | ||
<string>Background</string> | ||
<key>ProgramArguments</key> | ||
|
@@ -16,10 +16,6 @@ | |
<!-- <string>--mailto</string><string>[email protected]</string> --> | ||
<!-- <string>--hash</string><string>/path/to/hashfunction with parameters</string> --> | ||
</array> | ||
<key>StandardOutPath</key> | ||
<string>/var/log/suid_scan_periodic_results.txt</string> | ||
<key>StandardErrorPath</key> | ||
<string>/var/log/suid_scan_periodic_errors.txt</string> | ||
<key>StartInterval</key> | ||
<!-- Change this value according to your preference. --> | ||
<!-- The value is number of seconds between executions. --> | ||
|
Binary file not shown.
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,24 @@ | ||
from distutils.core import setup | ||
import suid_scan | ||
|
||
setup( | ||
name='SUID Scan', | ||
version=suid_scan.__version__, | ||
url='https://github.com/univ-of-utah-marriott-library-apple/suid_scan', | ||
author='Pierce Darragh, Marriott Library IT Services', | ||
author_email='[email protected]', | ||
description='Simple script to help you check for files with execute-as bits set.', | ||
license='MIT', | ||
scripts=['suid_scan.py'], | ||
classifiers=[ | ||
'Development Status :: 5 - Stable', | ||
'Environment :: Console', | ||
'Environment :: MacOS X', | ||
'Intended Audience :: Information Technology', | ||
'License :: OSI Approved :: MIT License', | ||
'Natural Language :: English', | ||
'Operating System :: MacOS :: MacOS X', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2.7' | ||
], | ||
) |
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,34 @@ | ||
#!/bin/bash | ||
|
||
# This short script toggles the "runatlogout" state for the two LaunchAgents | ||
# that should be installed: | ||
# edu.utah.scl.suid_scan.login | ||
# edu.utah.scl.suid_scan.logout | ||
# These allow for an on-logout scan of the filesystem for SUID/SGID files. | ||
# | ||
# For more information, see the GitHub repository at: | ||
# https://github.com/univ-of-utah-marriott-library-apple/suid_scan | ||
|
||
# If you change the trigger file, update it in the plists too. | ||
TRIGGERFILE="/private/tmp/edu.utah.scl.suid_scan.runatlogout" | ||
BASESCAN="/var/log/suid_scan.base_scan.txt" | ||
NEWSCAN="/var/log/suid_scan.new_scan.txt" | ||
|
||
if [ -f "${TRIGGERFILE}" ]; then | ||
rm -f "${TRIGGERFILE}" | ||
# Enter whatever customization options you want here. | ||
# If the base run has been complete, do a comparison scan. Otherwise, | ||
# generate the base scan. | ||
if [ -f "${BASESCAN}" ]; then | ||
# Run a comparison scan. | ||
/usr/local/bin/python /usr/local/bin/suid_scan.py \ | ||
--input "${BASESCAN}" \ | ||
--output "${NEWSCAN}" | ||
else | ||
# Run a base scan. | ||
/usr/local/bin/python /usr/local/bin/suid_scan.py \ | ||
--output "${BASESCAN}" | ||
fi | ||
else | ||
touch "${TRIGGERFILE}" | ||
fi |
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