Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add Python Application to accept incoming network connections [closed]

While running Django webserver, I get a popup window that says - Do you want the application "python" to accept incoming network connections? I always click "Allow" and I can see in my Security & Privacy settings that "python" is there and is set to "Allow incoming connections," but I still get this popup. How can I prevent this popup from reappearing?

Thanks.

like image 645
Jim Avatar asked Oct 30 '13 16:10

Jim


People also ask

How do I resolve the alert about allowing WebDriverAgentRunner Runner app to accept incoming network connections?

Do you want the application “WebDriverAgentRunner-Runner. app” to accept incoming netwoek connections? It has to be closed manually.

How do I stop my Mac from asking to accept incoming network connections?

Answer: A: The specific option is managed by your Security Preferences (as indicated by the message): System Preferences -> Security and Privacy -> Firewall. Under Firewall Options you have the ability to control/deny incoming connections to individual apps.


1 Answers

You can resolve this by signing the offending application binary yourself.

Disclaimer: Signing an application yourself will make an application appear more secure to the operating system, when in reality it isn’t. Only sign applications that you are 100% sure are not spyware or otherwise malicious. If you have any doubts, just uninstall/reinstall. 

Part 1: Create a Signing Identity

The solution I’m going for – signing the app myself – requires that I create a Signing Identity, also known as Signing Certificate. This is very easy to do:

  1. Open Applications > Utilities > Keychain Access.
  2. From the Keychain Access menu, choose Certificate Assistant > Create a Certificate.
  3. Fill in a name for the certificate. This name appears in the Keychain Access utility as the name of the certificate. This is also the name you will use when referencing this certificate. Personally, I used the name, “My Signing Identity.”
  4. Choose Code Signing from the Certificate Type menu.
  5. Choose Self Signed Root from the Type popup menu.
  6. Check the Let me override defaults checkbox.
  7. Click Continue.
  8. Specify a serial number for the certificate. Any number will do as long as you have no other certificate with the same name and serial number.
  9. Click Continue.
  10. Fill in the information for the certificate. You can use real or fake data, I used real data personally.
  11. Click Continue.
  12. Accept the defaults for the rest of the dialogs.

Once completed, you will see your certificate in Keychain Access. Verify the name you picked, and you’re done with this step. Well done!

Step 2: (Re-)Sign your application

Now you have to sign your application. To do this, open up Terminal again and use the following command:

codesign -s "My Signing Identity" -f $(which python) 

A dialog will appear, click "Allow".

Now start your application again. You will get the accept incoming connections dialog one last time. Click "Allow".

enter image description here

From now on you should no longer get the warnings anymore! Now it is possible to enjoy the security of your firewall being active without the inconvenience of having to click "allow" constantly.

Credit: The original source which served as a starting place for this updated and annotated solution guide was https://web.archive.org/web/20140228153242/http://silvanolte.com/blog/2011/01/18/do-you-want-the-application-to-accept-incoming-network-connections

like image 101
Jay Taylor Avatar answered Sep 20 '22 10:09

Jay Taylor