Git Product home page Git Product logo

ibm / trusted-service-identity Goto Github PK

View Code? Open in Web Editor NEW
27.0 8.0 11.0 32.38 MB

Trusted Service Identity is closing the gap of preventing access to secrets by an untrusted operator during the process of obtaining authorization for data access by the applications running in the public cloud.

License: Apache License 2.0

Dockerfile 1.04% Shell 54.05% Smarty 40.64% Makefile 0.88% Go 3.39%

trusted-service-identity's Introduction

Trusted Service Identity (TSI)

This Universal Workload Identity project (also known as Trusted Service Identity) provides a deployment and an orchestration layer to support CNCF community initiatives Tornjak and SPIRE.

Notice1:

  • For all the original Trusted Workload Identity project, that was preceding the SPIRE and Tornjak integration, and focusing on keys and credentials management, and preventing access to secrets by untrusted administrator, please visit our main-no-spire branch.

Notice2:

  • The TSI version [tsi-version.txt] attempts to match the most recent SPIRE version that is currently supported by Tornjak. (See the Tornjak version file)

Introduction

Here is the stack that represents the layers of the Universal Workload Identity project. Most of the components are part of the CNCF (Cloud Native Computing Fundation) initiative.

technology-stack

Starting from the bottom, we support any Kubernetes Platform, whether this is a native Kubernetes or OpenShift.

Then we have SPIFFE, which defines the identity format and specifies how workloads can securely obtain identity.

Then we have SPIRE, which implements SPIFFE, and it provides the zero trust attestation of workloads and infrastructure. SPIRE is responsible for issuing and rotating of x509 certificates or JWT tokens that are used for representing identity. SPIRE also provides a single point of federation with OIDC discovery to be used across multi-cloud or multi-cluster deployments.

Above the SPIRE, we have Tornjak, a control plane and UI for SPIRE, which together with the K8s workload registrar, defines the organization-wise Universal Workload Identity schema. It provides the identity management across the SPIRE servers.

Then on the top layer we have Universal Trusted Workload Identity that is a guiding principle. It's a concept for using workload identity frameworks. This is not a specific technology.

Attributes of Universal Workload Identity

  • Define a single, consistent organizational identity schema across clusters in different clouds
  • Provide a Zero Trust workload identity framework with strong workload attestation with SPIRE + Cloud-provider Plugins with each K8s installation
  • Manage and audit workload identity, attestation and policies for all k8s workloads in every cluster
  • Linear and centralized management of identities/policies to handle quadratic complexity
  • Single configuration per cloud to federate all cloud access
  • Based on CNCF SPIFFE identity specification

multi-cloud

The Universal, Zero Trust Workload Identity, runs on everything that supports Kubernetes platform. It strengthens the security, by executing the cloud-provider and the platform attestation of the hosting nodes. It can support various identity mechanisms like IAM, Keycloak, and open standards like OpenID using a consistent, universal identity schema.

Tornjak Deployment and Demo examples

For the documentation about deploying Tornjak with the SPIRE server and various demo examples, please see our documentation

Reporting security issues

Our maintainers take security seriously. If you discover a security issue, please bring it to their attention right away!

Please DO NOT file a public issue, they will be removed; instead please reach out to the maintainers privately.

Security reports are greatly appreciated, and Trusted Service Identity team will publicly thank you for it.

trusted-service-identity's People

Contributors

christian-pinto avatar dependabot[bot] avatar dpittner avatar florentinvintila avatar imgbotapp avatar lumjjb avatar maia-iyer avatar mrsabath avatar stefanberger avatar zilosz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trusted-service-identity's Issues

Allow support for multiple namespaces with TSI

Provide a list of namespaces to support TSI secret injection. [ 'trusted-identity', 'my-secure-namespace',.... ]

As a workaround, the TSI can be installed individually on each namespace, but since they all would be using the same intermediate key per node, we need to investigate potential conflicts (when the public interfaces are open and closed). Alternatively we can add the namespace to the host path.

Deprecated CustomResourceDefinition in 1.16

trusted-service-identity$helm uninstall spire
W0830 12:55:30.365659   74273 warnings.go:70] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition

Consistent sorting of pod images.

This needs to be better organized to guarantee the proper sequence of images. Perhaps put images in a hash map and list them out lexicographically.

Images are sorted here, to be displayed in claims:
https://github.com/IBM/trusted-service-identity/blob/images/components/tsi-util/secret-maker.sh#L189-L203

And here is the secret maker that reads the yaml input files:
https://github.com/IBM/trusted-service-identity/blob/images/components/tsi-util/secret-maker.sh#L189-L203

Claims validation should include root CA subject alt names

With #36, intermediate CA subject alt names are checked as part of the claims prefixed by TSI:. This is done for certs part of the chain but which are not the root CA. There may be a usecase where this is useful and can be implemented by extending the claims dictionary population to the root CA as well.

IKS installation on 1.17.7 fails

[debug] Created tunnel using local port: '56135'

[debug] SERVER: "127.0.0.1:56135"

[debug] Original chart version: ""
[debug] CHART PATH: /Users/sabath/workspace/TSI/trusted-service-identity/charts/tsi-node-setup-v1.7.3.tgz

