Giter Club home page Giter Club logo

mergen's Introduction

Mergen - MacOS Audit and Security Check Tool

Mergen is an open-source, native macOS application for auditing and checking the security of your Mac. It scans your system for security issues based on the Center for Internet Security (CIS) Benchmark, and checks various settings and configurations related to security and privacy.

Screenshot

Screenshot

Mergen provides the following features to help you secure your Mac:

1. Check Gatekeeper Status
2. Check Secure Kernel Extension Loading
3. Guest Login Status Check
4. iCloud Drive Status Check
5. Check If SSH Is Enabled
6. Check Firewall Status
7. Check FileVault Status
8. Check All Apple-Provided Software Is Updated In Last 30 Days
9. Check Auto Update Is Enabled
10. Check 'Install Application Updates from the App Store' Is Enabled
11. Check Install Security Responses and System Files Is Enabled
12. Check 'Install system data files and security updates' Is Enabled
13. Check Firewall Stealth Mode Is Enabled
14. Check AirDrop Is Disabled
15. Check AirPlay Receiver Is Disabled
16. Check 'Set Time and Date Automatically' Is Enabled
17. Check Time Is Set Within Appropriate Limits
18. Check DVD or CD Sharing Is Disabled
19. Check Screen Sharing Is Disabled
20. Check File Sharing Is Disabled
21. Check Printer Sharing Is Disabled
22. Check Remote Login Is Disabled
23. Check Remote Management(ARDagent) Is Disabled
24. Check Remote Apple Events Is Disabled
25. Check Internet Sharing Is Disabled
26. Check Content Caching Is Disabled
27. Check Media Sharing Is Disabled
28. Check Bluetooth Sharing Is Disabled
29. Check Backup Automatically is Enabled If Time Machine Is Enabled
30. Check that Time Machine is Enabled
31. Check Time Machine Volumes Are Encrypted If Time Machine Is Enabled
32. Check Show Wi-Fi status in Menu Bar Is Enabled
33. Check Show Bluetooth Status in Menu Bar Is Enabled
34. Check Location Services Is Enabled
35. Check Location Services Is in the Menu Bar
36. Check Personalized Ads Status
37. Check Screen Saver Corners Are Secure
38. Check Universal Control is Disabled
39. Check Wake for Network Access is Disabled
40. Check an Inactivity Interval of 20 Minutes or Less for the Screen Saver Is Enabled
41. Check a Password is Required to Wake the Computer from Sleep or Screen Saver
42. Check Security Auditing Is Enabled
43. Check System Integrity Protection (SIP) Status
44. Check XProtect Status
45. Check Certificate Trust Settings
46. Check Siri Status
47. Check Sending Diagnostic and Usage Data to Apple Status
48. Check Java 6 Default Runtime Status
49. Check EFI Version is Valid and Regularly Checked
50. Check Bonjour Advertising Service Status
51. Check HTTP Server Status
52. Check NFS Server Status
53. Check 'Show Password Hints' Status
54. Check 'Allow guests to connect to shared folders' Status
55. Check Filename Extension Status
56. Check Automatic Run of Safe Files in Safari
57. Check Safari Disable Internet Plugins for Global Use
58. Check Fast User Switching Status

Installation and Usage

Mergen is an open-source project, and you can download the latest release binary from the GitHub repository or you can build yourself.

git clone https://github.com/sametsazak/mergen.git

Open the Mergen.xcworkspace file in Xcode.

Build and run the project in Xcode.

Usage

Once you have installed Mergen, you can launch the application and start checking the security issues. The application is user-friendly and easy to use. Follow the steps mentioned below to check the security issues:

  • Launch the Mergen application.

  • Choose a category and press the scan button to start the security check.

Screenshot

  • Once the security check is complete, you can see the reporting options and statistics.

  • You can see more details by double clicking the findings.

Screenshot

Reporting

Screenshot

HTML Report

