summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Split README and README.mdHEADmasterSimo Sorce2015-10-191-1/+23
| | | | | | | | | | The latter is customized to show Travis' CI build status on Github, and will have more hosting specific content going forward. The regular README will be targeted for offline information, and will not be necessarilya markdown file either. Signed-off-by: Simo Sorce <simo@redhat.com>
* Fix Travis CI buildsChristian Heimes2015-10-192-1/+3
| | | | | | | | | | tox 2.0 has a bug in envsitepackagesdir variable substitution. Install tox<2.0 for Travis CI. Custodia now depends on python-requests. Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Allow non prefixed forwardingSimo Sorce2015-10-191-2/+6
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Add support for using listening on TCP socketsChristian Heimes2015-10-197-49/+107
| | | | | | | | | | | | | | | | | | | The server can be now configured using a new parameter called "server_url". Setting server_url to "http://0.0.0.0:80/" will make the server listen on TCP port 80, while setting it to "http+unix://%2fsocket" will make the server listen on the unix socket named "/socket". The backwards compatible "server_socket" is retained and used if no server_url is provided. The request dict has a new field "client_id" that contains either a PID or a peer name. In the future the field can be augmented with a TLS client cert DN or other similar identifier. Signed-off-by: Christian Heimes <cheimes@redhat.com> Signed-off-by: Simo Sorce <simo@redhat.com>
* Add forwarder pluginSimo Sorce2015-10-193-1/+109
| | | | | | | | This pugin allows to mangle and forward requests to another custodia server, locally or on the network. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Use CustodiaClient in testsSimo Sorce2015-10-192-60/+51
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Add auditing to auth/authz modulesSimo Sorce2015-10-194-10/+77
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Add client classes to query custodia serversSimo Sorce2015-10-191-0/+133
| | | | | | | | This makes it simpler to use a custodia server, whether exposed over HTTP, HTTPS or a unix socket with the http+unix schema. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Add simple Keys-in-Header based authenticationSimo Sorce2015-10-193-1/+53
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* etcdstore: prevent path traversal attacksChristian Heimes2015-10-191-6/+14
| | | | | | | | | | A new internal method _absolute_key() is used to join key name and name space. etcd treats the key space like a file system so the method checks the key for '//', '.', and '..' to prevent invalid paths and path traversal attacks. Signed-off-by: Christian Heimes <cheimes@redhat.com> Signed-off-by: Simo Sorce <simo@redhat.com>
* Implement ETCD based StoreSimo Sorce2015-10-192-0/+95
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Extend store interface to create namespacesSimo Sorce2015-10-193-3/+43
| | | | | | | | | | Use a new verb, "span" to create namespaces/containers. This will be needed for the Etcd plugin which need to distinguish between a directory and a key. The sqlite/enclite just pass the request to their set() method. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Add UserNameSpace auths pluginSimo Sorce2015-10-193-33/+32
| | | | | | | | Moves the secrets.Namespaces plugin to the proper authorizers file and fixes it to properly enforce the user-named namespace is being used. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Add Ability to retrieve peer's SELinux ContextSimo Sorce2015-10-191-2/+16
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Better error handling for enclite storeSimo Sorce2015-10-191-3/+11
| | | | | | | | | The store as throwing an exception in case of an unesisting key. Now it returns None as expected on missing keys, and properly wraps encoding exceptions if the JWE can't be decoded. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Remove filter option for directory listingsSimo Sorce2015-10-193-71/+42
| | | | | | | | | | This commit removes the option to pas a filter parameter. It also changes the way database plugins are expected to return results, results are now expected to be relative to the path requested. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Avoid running tests twiceSimo Sorce2015-10-191-23/+0
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Fix traceback support in python 3.4Simo Sorce2015-10-191-5/+14
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Make tox pep8 happySimo Sorce2015-10-1913-91/+100
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Fix pep8 issuesSimo Sorce2015-10-191-1/+1
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Fix tox env for machine installed python versionSimo Sorce2015-10-191-0/+2
| | | | | | | | With this env var we force the local /bin/coverage to still source locally unavailable modules from the .tox directory. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Also capture loginuid of the remote processPavel Odvody2015-09-011-1/+18
| | | | | Reviewed-by: Simo Sorce <simo@redhat.com> Closes #9
* README: Fix typoColin Walters2015-08-251-1/+1
| | | | | Reviewed-by: Simo Sorce <simo@redhat.com> Closes #8
* Enhance README and point to wikiSimo Sorce2015-08-241-1/+18
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Remove unused directorySimo Sorce2015-08-032-2/+1
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Allow tox to use locally installed packagesSimo Sorce2015-08-031-1/+6
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Release version 0.1.0Simo Sorce2015-08-014-4/+8
|
* add docs/source/_static to fix sphinx build errorChristian Heimes2015-07-271-0/+1
| | | | | | Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com> Closes #7
* Add travis CI supportChristian Heimes2015-07-271-0/+21
| | | | | | | | | | | The .travis.yml configures Travis CI. We only need Python 2.7 as the rest is handled by different tox environments. In order to enable Travis CI, please read http://docs.travis-ci.com/user/getting-started/ and do step 1) and step 2). Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com> Closes #6
* kill() and waitpid() custodia processChristian Heimes2015-07-271-4/+2
| | | | | | | | | | The test suite leaves child processes behind. The teardown class method now call Popen.kill() and Popen.wait() to kill and wait for its child process. Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com> Closes #5
* Make KEMClient actually check the replySimo Sorce2015-07-091-18/+24
| | | | | | | | | Uses the same method as the server, the request and response are quite symmetrical here. also fix a bug with the subject name missing in the replies. Adapt tests. Signed-off-by: Simo Sorce <simo@redhat.com>
* Use tox instead of nosetests in MakefileSimo Sorce2015-07-091-1/+1
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Add audit logSimo Sorce2015-07-093-5/+80
| | | | | | The Secrets class now logs any GET/SET/DEL of a key in a audit log file. Signed-off-by: Simo Sorce <simo@redhat.com>
* Unquote the path before processingSimo Sorce2015-07-081-2/+3
| | | | | | | This avoids issues where spaces get turned to %20 and then name matching comparisons (like for KEMHandler) fail. Signed-off-by: Simo Sorce <simo@redhat.com>
* Automatic testing with py.test, coverage and toxChristian Heimes2015-07-084-0/+86
| | | | | | | | | | The patch provides test automation with tox. Just run 'tox' in the source root to create virtual envs, install custodia from the sources and run the tests on Python 2.7 and 3.4. Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com> Closes: #4
* Fix typos in tests and add cleanupChristian Heimes2015-07-082-3/+11
| | | | | | | | | The patch fixes to typos in the tear down function of two test suites. The tests now cleanup and remove temporary files like Unix socket and test databases. Reviewed-by: Simo Sorce <simo@redhat.com> Closes: #3
* Fix setup.py and dependenciesChristian Heimes2015-07-085-5/+8
| | | | | | | | | | | setup.py now correctly references LICENSE instead of COPYING. README.md has been renamed to README and a symbolic link README -> README.md has been added. distutils is unable to handle a symbolic link as README. The six package is listed in requirements.txt, too. Reviewed-by: Simo Sorce <simo@redhat.com> Closes: #2
* Fix Python 3 portablility issuesSimo Sorce2015-06-072-3/+3
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Use reasonable algorithms based on key typeSimo Sorce2015-06-051-8/+11
| | | | | | | If 'signing_algorithms' is not explicitly set in the configuration file use a reasonable default based on the server key type. Signed-off-by: Simo Sorce <simo@redhat.com>
* Fix name checking for kem backendSimo Sorce2015-06-052-4/+7
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Change KEMClient to be able to encrypt requestsSimo Sorce2015-06-051-30/+50
| | | | | | | Also fix errors in handling encrypted requests, as well errors in the test suite. Signed-off-by: Simo Sorce <simo@redhat.com>
* Add basic debugging capabilitiesSimo Sorce2015-06-057-18/+63
| | | | | | | If debug is set to True, then custodia's own Exception handlers will print a stack trace to standard output to aid debugging. Signed-off-by: Simo Sorce <simo@redhat.com>
* Assume keys are JWK objectsSimo Sorce2015-06-041-5/+7
| | | | | | | | This way clients that already have JWK key objects do not have to export/import them. Other clients can simply call JWK upfront like in the modified test. Signed-off-by: Simo Sorce <simo@redhat.com>
* Add client class to build and parse kem tokensSimo Sorce2015-06-041-5/+32
| | | | | | This makes it easier to build clients. Signed-off-by: Simo Sorce <simo@redhat.com>
* Change KEM Parsing to actually check claimsSimo Sorce2015-06-046-21/+33
| | | | | | | The name ('sub') and the time ('exp') must be checked before letting the reuqest proceed. Signed-off-by: Simo Sorce <simo@redhat.com>
* Do not use the same key for encryption and signingSimo Sorce2015-06-032-38/+95
| | | | | | | | | | using the same key for signing and encryption is generally a frown upon approach in the scirty community as it may lead to some attacks. Change the code to use key pairs, where the first key is the signing key and the second one is the encryption key. Signed-off-by: Simo Sorce <simo@redhat.com>
* Add pylint/pep8 checks to ./tests tooSimo Sorce2015-05-292-1/+6
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Use str to give back more human readable messagesSimo Sorce2015-05-281-2/+2
| | | | | | | These messages are returned as is by the HTTP server as the status code reason, str() returns a more human readable format. Signed-off-by: Simo Sorce <simo@redhat.com>
* Fix packages in setup.pySimo Sorce2015-05-271-1/+1
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Properly handle inputs from a query stringSimo Sorce2015-05-261-9/+21
| | | | | | | parse_qs will always return lists even for single-valued parameters, check for it in the Validator and properly handle the case. Signed-off-by: Simo Sorce <simo@redhat.com>