Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Changes to be able to use 1Password to store values from secrets and retrieve them from 1Password #279

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Commits on Dec 18, 2019

  1. add depencency to github.com/sethvargo/go-password v0.1.2

    In order to add a generatePassword native function to kubcfg.libsonnet add
    the required module to vendor/
    thomasmhofmann committed Dec 18, 2019
    Configuration menu
    Copy the full SHA
    65fe073 View commit details
    Browse the repository at this point in the history
  2. add a native function called 'generatePassword'.

    The new function is added to kubecfg.libsonnet. It can be used to
    generate a password with specific properties.
    thomasmhofmann committed Dec 18, 2019
    Configuration menu
    Copy the full SHA
    616bb51 View commit details
    Browse the repository at this point in the history
  3. add depencency to github.com/mattn/go-shellwords

    In order to add an exec native function to kubcfg.libsonnet add
    the required module to vendor/
    thomasmhofmann committed Dec 18, 2019
    Configuration menu
    Copy the full SHA
    8df7045 View commit details
    Browse the repository at this point in the history
  4. add option to restrict the symbols used in generated passwords

    As some symbols can cause trouble (e.g. when these are part of
    a JSON string an passed on the command line to some other
    tool) the symbols that the password generator will use can be
    customized.
    thomasmhofmann committed Dec 18, 2019
    Configuration menu
    Copy the full SHA
    fe1cfbb View commit details
    Browse the repository at this point in the history
  5. add a native function to execute programs

    The 'exec' native function is added to kubecfg.libsonnet.
    It can be used to execute external programs from inside
    the jsonnet VM.
    This is useful for example to interact with the CLI for
    1password to store and retrieve credentials.
    thomasmhofmann committed Dec 18, 2019
    Configuration menu
    Copy the full SHA
    086b276 View commit details
    Browse the repository at this point in the history
  6. add depencency to github.com/DaKnOb/ntlm

    In order to implement a native function to create
    NT(LM) hashes for passwords update vendor with
    new dependency.
    thomasmhofmann committed Dec 18, 2019
    Configuration menu
    Copy the full SHA
    e361c33 View commit details
    Browse the repository at this point in the history
  7. add a native function to create an NT(LM) hash for a password.

    The 'ntHashFromPassword' native function is added to kubecfg.libsonnet.
    It can be used to calculate the NT(LM) hash for a password.
    This is useful when these kinds of hashes need to be created in order
    to add them to some initial configurations for applications that
    expect this format (e.g. Alfresco DMS).
    thomasmhofmann committed Dec 18, 2019
    Configuration menu
    Copy the full SHA
    543b6de View commit details
    Browse the repository at this point in the history
  8. add a native function to encode a string to base64-url-encoding

    The jsonnet std library does not include such a function.
    It is needed for applications that expect URL encoding style
    for base64-encoding.
    thomasmhofmann committed Dec 18, 2019
    Configuration menu
    Copy the full SHA
    07ed9d1 View commit details
    Browse the repository at this point in the history
  9. add an example library to integrate kubecfg with 1Password

    This commit includes '1password.libsonnet' that builds on the
    new features commited before to kubecfg like:
    - generatePassword
    - execProgram
    - ntHashFromPassword
    - encodeBase64Url
    
    This library can be used to generate password for secrets.
    These password are then stored in a vault in 1Password.
    Once the new item containing the secrets is stored in the
    1Password vault kubecfg will use these when 'rendering'
    the secret resource.
    
    In addition to the library 'secrets.jsonnet' is provided as an
    example on how to use the library.
    thomasmhofmann committed Dec 18, 2019
    Configuration menu
    Copy the full SHA
    1cd87e0 View commit details
    Browse the repository at this point in the history
  10. add function 'getItemFrom1Password'

    This function will return the plan JSON representation
    for an item stored in 1Password.
    In contrast the existing method 'getPasswordFrom1Password'
    expects an item of type / category 'Password'.
    The JSON returned can be processed in any way needed.
    This is mainly useful for item created in manually in 1Password.
    thomasmhofmann committed Dec 18, 2019
    Configuration menu
    Copy the full SHA
    a923219 View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2019

  1. add support for a fallback password

    Adds a new field 'fallback' to generatedPasswords_ field in
    OnePasswordSecret that is used when the useFallbackValues
    parameter to OnePasswordSecret is set to true.
    
    This is useful for example for local development clusters
    like minikube that do not require generated passwords
    and storage in 1Password.
    
    Also fixes a comment and changes some formatting.
    
    Run with:
    kubecfg show examples/1password/secrets.jsonnet --tla-code=useFallbackValues=true
    
    and
    
    kubecfg show examples/1password/secrets.jsonnet --tla-code=useFallbackValues=false
    or
    kubecfg show examples/1password/secrets.jsonnet
    thomasmhofmann committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    a594676 View commit details
    Browse the repository at this point in the history
  2. improve tracing messages

    Add more detail to messages traced in 1password.libsonnet
    and use std.format for concatinating strings.
    thomasmhofmann committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    1904868 View commit details
    Browse the repository at this point in the history

Commits on Dec 20, 2019

  1. add support for a fallback object to function getItemFrom1Password

    The getItemFrom1Password function now also supports passing
    a fallback value in form of an JSON object.
    
    Examples in 'secrets.jsonnet' have been adjustes to showcase this
    feature.
    
    Trace messages have been improved.
    thomasmhofmann committed Dec 20, 2019
    Configuration menu
    Copy the full SHA
    15e25cf View commit details
    Browse the repository at this point in the history

Commits on Jan 20, 2020

  1. End execution in case item cannot be read from 1Password.

    Error out of execution in case an item cannot be read from 1Password
    and useFallbackValue is set to false.
    thomasmhofmann committed Jan 20, 2020
    Configuration menu
    Copy the full SHA
    7397a79 View commit details
    Browse the repository at this point in the history