The HTML export feature lets you quickly generate a professional-looking report of your scan results. This report includes all the details about the security checks performed, as well as any warnings or errors that were detected. You can share it with others for review or reference.

Screenshot

JSON Export

The JSON export feature allows you to export the scan results in JSON format that other applications can quickly process. This is particularly useful if you need to integrate the results with other security tools or workflows. The JSON format provides a detailed breakdown of each security check, making it easy to identify areas requiring further attention.

 {
    "status" : "Firewall is enabled.",
    "documentation" : "For more information on configuring your firewall, visit: https:\/\/support.apple.com\/en-us\/HT201642",
    "category" : "CIS Benchmark",
    "mitigation" : "Enabling and configuring the firewall helps prevent unauthorized access to your device and increases overall security. A properly configured firewall can block incoming connections and minimize the risk of unauthorized access.",
    "remediation" : "To enable and configure the firewall, go to System Preferences -> Security & Privacy -> Firewall, click 'Turn On Firewall', and 'Firewall Options...' to block incoming connections.",
    "description" : "The firewall helps protect your device from unauthorized access. This check verifies if the firewall is enabled and configured correctly.",
    "severity" : "High",
    "name" : "Check Firewall Status",
    "docID" : 5
  }

Challenges

Developing this application was a fun but challenging experience. Here's a rundown of the main problems I faced along the way:

  1. Learning Swift and SwiftUI on the Fly

As a Python-savvy developer, I had to learn Swift and SwiftUI on the go while building Mergen. I had to learn Swift and SwiftUI while simultaneously developing Mergen. This learning curve was a unique challenge, as I had to familiarize myself with new programming languages. However, through dedication and perseverance, I managed to overcome some problems and, at least, created a simple version my ideas.

  1. No Admin Rights? No Problem!

Mergen's all about security, so it needed access to system settings and configs. But getting admin rights or using sudo in a macOS app wasn't an option, which made some security checks a bit tricky. To work around this, I focused on checks that could run with just user rights, even if it meant sacrificing a few features.

  1. Keeping the Code Simple and User-Friendly

In an effort to make Mergen as accessible as possible for users and contributors. This goal presented a challenge, as macOS has numerous versions, and not every module could be tested on each one. As a result, user feedback is vital for identifying and addressing any compatibility issues or limitations that may arise due to the differences in macOS versions. This feedback-driven approach allows Mergen to continuously improve and adapt to different environments.

Contributing

Since I'm not an expert Swift developer, there might be some issues with the code but we welcome contributions from anyone interested in improving the security of Mac. If you are interested in contributing to the project, please follow these steps:

  • Fork the repository and clone it to your local machine.

  • Create a new branch for your changes.

  • Make your changes and write tests it.

  • Commit your changes and push them to your forked repository.

  • Open a pull request and describe your changes in detail.

License

Mergen is released under the MIT License.

MIT License

Copyright (c) [2023] [Samet Sazak]

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.

mergen's People

Contributors

catchingknives avatar sametsazak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mergen's Issues

Non-GUI version and logs

Great initiative and tool!
It is also good to have a terminal non-gui version and execution logging for better issues tracking

On mac using Dark mode, text on start page is unreadable

If user enabled dark mode in settings and starts Mergen, the text of the buttons next to "Please choose a scan category" are virtually unreadable. See screenshot:
Bildschirmfoto 2023-04-29 um 13 12 29

The scan results are readable, but the colors are not optimized:
Bildschirmfoto 2023-04-29 um 13 14 00

As dark mode is a native feature of MacOS it should natively be supported my Mergen.

v 1.0 (1) can't be opened

Hello,
After downloading latest revision, when I try to open the App an get the message "The application "merges.app" can't be opened"

macOS 13.4 (22F66)
Screenshot

v1.1.0 can't be opened

Hello,
Nice work on mergen. I downloaded version v1.0 and v1.1.0 from the releases page. v1.0 opens correctly however v1.1.0 "can't be opened". I'm happy to give extra information if needed.

