Skip to main content

Kerberos Ticket Manager

build status

Simple kinit wrapper to update Kerberos ticket periodically for long running application.

Getting Started

Periodical kerberos ticket update

from krbticket import KrbTicket

ticket = KrbTicket.init("<principal>", "<keytab path>")
ticket.updater_start()

If keytab path is not specifyed, kinit uses KRB5_KTNAME env, or /etc/krb5.keytab to find a keytab file. see: kerberos(1) and kinit(1).

Ticket Updater Strategies

To avoid a credential cache (ccache) corruption by concurrent updates from multiple processes, KrbTicketUpdater has a few update strategies:

  • SimpleKrbTicketUpdater: for single updater process, or multiple updaters w/ per process ccache. (default)
  • MultiProcessKrbTicketUpdater: for multiple updater processes w/ exclusive file lock
  • SingleProcessKrbTicketUpdater: for multiple updater processes w/ exclusive file lock to restrict the number of updater processes to one against the ccache
from krbticket import KrbTicket, SingleProcessKrbTicketUpdater

ticket = KrbTicket.init("<principal>", "<keytab path>", updater_class=SingleProcessKrbTicketUpdater)
ticket.updater_start()

Retry

krbticket supports retry feature utilizing retrying which provides various retry strategy. To change the behavior, pass the options using retry_options of KrbConfig. The dafault values are:

  • wait_exponential_multiplier = 1000
  • wait_exponential_max = 30000
  • stop_max_attempt_number = 10
from krbticket import KrbTicket

retry_options = {
  'wait_exponential_multiplier': 1000,
  'wait_exponential_max': 10000,
  'stop_max_attempt_number': 5
}
ticket = KrbTicket.init("<principal>", "<keytab path>", retry_options=retry_options)
ticket.updater_start()

Update Interval

TBD

Test

docker run --rm -p 88:88 ksauzz/docker-krb5:0.0.1
pip install -r requirements-test.txt -r requirements.txt
KRB5_CONFIG=tests/conf/krb5.conf.local pytest

Metadata

Release files for krbticket 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for krbticket 1.0.6
File Size Uploaded Provenance Actions
krbticket-1.0.6.tar.gz 11.0 kB Without provenance Details for krbticket-1.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for krbticket 1.0.6
File Interpreter ABI Platform Actions
krbticket-1.0.6-py3-none-any.whl Python 3 none any Details for krbticket-1.0.6-py3-none-any.whl

Total release size: 18.5 kB

Release files / krbticket-1.0.6.tar.gz

Download URL krbticket-1.0.6.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f3eff7f3089ba5a7753be0644380e2d605b2124a53628789e41b2ee24b77c810
BLAKE2b-256 checksum
How to use checksums
b2ded00159986d398da6da07253a392f324e880e758b21bf1478e0e6c6371cf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release files / krbticket-1.0.6-py3-none-any.whl

Download URL krbticket-1.0.6-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3c3a387e44813e40014b341e4397573484923d7cca93584ffa75a185fec8c84
BLAKE2b-256 checksum
How to use checksums
7106bfe8ad74a858255414a5a9e561e43bd000650645551969e41fe211cc86f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Security for krbticket 1.0.6

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page