Giter VIP home page Giter VIP logo

stronghold's Introduction

stronghold logo

Downloads

stronghold is the easiest way to securely configure your Mac.

GIF demo

Designed for macOS Sierra and High Sierra. Not yet tested on macOS Mojave, but I'm working on updating it!

Usage

Usage: stronghold.py [OPTIONS]

  Securely configure your Mac.
  Developed by Aaron Lichtman -> (Github: alichtman)


Options:
  -lockdown  Set secure configuration without user interaction.
  -v         Display version and author information and exit.
  -help, -h  Show this message and exit.

Installation Options

  1. Install with pip

    • $ pip install stronghold
    • $ stronghold
  2. Download the stronghold binary from Releases tab.

Configuration Options

  1. Firewall

    • Turn on Firewall?
      • This helps protect your Mac from being attacked over the internet.
    • Turn on logging?
      • If there IS an infection, logs are useful for determining the source.
    • Turn on stealth mode?
      • Your Mac will not respond to ICMP ping requests or connection attempts from closed TCP and UDP networks.
  2. General System Protection

    • Enable Gatekeeper?
      • Defend against malware by enforcing code signing and verifying downloaded applications before allowing them to run.
    • Prevent automatic software whitelisting?
      • Both built-in and downloaded software will require user approval for whitelisting.
    • Disable Captive Portal Assistant and force login through browser on untrusted networks?
      • Captive Portal Assistant could be triggered and direct you to a malicious site WITHOUT any user interaction.
  3. User Metadata Storage

    • Clear language modeling metadata?
      • This includes user spelling, typing and suggestion data.
    • Disable language modeling data collection?
    • Clear QuickLook metadata?
    • Clear Downloads metadata?
    • Disable metadata collection from Downloads?
    • Clear SiriAnalytics database?
  4. User Safety

    • Lock Mac as soon as screen saver starts?
    • Display all file extensions?
      • This prevents malware from disguising itself as another file type.
    • Disable saving documents to the cloud by default?
      • This prevents sensitive documents from being unintentionally stored on the cloud.
    • Show hidden files in Finder?
      • This lets you see all files on the system without having to use the terminal.
    • Disable printer sharing?
      • Offers redundancy in case the Firewall was not configured.

How to Contribute

  1. Clone repo and create a new branch: $ git checkout https://github.com/alichtman/stronghold -b name_for_new_branch.
  2. Make changes and test
  3. Submit Pull Request with comprehensive description of changes

Acknowledgements

Donations

This is free, open-source software. If you'd like to support the development of future projects, or say thanks for this one, you can donate BTC at 1FnJ8hRRNUtUavngswUD21dsFNezYLX5y9.

stronghold's People

Contributors

alichtman avatar punkeel avatar royari 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  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

stronghold's Issues

Firewall sudo password incorrect bug

image

Should skip all firewall options if sudo password not entered correctly.

Although, maybe just leave this as-is because they'll be prompted for the pass again when the reset socketfilterfw command is run and they won't have the pass then either. No password, no changes. So no problem?

Clear Downloads Metadata bug

BUG -> /bin/sh:/Users/alichtman/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2: Operation not permitted

if prompt_yes_no(bottom_line="-> Clear Downloads metadata?"):
	print_confirmation("Removing Downloads metadata...")
	sp.run(':>~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2', shell=True, stdout=sp.PIPE)

Prevent automatic software whitelisting

 -> Prevent automatic software whitelisting?
[?] Both built-in and downloaded software will require user approval for whitelisting.:  Yes
 >  Yes
    No

Preventing automatic whitelisting...

Traceback (most recent call last):
  File "/usr/local/bin/stronghold", line 10, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/stronghold.py", line 375, in cli
    system_protection_config()
  File "/usr/local/lib/python2.7/site-packages/stronghold.py", line 149, in system_protection_config
    sp.run(['sudo', '/usr/libexec/ApplicationFirewall/socketfilterfw', '--setallowsigned', 'off'], stdout=sp.PIPE)
AttributeError: 'module' object has no attribute 'run'

Stronghold using system version of python instead of brew version.

Using terminal and typing "python -V" shows 3.6.5. As well, it's been set in pyenv.

When running stronghold, after setting first security setting, "firewall", the app crashes, siting it's using python 2.7. I've tried sy-linking python 3 to python, using pyenv to set 3.6.5 as default.

Error below:
Traceback (most recent call last):
File "/usr/local/bin/stronghold", line 11, in
sys.exit(cli())
File "/Library/Python/2.7/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/Library/Python/2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Library/Python/2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Python/2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Library/Python/2.7/site-packages/stronghold.py", line 374, in cli
firewall_config()
File "/Library/Python/2.7/site-packages/stronghold.py", line 108, in firewall_config
if sp.run("sudo -E -v", shell=True, stdout=sp.PIPE).returncode != 0:
AttributeError: 'module' object has no attribute 'run'

Firewall Configuration Error

When running stronghold and responding "yes" to turn on the firewall, I get the error "Invalid sudo password. Firewall configuration aborted."

Here's a screenshot:
Screen Shot 2021-01-10 at 8 27 31 PM

Not sure if this is because I am on MacOS Big Sur or if it is a separate issue altogether.

Possible bug: restart keeps getting interrupted

As above... tried running with both 'stronghold' and 'sudo stronghold' and both have this problem. See what I'm getting below:

###########################
# FINAL CONFIGURATION STEPS
###########################

 -> Restart your Mac right now?
[?] This is necessary for some configuration changes to take effect.:  Yes
 >  Yes
    No

Configuration complete after restart!

Restarting in 5 seconds...
4...
3...
2...
1...
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [-AbEHknPS] [-C num] [-g group] [-h host] [-p prompt] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-C num] [-g group] [-h host] [-p prompt] [-u user] file ...
WARNING: Configuration not complete! A full restart is necessary.

Does stronghold work with macOS 10.12.6?

I just installed it with pip, and it keeps bombing out:


Traceback (most recent call last):
  File "/usr/local/bin/stronghold", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/stronghold.py", line 356, in cli
    firewall_config()
  File "/usr/local/lib/python2.7/site-packages/stronghold.py", line 106, in firewall_config
    if sp.run("sudo -E -v", shell=True, stdout=sp.PIPE).returncode != 0:
AttributeError: 'module' object has no attribute 'run'

Clear Siri Data

Uhhhhh...

print_confirmation("Clearing SiriAnalytics data...")
if os.isfile("~/Library/Assistant/SiriAnalytics.db"):
    sp.run('sudo rm ~/Library/Assistant/SiriAnalytics.db ', shell=True, stdout=sp.PIPE)

Screen Saver settings

It seems that the two keys used to set up the screen saver password, askForPassword and askForPasswordDelay are no longer used in the latest versions of macOS High Sierra.

Set up CI Testing

Travis CI doesn't allow mixing of python and OSX, so we'll need to explore using a different service.

Error

schermata 2018-08-11 alle 11 57 05

I'm running
High Sierra 10.13.6
Darwin 17.7.0
Python 2.7.15

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.