Tested on M1 Mac with macOS 13.5.

Regards

build error

when i try build via xcode. i getting below error code ?

/Users/xxx/Documents/mergen/mergen.xcodeproj One of the paths in DEVELOPMENT_ASSET_PATHS does not exist: /Users/xxx/Documents/mergen/mergen/Preview

is this normal ?

Feature request - Homebrew install

Neat tool! It would be really great if it was installable via homebrew, so it's install could be easily automated and kept up to date with other packages.

"How to fix" window is too small to read

Hi, this is a great first attempt! Thanks for the work.

There is an issue with the How To Fix pop-up window, in that it is far too small to rad and not expandable in any way.

Screenshot 2023-04-27 at 18 01 59

Additionally, there seems to be a path to getting two pop-ups to appear at once, which I would guess was not intended.

Screenshot 2023-04-27 at 18 02 19

Mergen Crashes

Hello,
by scan all the application crashes.

Here's the log:

Checking ---- : Check Gatekeeper Status
Checking ---- : Check FileVault Status
Checking ---- : Check System Integrity Protection (SIP) Status
Checking ---- : Check Firewall Status
Checking ---- : Check Certificate Trust Settings
Output:
errorData: 64 bytes
errorOutput: SecTrustSettingsCopyCertificates: No Trust Settings were found.
Checking ---- : Check If SSH Is Enabled
Checking ---- : iCloud Drive Status Check
Checking ---- : Guest Login Status Check
Checking ---- : Check Siri Status
Checking ---- : Check Secure Kernel Extension Loading
Checking ---- : Check Sending Diagnostic and Usage Data to Apple Status
Checking ---- : Check Java 6 Default Runtime Status
Checking ---- : Check EFI Version is Valid and Regularly Checked
Checking ---- : Check Bonjour Advertising Service Status
2023-04-29 06:22:44.745 defaults[3296:29109]
The domain/default pair of (/Library/Preferences/com.apple.mDNSResponder.plist, NoMulticastAdvertisements) does not exist
Checking ---- : Check HTTP Server Status
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.0.0.20. Set the 'ServerName' directive globally to suppress this message
Syntax OK
Checking ---- : Check NFS Server Status
Checking ---- : Check 'Show Password Hints' Status
2023-04-29 06:22:44.833 defaults[3301:29121]
The domain/default pair of (/Library/Preferences/com.apple.loginwindow.plist, RetriesUntilHint) does not exist
Checking ---- : Check 'Allow guests to connect to shared folders' Status
2023-04-29 06:22:44.841 defaults[3302:29123]
The domain/default pair of (/Library/Preferences/com.apple.AppleFileServer, guestAccess) does not exist
Checking ---- : Check Automatic Run of Safe Files in Safari
2023-04-29 06:22:44.911 defaults[3303:29125]
The domain/default pair of (/Users/0zzy/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari, AutoOpenSafeDownloads) does not exist
Checking ---- : Check Safari Disable Internet Plugins for Global Use
2023-04-29 06:22:44.981 defaults[3304:29129]
The domain/default pair of (/Users/0zzy/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari, PlugInFirstVisitPolicy) does not exist
Checking ---- : Check Fast User Switching Status
Checking ---- : Check Filename Extension Status
Checking ---- : Check All Apple-Provided Software Is Updated In Last 30 Days
Checking ---- : Check Auto Update Is Enabled
Checking ---- : Check 'Install Application Updates from the App Store' Is Enabled
Checking ---- : Check Install Security Responses and System Files Is Enabled
Checking ---- : Check 'Install system data files and security updates' Is Enabled
Checking ---- : Check Firewall Stealth Mode Is Enabled
Checking ---- : Check AirDrop Is Disabled
2023-04-29 06:22:45.112 defaults[3313:29151]
The domain/default pair of (com.apple.NetworkBrowser, DisableAirDrop) does not exist
Checking ---- : Check 'Set Time and Date Automatically' Is Enabled
Checking ---- : Check Time Is Set Within Appropriate Limits
Checking ---- : Check DVD or CD Sharing Is Disabled
Could not find service "com.apple.ODSAgent" in domain for port
Checking ---- : Check Screen Sharing Is Disabled
Could not find service "com.apple.screensharing" in domain for port
Checking ---- : Check File Sharing Is Disabled
Checking ---- : Check Printer Sharing Is Disabled
Checking ---- : Check Remote Login Is Disabled
Checking ---- : Check Remote Management(ARDagent) Is Disabled
grep: grep: No such file or directory
Checking ---- : Check Remote Apple Events Is Disabled
Checking ---- : Check Internet Sharing Is Disabled
Checking ---- : Check Content Caching Is Disabled
Checking ---- : Check Media Sharing Is Disabled
Checking ---- : Check Bluetooth Sharing Is Disabled
2023-04-29 06:22:45.308 defaults[3328:29180]
The domain/default pair of (com.apple.Bluetooth, PrefKeyServicesEnabled) does not exist
Checking ---- : Check that Time Machine is Enabled
Checking ---- : Check Time Machine Volumes Are Encrypted If Time Machine Is Enabled
1
2023-04-29 06:22:45.331 mergen[3274:29182] *** Terminating app due to uncaught exception 'NSFileHandleOperationException', reason: '*** -[NSConcreteFileHandle readDataOfLength:]: Bad file descriptor'
*** First throw call stack:
(
0 CoreFoundation 0x00007ff8137961ba __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007ff8132bc42b objc_exception_throw + 48
2 Foundation 0x00007ff814a72143 -[NSConcreteFileHandle readDataUpToLength:error:] + 0
3 Foundation 0x00007ff814596ce5 -[NSConcreteFileHandle readDataOfLength:] + 605
4 mergen 0x0000000106e54a76 mergen + 96886
5 mergen 0x0000000106e6222f mergen + 152111
6 mergen 0x0000000106e614d9 mergen + 148697
7 libdispatch.dylib 0x00007ff8134a0d91 _dispatch_call_block_and_release + 12
8 libdispatch.dylib 0x00007ff8134a2033 _dispatch_client_callout + 8
9 libdispatch.dylib 0x00007ff8134a8200 _dispatch_lane_serial_drain + 769
10 libdispatch.dylib 0x00007ff8134a8d39 _dispatch_lane_invoke + 366
11 libdispatch.dylib 0x00007ff8134b33fc _dispatch_workloop_worker_thread + 765
12 libsystem_pthread.dylib 0x00007ff81363fc55 _pthread_wqthread + 327
13 libsystem_pthread.dylib 0x00007ff81363ebbf start_wqthread + 15
)
libc++abi: terminating due to uncaught exception of type NSException
[1] 3274 abort ./mergen

Many false positives

First of all, thanks for releasing a nice tool.
However, this tool detects many false positives.

For example, "Check If SSH Is Enabled" tries to find '"com.openssh.sshd" => disabled' from the result of "/bin/launchctl print-disabled system".
But this check module also decides "SSH is Enabled" if SSH is disabled.
In my environment (macOS 12.6.5), "/bin/launchctl print-disabled system" returns like below:

% /bin/launchctl print-disabled system         
disabled services = {
	"com.apple.screensharing" => false
	"com.apple.CSCSupportd" => true
	"com.apple.ftpd" => true
	"com.apple.mdmclient.daemon.runatboot" => true
	"com.apple.dhcp6d" => true
	"com.apple.bootpd" => true
	"com.microsoft.autoupdate.helper" => false
	"com.apple.ftp-proxy" => true
}

Actually, I have never enable SSH on this macOS. So, I guess that "com.openssh.sshd" item does not exist.
Therefore, this check module should determine "SSH is Enabled" only if '"com.openssh.sshd" => enabled' exists.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.