Code Monkey home page Code Monkey logo

flask-cert-details's Introduction

flask-cert-details

Small utility to demonstrate the validity / rotation of certificates. Particularly helpful for demonstrating HashiCorp Vault's PKI Secrets Engine in Kubernetes clusters.

Note that this will not show details on the certificate chain used in the process of securing in-transit communication with the application.

usage

Set the following environment variables:

  • TLS_CERT_PATH - Filesystem path to certificate file
  • CA_CERT_PATH - Filesystem path to issuing CA file

Run the application:

$ python3 app.py
 * Serving Flask app 'app'
 * Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://0.0.0.0:5000
Press CTRL+C to quit
 * Restarting with stat
 * Debugger is active!

output

Access using a browser either via FQDN, or via the URL presented the CLI (depending on how you're running it):

screenshot of flask-cert-details displaying certificate and CA information

kubernetes

When using in Kubernetes, it's useful to mount the Secret containing the managed certificates as a volume on a deployment:

When something like the Vault Secrets Operator rotates the certificate, the next request to this app will show the details.

...
    spec:
      volumes:
        - name: short-lived-cert
          secret:
            secretName: short-lived-cert
            defaultMode: 420
          ...
          volumeMounts:
            - name: short-lived-cert
              readOnly: true
              mountPath: /opt/certificate/
          ...
          env:
            - name: TLS_CERT_PATH
              value: /opt/certificate/tls.crt
            - name: CA_CERT_PATH
              value: /opt/certificate/issuing_ca
...

flask-cert-details's People

Contributors

benemon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.