{"action":"created","comment":{"url":"https://api.github.com/repos/mushorg/glastopf/pulls/comments/236632742","pull_request_review_id":178743423,"id":236632742,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjYzMjc0Mg==","diff_hunk":"@@ -78,29 +80,80 @@ if __name__ == '__main__':\n     setup_logging(logconsole, logfile, args.verbose, args.workdir)\n \n     host = conf_parser.get(\"webserver\", \"host\")\n-    port = conf_parser.getint(\"webserver\", \"port\")\n-    \n+\n+    ports=[]\n+    if conf_parser.get('webserver', 'port') and conf_parser.get('webserver', 'port')!='' :\n+        ports = map(int, conf_parser.get('webserver', 'port').split(','))\n+    ssl_ports=[]\n+    if conf_parser.has_option('ssl','port') and conf_parser.get('ssl', 'port')!='':\n+            ssl_ports =  map(int, conf_parser.get('ssl', 'port').split(','))\n+\n+\n     if conf_parser.get(\"ssl\", \"enabled\"):\n         ssl = {\n             'certfile': conf_parser.get(\"ssl\", \"certfile\"),\n             'keyfile': conf_parser.get(\"ssl\", \"keyfile\"),\n-            'ciphers': 'RC4',\n+            'ciphers': 'AES256',\n         }\n-\n+        # create ssl certificate if none is present.\n+        if (ssl['certfile']) and (ssl['keyfile']):\n+            if (not os.path.exists(args.workdir+'/'+ssl['certfile'])) or (not os.path.exists(args.workdir+'/'+ssl['keyfile'])):\n+                logger.error(\"SSL keys do not exist, creating new ssl keys.\")\n+                client_key = crypto.PKey()\n+                client_key.generate_key(crypto.TYPE_RSA, 2048)\n+                client_cert = crypto.X509()\n+                client_cert.set_version(2)\n+                client_subj = client_cert.get_subject()\n+                client_subj.CN = \"localhost\"\n+                client_cert.set_serial_number(random.randint(50000000, 100000000))\n+                client_cert.gmtime_adj_notBefore(0)\n+                client_cert.gmtime_adj_notAfter(10 * 365 * 24 * 60 * 60)\n+                client_cert.set_issuer(client_cert.get_subject())\n+                client_cert.set_pubkey(client_key)\n+                client_cert.sign(client_key, 'sha256')\n+\n+                with open(ssl['certfile'], \"wt\") as f:","path":"bin/glastopf-runner","position":49,"original_position":49,"commit_id":"98dcbe9560bf5f3093ce45e9dd2c2b389bd17e06","original_commit_id":"98dcbe9560bf5f3093ce45e9dd2c2b389bd17e06","user":{"login":"glaslos","id":716339,"node_id":"MDQ6VXNlcjcxNjMzOQ==","avatar_url":"https://avatars0.githubusercontent.com/u/716339?v=4","gravatar_id":"","url":"https://api.github.com/users/glaslos","html_url":"https://github.com/glaslos","followers_url":"https://api.github.com/users/glaslos/followers","following_url":"https://api.github.com/users/glaslos/following{/other_user}","gists_url":"https://api.github.com/users/glaslos/gists{/gist_id}","starred_url":"https://api.github.com/users/glaslos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glaslos/subscriptions","organizations_url":"https://api.github.com/users/glaslos/orgs","repos_url":"https://api.github.com/users/glaslos/repos","events_url":"https://api.github.com/users/glaslos/events{/privacy}","received_events_url":"https://api.github.com/users/glaslos/received_events","type":"User","site_admin":false},"body":"why are you not using `args.workdir` here?","created_at":"2018-11-27T12:00:47Z","updated_at":"2018-11-27T12:03:55Z","html_url":"https://github.com/mushorg/glastopf/pull/296#discussion_r236632742","pull_request_url":"https://api.github.com/repos/mushorg/glastopf/pulls/296","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/mushorg/glastopf/pulls/comments/236632742"},"html":{"href":"https://github.com/mushorg/glastopf/pull/296#discussion_r236632742"},"pull_request":{"href":"https://api.github.com/repos/mushorg/glastopf/pulls/296"}}},"pull_request":{"url":"https://api.github.com/repos/mushorg/glastopf/pulls/296","id":233594762,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNTk0NzYy","html_url":"https://github.com/mushorg/glastopf/pull/296","diff_url":"https://github.com/mushorg/glastopf/pull/296.diff","patch_url":"https://github.com/mushorg/glastopf/pull/296.patch","issue_url":"https://api.github.com/repos/mushorg/glastopf/issues/296","number":296,"state":"open","locked":false,"title":"Listening on multiple http and ssl ports","user":{"login":"vorband","id":4286101,"node_id":"MDQ6VXNlcjQyODYxMDE=","avatar_url":"https://avatars3.githubusercontent.com/u/4286101?v=4","gravatar_id":"","url":"https://api.github.com/users/vorband","html_url":"https://github.com/vorband","followers_url":"https://api.github.com/users/vorband/followers","following_url":"https://api.github.com/users/vorband/following{/other_user}","gists_url":"https://api.github.com/users/vorband/gists{/gist_id}","starred_url":"https://api.github.com/users/vorband/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vorband/subscriptions","organizations_url":"https://api.github.com/users/vorband/orgs","repos_url":"https://api.github.com/users/vorband/repos","events_url":"https://api.github.com/users/vorband/events{/privacy}","received_events_url":"https://api.github.com/users/vorband/received_events","type":"User","site_admin":false},"body":"For the [sissden project](https://sissden.eu), we modified glastopf to serve on multiple http and ssl ports. \r\nThe following options are available while ensuring compatibility with old config files. \r\n\r\na) set the http port in [webserver]/port with a single **or multiple ports**, e.g. `port = 80,8888,8080` => glastopf will run on http ports 80, 8080, 8088\r\n\r\n```\r\n[webserver]\r\nhost = 0.0.0.0\r\nport = 80,8080,8088\r\n...\r\n```\r\n\r\nb) use ssl on the above ports by enabling [ssl] `enabled = True` => glastopf will enable ssl on the above configured http ports 80,8080,8088\r\n\r\n```\r\n[webserver]\r\nhost = 0.0.0.0\r\nport = 80,8080,8088\r\n...\r\n\r\n[ssl]\r\nenabled = True\r\ncertfile = ssl/server.crt\r\nkeyfile = ssl/server.key\r\n```\r\nc) use distinct ports for ssl by adding the port entry, e.g. 443,8443 to the [ssl] section. The ports 80,8080,8088 from the webserver section will still deliver http unless the port is left empty (== ssl only) => glastopf will run http ports 80,8080,8088 and ssl ports  443,8443\r\n\r\n```\r\n[webserver]\r\nhost = 0.0.0.0\r\nport = 80,8080,8088\r\nuid = nobody\r\ngid = nogroup\r\nproxy_enabled = False\r\n\r\n[ssl]\r\nenabled = True\r\ncertfile = ssl/server.crt\r\nkeyfile = ssl/server.key\r\nport = 443,8443\r\n\r\n```\r\nLike this, glastopf is compatible with old config files but also enables new configs to setup multiple new http/ssl listeners.\r\n\r\nFurther *glastopf-runner* removes RC4 in SSL as this broke ssl connectivity with contemporary clients and replaced it with AES256. \r\n\r\nFinally, *glastopf-runner* now generates self-signed ssl certificates (issued to localhost) as soon as a path/filename is configured and no certificate-/ keyfile is present. Still works if configured with existing keys, but this enables dockerized operation with new keys generated upon every start (important for large-scale deployments). \r\n","created_at":"2018-11-26T15:20:50Z","updated_at":"2018-11-27T12:03:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ac0818ec10f83cf8dc36e4b26ad7a54f7262e208","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mushorg/glastopf/pulls/296/commits","review_comments_url":"https://api.github.com/repos/mushorg/glastopf/pulls/296/comments","review_comment_url":"https://api.github.com/repos/mushorg/glastopf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mushorg/glastopf/issues/296/comments","statuses_url":"https://api.github.com/repos/mushorg/glastopf/statuses/98dcbe9560bf5f3093ce45e9dd2c2b389bd17e06","head":{"label":"vorband:dev_multiport_ssl","ref":"dev_multiport_ssl","sha":"98dcbe9560bf5f3093ce45e9dd2c2b389bd17e06","user":{"login":"vorband","id":4286101,"node_id":"MDQ6VXNlcjQyODYxMDE=","avatar_url":"https://avatars3.githubusercontent.com/u/4286101?v=4","gravatar_id":"","url":"https://api.github.com/users/vorband","html_url":"https://github.com/vorband","followers_url":"https://api.github.com/users/vorband/followers","following_url":"https://api.github.com/users/vorband/following{/other_user}","gists_url":"https://api.github.com/users/vorband/gists{/gist_id}","starred_url":"https://api.github.com/users/vorband/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vorband/subscriptions","organizations_url":"https://api.github.com/users/vorband/orgs","repos_url":"https://api.github.com/users/vorband/repos","events_url":"https://api.github.com/users/vorband/events{/privacy}","received_events_url":"https://api.github.com/users/vorband/received_events","type":"User","site_admin":false},"repo":{"id":158385242,"node_id":"MDEwOlJlcG9zaXRvcnkxNTgzODUyNDI=","name":"glastopf","full_name":"vorband/glastopf","private":false,"owner":{"login":"vorband","id":4286101,"node_id":"MDQ6VXNlcjQyODYxMDE=","avatar_url":"https://avatars3.githubusercontent.com/u/4286101?v=4","gravatar_id":"","url":"https://api.github.com/users/vorband","html_url":"https://github.com/vorband","followers_url":"https://api.github.com/users/vorband/followers","following_url":"https://api.github.com/users/vorband/following{/other_user}","gists_url":"https://api.github.com/users/vorband/gists{/gist_id}","starred_url":"https://api.github.com/users/vorband/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vorband/subscriptions","organizations_url":"https://api.github.com/users/vorband/orgs","repos_url":"https://api.github.com/users/vorband/repos","events_url":"https://api.github.com/users/vorband/events{/privacy}","received_events_url":"https://api.github.com/users/vorband/received_events","type":"User","site_admin":false},"html_url":"https://github.com/vorband/glastopf","description":"Web Application Honeypot","fork":true,"url":"https://api.github.com/repos/vorband/glastopf","forks_url":"https://api.github.com/repos/vorband/glastopf/forks","keys_url":"https://api.github.com/repos/vorband/glastopf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vorband/glastopf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vorband/glastopf/teams","hooks_url":"https://api.github.com/repos/vorband/glastopf/hooks","issue_events_url":"https://api.github.com/repos/vorband/glastopf/issues/events{/number}","events_url":"https://api.github.com/repos/vorband/glastopf/events","assignees_url":"https://api.github.com/repos/vorband/glastopf/assignees{/user}","branches_url":"https://api.github.com/repos/vorband/glastopf/branches{/branch}","tags_url":"https://api.github.com/repos/vorband/glastopf/tags","blobs_url":"https://api.github.com/repos/vorband/glastopf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vorband/glastopf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vorband/glastopf/git/refs{/sha}","trees_url":"https://api.github.com/repos/vorband/glastopf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vorband/glastopf/statuses/{sha}","languages_url":"https://api.github.com/repos/vorband/glastopf/languages","stargazers_url":"https://api.github.com/repos/vorband/glastopf/stargazers","contributors_url":"https://api.github.com/repos/vorband/glastopf/contributors","subscribers_url":"https://api.github.com/repos/vorband/glastopf/subscribers","subscription_url":"https://api.github.com/repos/vorband/glastopf/subscription","commits_url":"https://api.github.com/repos/vorband/glastopf/commits{/sha}","git_commits_url":"https://api.github.com/repos/vorband/glastopf/git/commits{/sha}","comments_url":"https://api.github.com/repos/vorband/glastopf/comments{/number}","issue_comment_url":"https://api.github.com/repos/vorband/glastopf/issues/comments{/number}","contents_url":"https://api.github.com/repos/vorband/glastopf/contents/{+path}","compare_url":"https://api.github.com/repos/vorband/glastopf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vorband/glastopf/merges","archive_url":"https://api.github.com/repos/vorband/glastopf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vorband/glastopf/downloads","issues_url":"https://api.github.com/repos/vorband/glastopf/issues{/number}","pulls_url":"https://api.github.com/repos/vorband/glastopf/pulls{/number}","milestones_url":"https://api.github.com/repos/vorband/glastopf/milestones{/number}","notifications_url":"https://api.github.com/repos/vorband/glastopf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vorband/glastopf/labels{/name}","releases_url":"https://api.github.com/repos/vorband/glastopf/releases{/id}","deployments_url":"https://api.github.com/repos/vorband/glastopf/deployments","created_at":"2018-11-20T12:20:35Z","updated_at":"2018-11-20T12:41:39Z","pushed_at":"2018-11-23T10:41:09Z","git_url":"git://github.com/vorband/glastopf.git","ssh_url":"git@github.com:vorband/glastopf.git","clone_url":"https://github.com/vorband/glastopf.git","svn_url":"https://github.com/vorband/glastopf","homepage":"http://glastopf.org","size":2973,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"mushorg:master","ref":"master","sha":"31b82a0b719e2ce4530bd2bfcc1c24e2a3d95e6f","user":{"login":"mushorg","id":2742625,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3NDI2MjU=","avatar_url":"https://avatars3.githubusercontent.com/u/2742625?v=4","gravatar_id":"","url":"https://api.github.com/users/mushorg","html_url":"https://github.com/mushorg","followers_url":"https://api.github.com/users/mushorg/followers","following_url":"https://api.github.com/users/mushorg/following{/other_user}","gists_url":"https://api.github.com/users/mushorg/gists{/gist_id}","starred_url":"https://api.github.com/users/mushorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mushorg/subscriptions","organizations_url":"https://api.github.com/users/mushorg/orgs","repos_url":"https://api.github.com/users/mushorg/repos","events_url":"https://api.github.com/users/mushorg/events{/privacy}","received_events_url":"https://api.github.com/users/mushorg/received_events","type":"Organization","site_admin":false},"repo":{"id":6712417,"node_id":"MDEwOlJlcG9zaXRvcnk2NzEyNDE3","name":"glastopf","full_name":"mushorg/glastopf","private":false,"owner":{"login":"mushorg","id":2742625,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3NDI2MjU=","avatar_url":"https://avatars3.githubusercontent.com/u/2742625?v=4","gravatar_id":"","url":"https://api.github.com/users/mushorg","html_url":"https://github.com/mushorg","followers_url":"https://api.github.com/users/mushorg/followers","following_url":"https://api.github.com/users/mushorg/following{/other_user}","gists_url":"https://api.github.com/users/mushorg/gists{/gist_id}","starred_url":"https://api.github.com/users/mushorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mushorg/subscriptions","organizations_url":"https://api.github.com/users/mushorg/orgs","repos_url":"https://api.github.com/users/mushorg/repos","events_url":"https://api.github.com/users/mushorg/events{/privacy}","received_events_url":"https://api.github.com/users/mushorg/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mushorg/glastopf","description":"Web Application Honeypot","fork":false,"url":"https://api.github.com/repos/mushorg/glastopf","forks_url":"https://api.github.com/repos/mushorg/glastopf/forks","keys_url":"https://api.github.com/repos/mushorg/glastopf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mushorg/glastopf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mushorg/glastopf/teams","hooks_url":"https://api.github.com/repos/mushorg/glastopf/hooks","issue_events_url":"https://api.github.com/repos/mushorg/glastopf/issues/events{/number}","events_url":"https://api.github.com/repos/mushorg/glastopf/events","assignees_url":"https://api.github.com/repos/mushorg/glastopf/assignees{/user}","branches_url":"https://api.github.com/repos/mushorg/glastopf/branches{/branch}","tags_url":"https://api.github.com/repos/mushorg/glastopf/tags","blobs_url":"https://api.github.com/repos/mushorg/glastopf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mushorg/glastopf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mushorg/glastopf/git/refs{/sha}","trees_url":"https://api.github.com/repos/mushorg/glastopf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mushorg/glastopf/statuses/{sha}","languages_url":"https://api.github.com/repos/mushorg/glastopf/languages","stargazers_url":"https://api.github.com/repos/mushorg/glastopf/stargazers","contributors_url":"https://api.github.com/repos/mushorg/glastopf/contributors","subscribers_url":"https://api.github.com/repos/mushorg/glastopf/subscribers","subscription_url":"https://api.github.com/repos/mushorg/glastopf/subscription","commits_url":"https://api.github.com/repos/mushorg/glastopf/commits{/sha}","git_commits_url":"https://api.github.com/repos/mushorg/glastopf/git/commits{/sha}","comments_url":"https://api.github.com/repos/mushorg/glastopf/comments{/number}","issue_comment_url":"https://api.github.com/repos/mushorg/glastopf/issues/comments{/number}","contents_url":"https://api.github.com/repos/mushorg/glastopf/contents/{+path}","compare_url":"https://api.github.com/repos/mushorg/glastopf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mushorg/glastopf/merges","archive_url":"https://api.github.com/repos/mushorg/glastopf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mushorg/glastopf/downloads","issues_url":"https://api.github.com/repos/mushorg/glastopf/issues{/number}","pulls_url":"https://api.github.com/repos/mushorg/glastopf/pulls{/number}","milestones_url":"https://api.github.com/repos/mushorg/glastopf/milestones{/number}","notifications_url":"https://api.github.com/repos/mushorg/glastopf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mushorg/glastopf/labels{/name}","releases_url":"https://api.github.com/repos/mushorg/glastopf/releases{/id}","deployments_url":"https://api.github.com/repos/mushorg/glastopf/deployments","created_at":"2012-11-15T21:57:07Z","updated_at":"2018-11-22T13:49:24Z","pushed_at":"2018-11-26T15:20:51Z","git_url":"git://github.com/mushorg/glastopf.git","ssh_url":"git@github.com:mushorg/glastopf.git","clone_url":"https://github.com/mushorg/glastopf.git","svn_url":"https://github.com/mushorg/glastopf","homepage":"http://glastopf.org","size":2967,"stargazers_count":356,"watchers_count":356,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":142,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":142,"open_issues":4,"watchers":356,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mushorg/glastopf/pulls/296"},"html":{"href":"https://github.com/mushorg/glastopf/pull/296"},"issue":{"href":"https://api.github.com/repos/mushorg/glastopf/issues/296"},"comments":{"href":"https://api.github.com/repos/mushorg/glastopf/issues/296/comments"},"review_comments":{"href":"https://api.github.com/repos/mushorg/glastopf/pulls/296/comments"},"review_comment":{"href":"https://api.github.com/repos/mushorg/glastopf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mushorg/glastopf/pulls/296/commits"},"statuses":{"href":"https://api.github.com/repos/mushorg/glastopf/statuses/98dcbe9560bf5f3093ce45e9dd2c2b389bd17e06"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"glaslos"}}