{ "info": { "author": "Matt Field", "author_email": "matt.field@zibawa.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Security :: Cryptography" ], "description": "# IoT_pki\nPublic Key Infrastructure for IoT devices built in python django\n\n# Functionality\nAPI interface allows clients to:\n\n* Request new X509 certificates (subject to approval)\n* Download new X509 certificates once approved\n* Renew existing valid X509 certificates\n\nAdmin interface allows administrators to:\n\n* Create self signed Certificate Authority to sign certificate requests\n* View and approve X509 certificate requests\n* View and revoke existing X509 certificates\n\n# Documentation\n\nhttps://docs.zibawa.com/doku.php?id=pki:start\n\n\n\n# Quick start\n\nBelow are instructions for installing IoT_pki to an EXISTING django project.\nAlternatively you can install as a stand alone django project as explained in https://docs.zibawa.com\nThis assumes that you already have an existing django project to which you want to add PKI module.\n\nIf you want to create an empty django project to install PKI into, then:\n\nCreate Virtual Environment for Python3\n\nmkdir virtualenv\ncd virtualenv\npython3 -m venv iotpki\nsource iotpki/bin/activate\n\n(iotpki)$\n\n\n\n## Install Django and IoT-pki \n\n```\npip install django\npip install django-IoT-pki\n```\n\nCreate empty Django Project\n```\ndjango-admin startproject mytestpki\n```\n\n\n## Create directory for logs (optional)\n\n```\nsudo mkdir /var/log/zibawa\nsudo chmod 751 /var/log/zibawa\nsudo chown -R zibawa:zibawa /var/log/zibawa\n```\n\n\n\n## Create Super User\n\n```\npython manage.py createsuperuser\n```\n\n## settings.py\n\n\n\nAdd hostname to allowed hosts\n\nALLOWED_HOSTS = ['localhost','127.0.0.1','.zibawa.com','.myserver.com']\n\nAdd IoT_pki and rest_framework to Installed apps\n\nINSTALLED_APPS = [\n.....\n'IoT_pki',\n'rest_framework',\n]\n\n\nAdd the following settings to your settings.py if you dont have them already defined.\n```\n#redirects users to admin interface for login\nLOGIN_URL='/admin/'\nLOGIN_REDIRECT_URL = '/admin/'\n#pki sends new certs to any user when defined in email request\nEMAIL_HOST = 'smtp.mymail.com'\nEMAIL_PORT = 587\nEMAIL_HOST_USER = 'me@mymail.com'\nEMAIL_HOST_PASSWORD = 'mypass'\nEMAIL_USE_TLS = True\nDEFAULT_FROM_EMAIL='me@mymail.com'\n\n\n#used to create and renew X509 certificates. The certificate and key used at below location will be used to sign\n#all certificates generated by PKI\nPKI={'host':'secret.myserver.com','port':443,\n \n 'use_ssl':True,#should always be True except for testing\n 'verify_certs':False,#verify identity of server should be True except for testing\n 'path_to_ca_cert':'/path/to/ca.pem',\n 'path_to_ca_key':'/path/to/ca.key',\n 'path_to_certstore':'/home/myCA/certs/',#requires trailing slash, place to keep CA certs\n 'path_to_keystore':'/home/myCA/private/',#requires trailing slash. place to keep ca keys should be permission 400\n 'auto_approve_requests':False,#should be FALSE (true will automatically approve all requests)\n }\n\nCERT_DEFAULTS={'country_name':\"ES\",#obligatory must be 2 letter country code \n 'state_or_province_name':\"Barcelona\",\n 'valid_days':365,#validity of certificates generated must be integer not string\n 'min_days_remaining_for_renewal':400\n \n }\n\n\n#used as part of PKI\nREST_FRAMEWORK = {\n 'DEFAULT_PERMISSION_CLASSES': [\n 'rest_framework.permissions.IsAdminUser',\n ],\n 'PAGE_SIZE': 10\n}\n```\n\n\n\n## urls.py\n\nIf you are installing IoT_pki as a stand alone from github, the below is not necessary, since you will install urls.py as part of the github package. However, if you are adding to an existing django project, you will need to include the following:\n\nIn your main urls.py you need to add the following (to use the Django Rest Framework)\n```\nfrom django.conf.urls import url\nfrom django.contrib import admin\n\nfrom django.conf.urls import include\nfrom rest_framework import routers\nfrom rest_framework.documentation import include_docs_urls\nfrom IoT_pki import views\n\nrouter = routers.DefaultRouter()\n\n\nurlpatterns = [\n \n \n url(r'^admin/', admin.site.urls),\n url(r'^IoT_pki/', include('IoT_pki.urls',namespace='IoT_pki')),\n url(r'^', include(router.urls)),\n url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),\n url(r'^docs/', include_docs_urls(title='zibawa_PKI'))\n \n \n \n]\n```\n\n\n## Perform Database Migration\nMove into your project directory that should have been created just below where you are.\n\ncd mytestpki\npython manage.py migrate\n\n\n## Start the development server\n\n\npython manage.py runserver", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://www.zibawa.com/", "keywords": "", "license": "GNU license", "maintainer": "", "maintainer_email": "", "name": "django-IoT-pki", "package_url": "https://pypi.org/project/django-IoT-pki/", "platform": "", "project_url": "https://pypi.org/project/django-IoT-pki/", "project_urls": { "Homepage": "https://www.zibawa.com/" }, "release_url": "https://pypi.org/project/django-IoT-pki/1.4/", "requires_dist": null, "requires_python": "", "summary": "A simple public key infrastructure to allow issuing and automatic renewal of X509 certificates", "version": "1.4" }, "last_serial": 3047236, "releases": { "1.2": [ { "comment_text": "", "digests": { "md5": "2b23742bf1e8bcdf2687798a136508fb", "sha256": "d4dcdcd9e988ea788dc60dc43ce329c99acbaeb3f0d455841598bd665900fcc7" }, "downloads": -1, "filename": "django_IoT_pki-1.2.tar.gz", "has_sig": false, "md5_digest": "2b23742bf1e8bcdf2687798a136508fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28314, "upload_time": "2017-07-21T08:03:47", "url": "https://files.pythonhosted.org/packages/ba/bf/1c47bd21da613a04c4f612d6ab828c3bd1ef26d1efc9709af5bf871f340b/django_IoT_pki-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "69a3fe94effd093d270e5e06d9cdb1c1", "sha256": "389008a459151d11eeefc40e45fff3477a2c57e99c1c245f55408b4d56a76fe1" }, "downloads": -1, "filename": "django_IoT_pki-1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "69a3fe94effd093d270e5e06d9cdb1c1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 25882, "upload_time": "2017-07-21T10:20:52", "url": "https://files.pythonhosted.org/packages/06/10/817bf67338b3e3077a62cba4dc53fe7e92b54e9950ce7ed1001e8180944c/django_IoT_pki-1.3-py2.py3-none-any.whl" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "502395a5d2ccdab9410d6a3a50248952", "sha256": "779a169e1df632d2140c738c451e008b051e70db94995fd158f470889f09d320" }, "downloads": -1, "filename": "django_IoT_pki-1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "502395a5d2ccdab9410d6a3a50248952", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 26889, "upload_time": "2017-07-25T11:36:03", "url": "https://files.pythonhosted.org/packages/cc/35/cd8651a365080f59a1e863a860ac88c324d1f20ade408633757979f0322d/django_IoT_pki-1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "915ca468fc59615de0a1e6977f7fa9ae", "sha256": "a2e3e2b3825827f7863b4d847b7f4282edd1b984d59079d28adaaaea9f2b47c8" }, "downloads": -1, "filename": "django_IoT_pki-1.4.tar.gz", "has_sig": false, "md5_digest": "915ca468fc59615de0a1e6977f7fa9ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30164, "upload_time": "2017-07-25T11:34:48", "url": "https://files.pythonhosted.org/packages/5e/2d/8956923109e41658dcdf2a5b061a7629e70da119e432986539d97382e0b4/django_IoT_pki-1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "502395a5d2ccdab9410d6a3a50248952", "sha256": "779a169e1df632d2140c738c451e008b051e70db94995fd158f470889f09d320" }, "downloads": -1, "filename": "django_IoT_pki-1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "502395a5d2ccdab9410d6a3a50248952", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 26889, "upload_time": "2017-07-25T11:36:03", "url": "https://files.pythonhosted.org/packages/cc/35/cd8651a365080f59a1e863a860ac88c324d1f20ade408633757979f0322d/django_IoT_pki-1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "915ca468fc59615de0a1e6977f7fa9ae", "sha256": "a2e3e2b3825827f7863b4d847b7f4282edd1b984d59079d28adaaaea9f2b47c8" }, "downloads": -1, "filename": "django_IoT_pki-1.4.tar.gz", "has_sig": false, "md5_digest": "915ca468fc59615de0a1e6977f7fa9ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30164, "upload_time": "2017-07-25T11:34:48", "url": "https://files.pythonhosted.org/packages/5e/2d/8956923109e41658dcdf2a5b061a7629e70da119e432986539d97382e0b4/django_IoT_pki-1.4.tar.gz" } ] }