Error: release tsi-setup failed: namespaces "default" is forbidden: User "system:serviceaccount:kube-system:default" cannot get resource "namespaces" in API group "" in the namespace "default"```

To prevent CMD modification, add it to workload identity (claims)

We make sure the pod identity contains image(s) for all the containers and initContainers, sha256 encoded, however, we don't protect the identity based on the provided commands. Users might add/modify the CMD values without affecting the identity.

We should add also the encoded value that contains the following info for all the containers in the pod:

image: ubuntu@sha256:250cc6f3f3ffc5cdaa9d8f4946ac79821aafb4d3afc93928f0de9336eba21aa4
command: [ "/bin/bash", "-c", "--" ]
args: [ "while true; do ls /tsi-secrets; sleep 5; done;" ]

Error handling short-circuit failure for bash scripts

There are several scripts with instances of running a command and using the output without testing it, these commands usually don't error but should be resilent due to changes in API such as oc ..., the CLI may change in the future and the scripts should be able to report failures and errors to make it easier to catch issues down the road.

Random number generator error

During the Cluster setup:
helm install charts/tsi-node-setup --debug --name tsi-setup --set reset.all=true

following errors show up in the container log:

pod tsi-setup-tsi-node-setup-pgnsw connected to host kube-fra02-cr034e871e697e4f2abff69102f2d792b0-w2.cloud.ibm machineid: a00917949efe4757bc4f5eb08bd6d69a
rm: cannot remove '/host/tsi-secure': Device or resource busy
full reset performed
rm: cannot remove '/host/tsi-secure/x5c': No such file or directory
x5c file reset performed
directory /host/tsi-secure/sockets created
Generating RSA private key, 2048 bit long modulus (2 primes)
............+++++
....+++++
e is 65537 (0x010001)
Can't load /root/.rnd into RNG
140476636512704:error:2406F079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:88:Filename=/root/.rnd

Review all the test cases, after recent refactor of the sidecar.

Since we move the Vault secret retrieval to the sidecar and the main containers does not get the JWT anymore, we need to update/verify all the test cases are still relavant:

e.g. expectedMutateInitialization.json "mountPath": "/usr/share/secrets"

Since it is no longer jwt, we should change the volume name to reflect that instead of jwt-shared -data

Once active the Webhook prevents the JSS daemonset from being recreated

Showing the following error:

Normal SuccessfulDelete 23m daemonset-controller Deleted pod: vtpm2-server-gbgjc Warning FailedCreate 4m27s (x21 over 22m) daemonset-controller Error creating: admission webhook "tsi-mutate.trusted-service-identity.ibm" denied the request: Using hostPath Volume with '/tsi-secure' is not allowed

gen-jwt.py flags need to be updated

The default command suggestions by gen-jwt.py doesn't work because it contains pipes that are not escaped. In addition, --expire doesnt seem to be used anymore and TTL_SEC env variable is used instead. In addition, a few other fields are ignored - like subject, iss, etc..

usage: gen-jwt.py [-h] [-iss ISS] [-aud AUD] [-sub SUB] [-claims CLAIMS]
                  [-jwks JWKS] [-expire EXPIRE]
                  key

Python script generates a JWT signed with custom private key.
issuer(iss) is passed as env. var. (ISS)
token expiration is passed as env. var (TTL_SEC)

Example:
./gen-jwt.py  --aud foo,bar --claims=email:[email protected]|images:img1,img2 key.pem

Suggestions to add quotes:

gen-jwt.py  --aud foo,bar --claims='email:[email protected]|images:img1,img2' key.pem

Bring back the optional support for vTPM

Since we moved to software signing service, we abandoned the existing vTPM solution. Let's bring it back to make it easier to integrate with hardware TPM once is available.

Update helm to use --client-only

Remove dependency on tiller and set a stricter helm version requirement. Tiller is generally not something that is desired in the cluster, so we should try to remove dependency on it.

Split JSS volumeMounts to 2 directories

in charts/ti-key-release-2/templates/jss-server.yaml

hostPort: 5000
volumeMounts:
- mountPath: /host/tsi-secure
name: tsi-secure

We should have 2 different directories, one for private key and CSR, and another one for x5c. Then we can do the first one always RO for all JSS and keep x5c R/W for JSS PUB
The public need to be R/W because it needs to inject the x5c, but the private one should be RO

K8s Jobs never complete with TSI

Kubernetes jobs require all the container to complete the job in order to get status Completed, however TSI sidecar runs continuously indefinitely. One solution is to run disable the sidecar, by only executing the init container PR #59 however, we should consider notifying the sidecar that container has ended, so it can exit as well.

From Kubernetes 1.18, if all normal containers have reached a terminal state (Succeeded for restartPolicy=OnFailure, or Succeeded/Failed for restartPolicy=Never), then all sidecar containers will be sent a SIGTERM.

Disable modification of webhook created annotations

Once created, the annotation should not be updated by external configuration updates.

annotations:
    admission.trusted.identity/inject: "true"
    admission.trusted.identity/status: injected
    admission.trusted.identity/ti-cluster-name: ti-test1
    admission.trusted.identity/ti-cluster-region: eu-de
    admission.trusted.identity/ti-images: ubuntu:18.04@sha256:250cc6f3f3ffc5cdaa9d8f4946ac79821aafb4d3afc93928f0de9336eba21aa4
    admission.trusted.identity/ti-secret-key: ti-secret-274e1101-55be-0374-ae4b-5fc47cb34368

Update cryptography to 3.2 and python to =< 3

Current cryptography library 2.3 is not supported. Upgrade to 3.2 is required. As a result, python must be updated as well, since the cryptography 3.2 cannot be run with python 2.7

/usr/lib/python2.7/site-packages/jwcrypto/jwa.py:8: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.

see PR #73 and #74

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.