This open source project is community-supported. To report a problem or share an idea, use Issues; and if you have a suggestion for fixing the issue, please include those details, too. In addition, use Pull Requests to contribute actual bug fixes or proposed enhancements. We welcome and appreciate all contributions. Got questions or want to discuss something with our team? Join us on Slack!
VCert Python
VCert Python is a Python library and SDK designed to simplify key generation and enrollment of machine identities (also known as SSL/TLS certificates and keys) that comply with enterprise security policy by using the CyberArk Certificate Manager, Self-Hosted or CyberArk Certificate Manager, SaaS.
This implementation is based on the original Go library, https://github.com/Venafi/vcert.
Compatibility
Starting version 0.14.0 vcert-python only supports Python 3.6 or higher
VCert releases are tested using the latest version of CyberArk Certificate Manager, Self-Hosted. The latest VCert release should be compatible with CyberArk Certificate Manager, Self-Hosted 17.3 or higher based on the subset of API methods it consumes.
Installation
Get the library using pip:
pip install vcert
You also can install latest version from github:
pip install https://github.com/Venafi/vcert-python/archive/master.zip
If installation fails collecting dependancies, make sure your python setuptools is up to date. Run the following command to upgrade to the latest version of setuptools.
pip install setuptools -U
Usage example
For code samples of programmatic use, please review the files in /examples.
- For CyberArk Certificate Manager, Self-Hosted, the
zoneformat is the DN of a policy with or without the "\VED\Policy" prefix (e.g. "\VED\Policy\Certificates\VCert" or simply "Certificates\VCert") - For CyberArk Certificate Manager, SaaS, the
zoneformat is the name of an OutagePREDICT Application and the API Alias of an Issuing Template assigned to it delimited by a single backslash character (e.g. "My Application\My CIT")
Prerequisites for using with CyberArk Certificate Manager, Self-Hosted
- A user account that has an authentication token with "certificate:manage,revoke" scope (i.e. access to the "CyberArk VCert SDK" API Application as of 20.1) or has been granted WebSDK Access
- A folder (zone) where the user has been granted the following permissions: View, Read, Write, Create, Revoke (for the revoke action), and Private Key Read (for the pickup action when CSR is service generated)
- Policy applied to the folder which specifies:
- CA Template that CyberArk Certificate Manager, Self-Hosted will use to enroll certificate requests submitted by VCert
- Subject DN values for Organizational Unit (OU), Organization (O), City (L), State (ST) and Country (C)
- Management Type not locked or locked to 'Enrollment'
- Certificate Signing Request (CSR) Generation not locked or locked to 'Service Generated CSR'
- Generate Key/CSR on Application not locked or locked to 'No'
- (Recommended) Disable Automatic Renewal set to 'Yes'
- (Recommended) Key Bit Strength set to 2048 or higher
- (Recommended) Domain Whitelisting policy appropriately assigned
The requirement for the CA Template to be assigned by policy follows a long standing CyberArk best practice which also met our design objective to keep the certificate request process simple for VCert users. If you require the ability to specify the CA Template with the request you can use the CyberArk Certificate Manager, Self-Hosted REST APIs but please be advised this goes against CyberArk recommendations.
Prerequisites for using with CyberArk Certificate Manager, SaaS
- The CyberArk Certificate Manager, SaaS REST API is accessible from the system where VCert
will be executed. Currently, we support the following regions:
https://api.venafi.cloud[US]https://api.venafi.eu[EU]https://api.au.venafi.cloud[AU]https://api.uk.venafi.cloud[UK]https://api.sg.venafi.cloud[SG]https://api.ca.venafi.cloud[CA]
- You have successfully registered for a CyberArk Certificate Manager, SaaS account, have been granted at least the "Resource Owner" role, and know your API key.
- A CA Account and Issuing Template exist and have been configured with:
- Recommended Settings values for:
- Organizational Unit (OU)
- Organization (O)
- City/Locality (L)
- State/Province (ST)
- Country (C)
- Issuing Rules that:
- (Recommended) Limits Common Name and Subject Alternative Name to domains that are allowed by your organization
- (Recommended) Restricts the Key Length to 2048 or higher
- (Recommended) Does not allow Private Key Reuse
- Recommended Settings values for:
- An Application exists where you are among the owners, and you know the Application Name.
- An Issuing Template is assigned to the Application, and you know its API Alias.
Contributing to VCert
CyberArk welcomes contributions from the developer community.
- Fork it to your account (https://github.com/Venafi/vcert-python/fork)
- Clone your fork (
git clone git@github.com:youracct/vcert-python.git) - Create a feature branch (
git checkout -b your-branch-name) - Implement and test your changes
- Commit your changes (
git commit -am 'Added some cool functionality') - Push to the branch (
git push origin your-branch-name) - Create a new Pull Request (https://github.com/youracct/vcert-python/pull/new/your-branch-name)
NOTE: While developing with vcert-python, it is helpful if you are using a virtualenv to
install the vcert-python library from source in development mode with pip install --editable.
See https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
Managing dependencies
requirements.txt and requirements-build.txt are generated by pip-tools and contain hash-pinned transitive dependencies. Do not edit them directly. To add or update a dependency:
- Edit
requirements.in(runtime) orrequirements-build.in(build/test) - Run
make lockto regenerate the lockfiles (requires Docker) - Commit both the
.inand.txtfiles together
Version History
License
Copyright © Venafi, Inc. and CyberArk Software Ltd. ("CyberArk")
VCert is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.
Please direct questions/comments to mis-opensource@cyberark.com.
Metadata
Release files for vcert 0.22.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vcert-0.22.1.tar.gz | 116.0 kB | Without provenance | Details for vcert-0.22.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vcert-0.22.1-py3-none-any.whl | Python 3 | none | any | Details for vcert-0.22.1-py3-none-any.whl |
Total release size: 211.5 kB
Release files / vcert-0.22.1.tar.gz
| Download URL | vcert-0.22.1.tar.gz |
|---|---|
| Size | 116.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64a8c341204176b72c23b8a75cec7b00df9f7a456580c85c9891f7b53d882a03
|
|
BLAKE2b-256 checksum How to use checksums |
429becd7c337d19e777dbab33f8911e17892b14f526268b0be4c875b4e43e2a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Release files / vcert-0.22.1-py3-none-any.whl
| Download URL | vcert-0.22.1-py3-none-any.whl |
|---|---|
| Size | 95.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
57837eba7672c4d26380eee530288ab2bb5a8be43e099ab1cc1756ee77c5fbfc
|
|
BLAKE2b-256 checksum How to use checksums |
24291165053b98b720b304cae79917bb17ab38214c53487b261f47ad065b361c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Security for vcert 0.22.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.