<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Andrew Block on Medium]]></title>
        <description><![CDATA[Stories by Andrew Block on Medium]]></description>
        <link>https://medium.com/@sabre1041?source=rss-a2972cbca1dd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*BYK6lw7O6pYReXEDmvgXOw.jpeg</url>
            <title>Stories by Andrew Block on Medium</title>
            <link>https://medium.com/@sabre1041?source=rss-a2972cbca1dd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 07:32:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sabre1041/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Scaffolding sigstore]]></title>
            <link>https://medium.com/sigstore/scaffolding-sigstore-e893eb962f22?source=rss-a2972cbca1dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/e893eb962f22</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[transparency]]></category>
            <category><![CDATA[signings]]></category>
            <dc:creator><![CDATA[Andrew Block]]></dc:creator>
            <pubDate>Tue, 12 Jul 2022 14:44:32 GMT</pubDate>
            <atom:updated>2022-07-12T14:44:32.855Z</atom:updated>
            <content:encoded><![CDATA[<p>Co-authored by Andrew Block(Red Hat), James Strong (Chainguard) and Ville Aikas (Chainguard)</p><p>The sigstore project contains an array of tools that aims to make signing and verifying content easy. By default, many of these components integrate with public-good, a hosted set of services that support the sigstore ecosystem. Each day, these services help promote the concepts of integrity and provenance for thousands of developers and their projects.</p><p>While these hosted services help streamline many of the concepts implemented by these tools, there are circumstances where one would not want to communicate with a public instance, such as in the case of disadvantaged networking or regulatory requirements, and instead be able to run them in their own environment.</p><p>In a prior article, <a href="https://blog.chainguard.dev/sigstore-the-local-way/">sigstore, the local way</a>, it was described how each of the supporting sigstore components can be run on a single local machine. While this approach illustrated how to bring the sigstore experience locally, it did require numerous manual operations including building components from source or installing the remaining assets. Instead, to eliminate the burdens emphasized previously, the set of hosted sigstore components can be installed to a Kubernetes environment. This article will describe how the installation of sigstore can be achieved to a Kubernetes environment along with the signing and verification of content using the newly deployed assets which will certify the deployment.</p><h3>Scaffolding Components</h3><p>Deploying sigstore to a Kubernetes not only reduces the burden, but also includes the benefits that are provided by a Kubernetes based deployment, including health checking and load balancing. To assist with this deployment, a repository called scaffolding within the sigstore GitHub organization is available and offers resources to aid in the setup and configuration. While you may be familiar with hosted sigstore services including Rekor, an immutable, tamper-resistant ledger, and Fulcio, a code signing Certificate Authority that issues short lived certificates, also included are a Certificate Transparency Log which tracks the certificates generated by Fulcio and Trillian, a verifiable log that makes use of Merkle Tree data structures. The diagram below describes the relationship between the different components that are associated with the scaffolding architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uwfolnqpQgZjlEkRCN2GFw.png" /><figcaption>sigstore scaffolding architecture</figcaption></figure><p>An in depth analysis of these components and their interaction with each other can be found within the <a href="https://github.com/sigstore/scaffolding/blob/main/README.md">scaffolding repository documentation</a>.</p><h3>Deploying sigstore</h3><p>The deployment of the sigstore assets in conjunction with the tooling provided by the scaffolding repository to a Kubernetes cluster is facilitated by a set of Helm charts produced by the sigstore project and contained within the <a href="https://github.com/sigstore/helm-charts">helm-charts repository</a>. While these charts and sigstore itself can be deployed to any Kuberntes environment, for the sake of testing in a localized environment, let’s walk through a deployment to a Minikube environment. The next section will describe the tools and utilities that are required.</p><p>Required tools:</p><ul><li><a href="https://minikube.sigs.k8s.io/docs/">Minikube</a></li><li><a href="https://kubernetes.io/docs/tasks/tools/#kubectl">Kubectl</a></li><li><a href="https://helm.sh/">Helm</a></li><li><a href="https://stedolan.github.io/jq/manual/">Jq</a></li><li><a href="https://www.openssl.org/">OpenSSL</a></li></ul><h3>Performing the Deployment</h3><p>Once all of the tools have been installed, the first step is to start the minikube instance by running the following command. The--extra-config parameter is required to set the issuer of the OIDC provider which will be specified within the sigstore deployment within the Kubernetes API server.</p><pre>minikube start \<br>   --extra-config=apiserver.service-account-issuer=https://kubernetes.default.svc</pre><p>Once the cluster is deployed, the next step is to enable external access by deploying an Ingress Controller. Minikube includes an <a href="https://minikube.sigs.k8s.io/docs/handbook/addons/">addon</a> for deploying an NGINX based Ingress Controller. Execute the following command to enable the addon which will create and deploy resources in the <em>ingress-nginx</em> namespace.</p><pre>minikube addons enable ingress</pre><p>Next, create a ClusterRoleBinding so that the OIDC Well-Known Configuration Endpoint for Kubernetes can be queried by any unauthenticated user. The ClusterRole system:service-account-issuer-discovery provides the necessary policies to enable this action. Execute the following command to create the ClusterRoleBinding.</p><pre>cat &lt;&lt; EOF | kubectl apply -f -<br>apiVersion: rbac.authorization.k8s.io/v1<br>kind: ClusterRoleBinding<br>metadata:<br>  name: oidc-reviewer<br>roleRef:<br>  apiGroup: rbac.authorization.k8s.io<br>  kind: ClusterRole<br>  name: system:service-account-issuer-discovery<br>subjects:<br>  - apiGroup: rbac.authorization.k8s.io<br>    kind: Group<br>    name: system:unauthenticated<br>EOF</pre><p>Next, since there are resources exposed using an Ingress, we would want to ensure the communication is secure with TLS certificates. These could be provided from a trusted Certificate Authority or generated manually. <a href="https://cert-manager.io/docs">cert-manager</a> can be used to assist with the generation of the certificates and integrates with Ingress resources based on the declared definition.</p><p>Deploy cert-manager with Helm using the following steps:</p><p>First add the Jetstack helm repository:</p><pre>helm repo add jetstack <a href="https://charts.jetstack.io/">https://charts.jetstack.io</a></pre><pre>helm repo update</pre><p>Then install the cert-manager chart</p><pre>helm install \<br>  cert-manager jetstack/cert-manager \<br>  --namespace cert-manager \<br>  --create-namespace \<br>  --version v1.8.0 \<br>  --set installCRDs=true</pre><p>Once installed, cert-manager can be used to integrate with Certificate Authorities, such as Lets Encrypt, but for the purpose of this demonstration, we will use a <a href="https://cert-manager.io/docs/configuration/selfsigned/">SelfSigned</a> <a href="https://cert-manager.io/docs/concepts/issuer/">ClusterIssuer</a> called selfsigned-issuer which will generate self-signed certificates for our Ingress resources.</p><pre>cat &lt;&lt; EOF | kubectl apply -f -<br>apiVersion: cert-manager.io/v1<br>kind: ClusterIssuer<br>metadata:<br>  name: selfsigned-issuer<br>spec:<br>  selfSigned: {}<br>EOF</pre><p>Now that all of the prerequisites have been accounted for, the next step is to deploy sigstore. Start by adding the sigstore Helm repository:</p><pre>helm repo add sigstore https://sigstore.github.io/helm-charts</pre><pre>helm repo update</pre><p>Finally install the scaffold chart:</p><pre>helm upgrade -i scaffold sigstore/scaffold \<br>  --set rekor.server.ingress.hosts[0].host=rekor.$(minikube ip).nip.io \<br>  --set fulcio.server.ingress.http.hosts[0].host=fulcio.$(minikube ip).nip.io \<br>  --set fulcio.server.ingress.http.hosts[0].path=/ --set rekor.server.ingress.hosts[0].path=/ \<br>  --set ctlog.createctconfig.backoffLimit=30 \<br>  --set rekor.server.ingress.tls[0].hosts[0]=&quot;rekor.$(minikube ip).nip.io&quot; \<br>  --set rekor.server.ingress.tls[0].secretName=rekor-tls \<br>  --set fulcio.server.ingress.tls[0].hosts[0]=&quot;fulcio.$(minikube ip).nip.io&quot; \<br>  --set fulcio.server.ingress.tls[0].secretName=fulcio-tls \<br>  --set rekor.server.ingress.annotations.&quot;cert-manager\.io\/cluster-issuer&quot;=selfsigned-issuer \<br>  --set rekor.server.ingress.annotations.&quot;cert-manager\.io\/common-name&quot;=&quot;rekor.$(minikube ip).nip.io&quot; \<br>  --set fulcio.server.ingress.http.annotations.&quot;cert-manager\.io\/cluster-issuer&quot;=selfsigned-issuer \<br>  --set fulcio.server.ingress.http.annotations.&quot;cert-manager\.io\/common-name&quot;=&quot;fulcio.$(minikube ip).nip.io&quot; \<br>  -n sigstore \<br>  --create-namespace</pre><p>There a lot to take in as part of this command, so let’s break it down line by line:</p><ol><li>Install the scaffold chart from the sigstore repository with the release name scaffold</li><li>Set the hostname for the Rekor Ingress resource using the IP address of the minikube instance. We are leveraging the service nip.io which allows for dns names to be resolved based on IP addresses.</li><li>Set the hostname for the Fulcio Ingress resource using the IP address of the minikube instance. We are leveraging the service nip.io which allows for dns names to be resolved based on IP addresses.</li><li>Set the the context path for the Rekor ingress resource</li><li>Sets the number of attempts for the CTLog configuration job</li><li>Sets the TLS hostname for the Rekor Ingress resource</li><li>Sets the name of the secret containing the certificates for the Rekor ingress resource</li><li>Sets the TLS hostname for the Fulcio Ingress resource</li><li>Sets the name of the secret containing the certificates for the Fulcio ingress resource</li><li>Sets an annotation on the Rekor ingress resource with the name of the ClusterIssuer. By setting this value, cert-manager will use the parameters provided in the Ingress, generate a certificate, and store it in the referenced secret</li><li>Sets the annotation on the Rekor ingress resource with the common name to apply to the certificate. The value will match the TLS hostnmae specified earlier</li><li>Same as #10, but targeting the Fulcio Ingress resource</li><li>Same as #11, but targeting the Fulcio Ingress resource</li><li>Create the chart in the sigstore namespace</li><li>Create the sigstore namespace if it does not already exist</li></ol><p>Once the chart has deployed, four (4) namespaces will be created:</p><ul><li>ctlog-system</li><li>fulcio-system</li><li>rekor-system</li><li>trillian-system</li></ul><p>A series of Kubernetes jobs will be initiated to complete the initialization process. Once each of the jobs have completed successfully, sigstore is ready to use.</p><h3>Verifying the sigstore Deployment</h3><p>No automated process would be complete without performing some form of verification. Since sigstore is designed to sign and verify content, let’s walk through the process of signing and verifying an image. The easiest method to accomplish the validation is to execute a Kubernetes job to run within the cluster which will first sign an image and then perform a verification based on previously signed content.</p><p>Before the job can be created, a few supporting components need to be provided:</p><ol><li>CTLog public key</li><li>Configurations associated with Fulcio</li></ol><p>Copy the secrets from their respective namespaces into the <em>default</em> namespace by executing the following commands.</p><pre>kubectl -n ctlog-system get secrets ctlog-public-key -o yaml | sed &#39;s/namespace: .*/namespace: default/&#39; | kubectl apply -f -</pre><pre>kubectl -n fulcio-system get secrets fulcio-server-secret -oyaml | sed -e &#39;s/namespace: .*/namespace: default/&#39; -e &#39;s/name: .*/name: fulcio-secret/&#39; | kubectl apply -f -</pre><p>Finally, while we could look to push signatures to a public registry, for demonstration purposes, we will deploy a lightweight container registry to serve as the designation for our signed content.</p><p>Execute the following commands to create a new Certificate for which cert-manager will provision along with a Service and Deployment resource associated with the registry:</p><pre>cat &lt;&lt; EOF | kubectl apply -f -<br>apiVersion: cert-manager.io/v1<br>kind: Certificate<br>metadata:<br>  name: registry-tls<br>  namespace: default<br>spec:<br>  commonName: registry.default.svc<br>  dnsNames:<br>    - registry.default.svc<br>  usages:<br>    - digital signature<br>    - key encipherment<br>    - server auth<br>  secretName: registry-tls<br>  issuerRef:<br>    group: cert-manager.io<br>    name: selfsigned-issuer<br>    kind: ClusterIssuer<br>EOF<br>cat &lt;&lt; EOF | kubectl apply -f -<br>kind: Service<br>apiVersion: v1<br>metadata:<br>  name: registry<br>  namespace: default<br>spec:<br>  ports:<br>    - name: registry<br>      protocol: TCP<br>      port: 5000<br>      targetPort: registry<br>  type: ClusterIP<br>  selector:<br>    app: registry<br>EOF<br>cat &lt;&lt; EOF | kubectl apply -f -<br>kind: Deployment<br>apiVersion: apps/v1<br>metadata:<br>  name: registry<br>  namespace: default<br>  labels:<br>    app: registry<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      app: registry<br>  template:<br>    metadata:<br>      labels:<br>        app: registry<br>      spec:<br>        volumes:<br>          - name: data<br>            emptyDir: {}<br>          - name: certs<br>            secret:<br>              secretName: registry-tls<br>        containers:<br>          - resources: {}<br>            env:<br>              - name: REGISTRY_HTTP_TLS_CERTIFICATE<br>                value: /certs/tls.crt<br>              - name: REGISTRY_HTTP_TLS_KEY<br>                value: /certs/tls.key<br>            readinessProbe:<br>              httpGet:<br>                path: /v2/<br>                port: registry<br>                scheme: HTTPS<br>              timeoutSeconds: 1<br>              periodSeconds: 10<br>              successThreshold: 1<br>              failureThreshold: 3<br>            name: registry<br>            livenessProbe:<br>              httpGet:<br>                path: /v2/<br>                port: registry<br>                scheme: HTTPS<br>              timeoutSeconds: 1<br>              periodSeconds: 10<br>              successThreshold: 1<br>              failureThreshold: 3<br>            ports:<br>              - name: registry<br>                containerPort: 5000<br>                protocol: TCP<br>            imagePullPolicy: Always<br>            volumeMounts:<br>              - name: data<br>                mountPath: /var/lib/registry<br>              - name: certs<br>                mountPath: /certs<br>            image: &#39;docker.io/registry:2&#39;<br>  strategy:<br>    type: RollingUpdate<br>    rollingUpdate:<br>      maxUnavailable: 25%<br>      maxSurge: 25%<br>  revisionHistoryLimit: 10<br>  progressDeadlineSeconds: 600<br>EOF</pre><p>With the necessary configurations in place, let’s create a Job that will take an already available container image and sign it using certificates generated dynamically in Fulcio. The signature that is produced will be stored in the registry we deployed previously due to the presence of the COSIGN_REPOSITORY environment variable on the job. In addition, a record will also be stored in the Rekor transparency server. All of these actions are performed using the <a href="https://github.com/sigstore/cosign">cosign utility</a>.</p><pre>cat &lt;&lt; EOF | kubectl apply -f -<br>apiVersion: batch/v1<br>kind: Job<br>metadata:<br>  name: sign-job<br>spec:<br>  template:<br>    spec:<br>      restartPolicy: Never<br>      automountServiceAccountToken: false<br>      containers:<br>        - name: cosign<br>          # Built from ci on 2022-03-15<br>          image: gcr.io/projectsigstore/cosign:v1.8.0<br>          args: [&quot;sign&quot;, &quot;--fulcio-url&quot;, &quot;http://fulcio-server.fulcio-system.svc&quot;, &quot;--allow-insecure-registry&quot;, &quot;--rekor-url&quot;, &quot;http://rekor-server.rekor-system.svc&quot;, &quot;--force&quot;, &quot;ghcr.io/sigstore/scaffolding/checktree@sha256:9ca3cf4d20eb4f6c85929cd873234150d746e69dbb7850914bbd85b97eba1e2f&quot;]<br>          env:<br>            - name: COSIGN_EXPERIMENTAL<br>              value: &quot;true&quot;<br>            - name: SIGSTORE_CT_LOG_PUBLIC_KEY_FILE<br>              value: &quot;/var/run/sigstore-root/rootfile.pem&quot;<br>            - name: COSIGN_REPOSITORY<br>              value: &quot;registry.default.svc:5000/sigstore&quot;<br>          volumeMounts:<br>            - name: oidc-info<br>              mountPath: /var/run/sigstore/cosign<br>            - name: keys<br>              mountPath: &quot;/var/run/sigstore-root&quot;<br>              readOnly: true<br>      volumes:<br>        - name: oidc-info<br>          projected:<br>            sources:<br>              - serviceAccountToken:<br>                  path: oidc-token<br>                  expirationSeconds: 600<br>                  audience: sigstore<br>              - name: keys<br>                secret:<br>                  secretName: ctlog-public-key<br>                 items:<br>                   - key: public<br>                     path: rootfile.pem<br>EOF</pre><p>Once the job has started, track the logs of the running container to confirm the image signing action was successful:</p><pre>kubectl logs jobs/sign-job</pre><pre>Generating ephemeral keys...<br>Retrieving signed certificate...<br>**Warning** Using a non-standard public key for verifying SCT: /var/run/sigstore-root/rootfile.pem<br>Successfully verified SCT...<br>tlog entry created with index: 0</pre><p>As illustrated in the log entry output from the job, cosign was able to request a certificate from Fulcio, sign the image, and store the entry in Rekor.</p><p>Now that we have proven that the sigstore infrastructure can be used to sign an image, let’s assume the role of a consumer and verify the contents. cosign not only can be used to sign an image, but it also contains the capabilities to verify signed content. Execute the following command to create a Job to verify the previously signed image:</p><pre>cat &lt;&lt; EOF | kubectl apply -f -<br>apiVersion: batch/v1<br>kind: Job<br>metadata:<br>  name: verify-job<br>spec:<br>  template:<br>    spec:<br>      restartPolicy: Never<br>      automountServiceAccountToken: false<br>      containers:<br>        - name: cosign<br>          # Built from ci on 2022-03-15<br>          image: gcr.io/projectsigstore/cosign/ci/cosign@sha256:8f7f1a0e7cef67c352f00acd14791d977faa8d1cd47a69f9c880a5185c44ffbb<br>          args: [&quot;verify&quot;, &quot;--allow-insecure-registry&quot;, &quot;--rekor-url&quot;, &quot;http://rekor-server.rekor-system.svc&quot;, &quot;ghcr.io/sigstore/scaffolding/checktree@sha256:9ca3cf4d20eb4f6c85929cd873234150d746e69dbb7850914bbd85b97eba1e2f&quot;]<br>          env:<br>            - name: COSIGN_EXPERIMENTAL<br>              value: &quot;true&quot;<br>            - name: SIGSTORE_TRUST_REKOR_API_PUBLIC_KEY<br>              value: &quot;true&quot;<br>            - name: SIGSTORE_ROOT_FILE<br>              value: &quot;/var/run/sigstore-fulcio/fulcio-public.pem&quot;<br>            - name: COSIGN_REPOSITORY<br>              value: &quot;registry.default.svc:5000/sigstore&quot;<br>          volumeMounts:<br>            - name: oidc-info<br>              mountPath: /var/run/sigstore/cosign<br>            - name: keys<br>              mountPath: &quot;/var/run/sigstore-fulcio&quot;<br>              readOnly: true<br>      volumes:<br>        - name: oidc-info<br>          projected:<br>            sources:<br>              - serviceAccountToken:<br>                  path: oidc-token<br>                  expirationSeconds: 600<br>                  audience: sigstore<br>        - name: keys<br>          secret:<br>            secretName: fulcio-secret<br>            items:<br>              - key: cert<br>                path: fulcio-public.pem<br>EOF</pre><p>Confirm that the job completed successfully by verifying the output of the pod log:</p><pre>kubectl logs verify-job-mkrlc</pre><pre>Verification for ghcr.io/sigstore/scaffolding/checktree@sha256:9ca3cf4d20eb4f6c85929cd873234150d746e69dbb7850914bbd85b97eba1e2f --<br>The following checks were performed on each of these signatures:<br>  - The cosign claims were validated<br>  - The claims were present in the transparency log<br>  - The signatures were integrated into the transparency log when the certificate was valid<br>  - Any certificates were verified against the Fulcio roots.<br>...</pre><p>As another form of validation, we can also retrieve the record that was stored in Rekor. From the final line in the output from the signing job, observe that the record was stored at index 0 within the transaction log. We can obtain this record by querying the Rekor using the Ingress resource.</p><pre>curl —-cacert &lt;(kubectl get secrets -n rekor-system rekor-tls -o jsonpath=&#39;{ .data.tls\.crt }&#39; | base64 -d) https://rekor.$(minikube ip).nip.io/api/v1/log/entries?logIndex=0 | jq -r</pre><p>The output will contain the entire stored record. Within the record includes details related to the signature that was placed upon the image including the public key that was generated by our Fulcio instance. Perform another query to inspect the public key:</p><pre>curl —-cacert &lt;(kubectl get secrets -n rekor-system rekor-tls -o jsonpath=&#39;{ .data.tls\.crt }&#39; | base64 -d) https://rekor.$(minikube ip).nip.io/api/v1/log/entries?logIndex=0 | jq -r &#39;.[keys_unsorted[0]].body&#39; | base64 -d | jq -r &#39;.spec.signature.publicKey.content&#39; | base64 -d | openssl x509 -noout -text</pre><p>Within the returned value, we can observe attributes within the certificate associated with the identity token from the OIDC exchange that Fulcio performed.</p><pre>X509v3 Subject Alternative Name: critical<br> URI:https://kubernetes.io/namespaces/default/serviceaccounts/default<br>1.3.6.1.4.1.57264.1.1:<br>    <a href="https://kubernetes.default.svc/">https://kubernetes.default.svc</a><br>1.3.6.1.4.1.11129.2.4.2:</pre><p>At this point, we have successfully deployed sigstore to a minikube instance, performed the signing of an image using the certificate provided from Fulcio and confirmed the values from the Rekor transparency server. Deploying sigstore to your environment has never been easier! In the next post, we will extend this implementation by illustrating how an end user or system can use the sigstore deployment to sign and verify content.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e893eb962f22" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sigstore/scaffolding-sigstore-e893eb962f22">Scaffolding sigstore</a> was originally published in <a href="https://medium.com/sigstore">sigstore</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing Disconnected Signatures Using cosign]]></title>
            <link>https://medium.com/@sabre1041/managing-disconnected-signatures-using-cosign-27f157e82f88?source=rss-a2972cbca1dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/27f157e82f88</guid>
            <category><![CDATA[disconnected]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[sigstore]]></category>
            <category><![CDATA[digital-signatures]]></category>
            <category><![CDATA[cosign]]></category>
            <dc:creator><![CDATA[Andrew Block]]></dc:creator>
            <pubDate>Thu, 03 Feb 2022 14:25:48 GMT</pubDate>
            <atom:updated>2022-02-03T14:25:48.967Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*-GxE07FqCrNxi67ki8B1dA.png" /></figure><p>Cosign is a tool within the <a href="https://www.sigstore.dev/">sigstore project</a> that greatly simplifies how content is signed and verified by storing signatures from container images and other types in OCI registries. By storing signatures with a predictable name as a related OCI artifact within a registry, the content can be leveraged by both consumers and producers of the signed material. However, there are situations where there may be not only a desire, but a requirement to forgo the storage of signatures in this default fashion. Fortunately, these scenarios for storing content produced with cosign can be adopted without compromising the integrity of the signing and verification process.</p><p>Signatures produced by cosign by default are stored within the same OCI registry as another tag with a predictive name. For example, a signed image located at docker.io/myuser/myimage:latest will have its signature stored at docker.io/myuser/myimage:sha256-&lt;DIGEST&gt;.sig. Let’s first verify this assertion by signing a container image. To simplify the commands used throughout, set two environment variables within the terminal containing the name of the image and tag.</p><pre>export COSIGN_BLOG_IMAGE=docker.io/myuser/myimage</pre><pre>export COSIGN_BLOG_TAG=latest</pre><p>To sign content using cosign, a public/private keypair must be generated. Execute the following command to generate a keypair in the current directory. Provide a password for the private key when prompted:</p><pre>cosign generate-key-pair</pre><p>The result will generate files named cosign.key and cosign.pub in the directory.</p><p>Now, sign the image:</p><pre>cosign sign --key=cosign.key $COSIGN_BLOG_IMAGE:$COSIGN_BLOG_TAG</pre><p>With the signature published, we can verify the signature using the cosign verify command by providing the location of the public key used to sign the image as well as the image:</p><pre>cosign verify --key=cosign.pub $COSIGN_BLOG_IMAGE:$COSIGN_BLOG_TAG</pre><p>Displayed is the verification results which will indicate that a valid signature was located on the image:</p><pre>Verification for $COSIGN_BLOG_IMAGE:$COSIGN_BLOG_TAG --</pre><pre>The following checks were performed on each of these signatures:</pre><pre>- The cosign claims were validated</pre><pre>- The signatures were verified against the specified public key</pre><pre>- Any certificates were verified against the Fulcio roots.<br></pre><pre>[{&quot;critical&quot;:{&quot;identity&quot;:{&quot;docker-reference&quot;:&quot;$COSIGN_BLOG_IMAGE&quot;},&quot;image&quot;:{&quot;docker-manifest-digest&quot;:&quot;sha256:&lt;DIGEST&gt;&quot;},&quot;type&quot;:&quot;cosign container image signature&quot;},&quot;optional&quot;:null}]</pre><p>With an understanding of the basic steps to sign and verify an image, let’s investigate how cosign performs the verification task in further detail as it will be helpful in supporting alternate workflows.</p><p>During the signing process, content is pushed to a separate tag as described previously. Key details including, but not limited to the generated signature are stored as a layer within the image manifest. We can confirm this by viewing this manifest of the artifact.</p><p>First, we need to determine the location of the image containing the signature produced by the execution of cosign sign. This can be obtained by using the cosign triangulate command as shown below:</p><pre>cosign triangulate $COSIGN_BLOG_IMAGE:$COSIGN_BLOG_TAG</pre><p>A result similar to the following will be displayed.</p><pre>$COSIGN_BLOG_IMAGE:sha256-&lt;DIGEST&gt;.sig</pre><p>There are several tools that can be used to interact with remote registries including <a href="https://github.com/google/go-containerregistry/tree/main/cmd/crane">crane</a> and <a href="https://github.com/containers/skopeo">skopeo</a>. In this instance, skoepo will be used, but feel free to use any tool of your choosing.</p><p>View the manifest of the image containing the signature:</p><pre>skopeo inspect --raw docker://$(cosign triangulate $COSIGN_BLOG_IMAGE:$COSIGN_BLOG_TAG) | jq -r</pre><p>The <a href="https://stedolan.github.io/jq/">jq</a> utility was used here to provide a more suitable output format which is shown below.</p><pre>{</pre><pre>  &quot;schemaVersion&quot;: 2,</pre><pre>  &quot;mediaType&quot;: &quot;application/vnd.oci.image.manifest.v1+json&quot;,</pre><pre>  &quot;config&quot;: {</pre><pre>    &quot;mediaType&quot;: &quot;application/vnd.oci.image.config.v1+json&quot;,</pre><pre>    &quot;size&quot;: 233,</pre><pre>    &quot;digest&quot;: &quot;sha256:5dd9225e5c9acc08ead9ff1e7d4073c444c50f8e11ca82a545e3bac8fa011677&quot;</pre><pre>  },</pre><pre>  &quot;layers&quot;: [</pre><pre>    {</pre><pre>      &quot;mediaType&quot;: &quot;application/vnd.dev.cosign.simplesigning.v1+json&quot;,</pre><pre>      &quot;size&quot;: 261,</pre><pre>      &quot;digest&quot;: &quot;sha256:37627a11fd49489be88b327536908d5bd268677cfb88ee3470c202c96847d36a&quot;,</pre><pre>      &quot;annotations&quot;: {</pre><pre>        &quot;dev.cosignproject.cosign/signature&quot;: &quot;MEUCICpLOoOnauDb2IOOpR45EnIY43+jX51Ha6yadUwZDh/sAiEA0hLMN9y2W+qe23QcsfIr+ch23Yup1yQ1STSibZh/u18=&quot;</pre><pre>      }</pre><pre>    }</pre><pre>  ]</pre><pre>}</pre><p>As illustrated by the output above, cosign appends content to each layer of the image which allows for multiple signatures to be attached. Since this image was only signed once, only one layer is present. The signature is present within an annotation called dev.cosignproject.cosign/signature. This field can be extracted by using a combination of skopeo, cosign and jq as shown below.</p><pre>skopeo inspect  --raw docker://$(cosign triangulate $COSIGN_BLOG_IMAGE:$COSIGN_BLOG_TAG) | jq -r &#39;.layers[0].annotations[&quot;dev.cosignproject.cosign/signature&quot;]&#39;</pre><p>When verifying content, cosign by, default, communicates with the remote registry to obtain the resources needed to perform the verification process. Since we have a method of retrieving the signature, we can instruct cosign to refrain from involving the remote signature store and to instead provide it from a local source. Let’s demonstrate how this can be accomplished.</p><p>First, save the signature to a file called <em>image.sig</em> using the preceding command redirecting the output to a file:</p><pre>skopeo inspect  --raw docker://$(cosign triangulate $COSIGN_BLOG_IMAGE:$COSIGN_BLOG_TAG) | jq -r &#39;.layers[0].annotations[&quot;dev.cosignproject.cosign/signature&quot;]&#39; &gt; image.sig</pre><p>Next, we can perform the same verification process against the image as performed previously except the location of the file containing the signature is provided as an argument instead of obtaining the signature from the remote image.</p><pre>cosign verify --signature=image.sig --key=cosign.pub $COSIGN_BLOG_IMAGE:$COSIGN_BLOG_TAG</pre><h3>Disconnected Signatures</h3><p>The ability to accomplish the same steps to verify the integrity of an image using cosign without referring to a remote signature source affords additional options when determining how image signatures will be managed. There are several situations for which the default functionality of cosign of storing signing assets within an associated tag within the same repository cannot be facilitated. Examples include avoiding having container image content and signature content stored within the same repository or the fact that some container registries still do not support the use of OCI artifacts resulting in failures when attempting to store signatures.</p><p>Regardless of the cause, cosign provides several alternative approaches to accomplish the same goal by enabling signatures from being detached from the source repository.</p><p>The first option is to store signatures in a separate container registry from the image being signed to avoid having mixed content within the same repository. Storing images in a separate repository is accomplished through the use of the COSIGN_REPOSITORY environment variable. So for example, if the container image that was being signed was located at in the docker.io/myuser/myimage container and there as a desire to store signatures in the docker.io/myuser/myimage_signatures repository, the following command could be used which specifies the location of the signature repository using the COSIGN_REPOSITORY environment variable:</p><pre>COSIGN_REPOSITORY=docker.io/myuser/myimage_signatures cosign sign --key=cosign.key docker.io/myuser/myimage:latest</pre><p>You should be able to confirm that the signatures were pushed to the alternate repository instead of residing alongside the repository of the image being signed.</p><p>However, cosign also contains support for avoiding uploading signature content to a remote repository altogether. This is ideal for situations where there is either a desire or a need to restrict publishing of content related to image signatures. Instead, signatures and their associated certificates (if applicable) can be stored locally and can then be used when verifying. Let’s see this in action.</p><p>To avoid uploading signatures, use the --upload=false flag when signing an image using. Additional flags are available to store both the signature and the certificate produced locally as files and can be used by specifying the --output-signature and --output-certificate parameters when signing content.</p><p>Execute the following command to store the signature produced by signing the image to a file called disconnected.sig and the certificate to a file called disconnected.crt.</p><pre>cosign sign --upload=false --output-signature=disconnected.sig --output-certificate=disconnected.crt --key=cosign.key $COSIGN_BLOG_IMAGE:$COSIGN_BLOG_TAG</pre><p>Confirm that both the signature and certificate files were stored locally. The certificate in this case is the public key associated with the key that was used to sign the image. Now, verify the image by referencing these files as shown below:</p><pre>cosign verify --signature=disconnected.sig --key=disconnected.crt $COSIGN_BLOG_IMAGE:$COSIGN_BLOG_TAG</pre><p>Signing and verifying an image without remote storage in an OCI registry!</p><h3>Disconnected Keyless Signatures</h3><p>Instead of generating a public/private key pair and providing the private key when signing an image, a signing certificate can be requested from <a href="https://github.com/sigstore/fulcio">fulcio</a>, a hosted service that provides short lived certificates. These ephemeral keys greatly simplifies and increases the security posture when signing content by avoiding having to manage long lived signing keys. Full support for fulcio integration is not yet available, so the COSIGN_EXPERIMENTAL environment variable must be set.</p><p>Execute the following command to request a singing key from fulcio, but continue to refrain from uploading the signature to a remote OCI registry.</p><pre>COSIGN_EXPERIMENTAL=1 cosign sign --upload=false --output-signature=disconnected-fulcio.sig --output-certificate=disconnected-fulcio.crt $COSIGN_BLOG_IMAGE:$COSIGN_BLOG_TAG</pre><p>A browser window will be launched to allow you to authenticate against an identity provider of your choosing. Alternate flows are available via OIDC to remove the manual authentication step. Once this process is complete, a signing certificate will be retrieved, the container image signed, and the resulting signature and certificate stored as disconnected-fulcio.sig and disconnected-fulcio.crt respectively.</p><p>You can review the content of the generated certificate by executing the following command:</p><pre>openssl x509 -in disconnected-fulcio.crt -noout -text</pre><p>When reviewing the certificate, take note of the <em>X509v3 Subject Alternative Name</em> field which contains details related to the authenticated user.</p><p>Finally, lets’ go ahead and verify the image based on the fulcio based signature and certificate.</p><pre>cosign verify --signature=disconnected-fulcio.sig --cert=disconnected-fulcio.crt $COSIGN_BLOG_IMAGE:$COSIGN_BLOG_TAG</pre><p>Once again, we get the reassurance that our image has been signed, but this time thanks to the integration with fulcio, there is no longer a need to manage signing keys; all without having to upload content to a remote registry.</p><p>Cosign provides the capabilities to quickly and easily sign and verify content. By being able to store and verify signatures and their associated assets locally, new workflows can be unlocked to make use of proper security practices regardless of the operating environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27f157e82f88" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Provenance comes to the sigstore Project Helm Charts]]></title>
            <link>https://medium.com/@sabre1041/provenance-comes-to-the-sigstore-project-helm-charts-68846dfa1eb7?source=rss-a2972cbca1dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/68846dfa1eb7</guid>
            <dc:creator><![CDATA[Andrew Block]]></dc:creator>
            <pubDate>Mon, 10 Jan 2022 13:59:52 GMT</pubDate>
            <atom:updated>2022-01-10T13:59:52.082Z</atom:updated>
            <content:encoded><![CDATA[<p>Making signing and verifying software easy is one of the core missions of the <a href="https://sigstore.dev/">sigstore project</a>. Tools like <a href="https://github.com/sigstore/cosign">cosign</a>, <a href="https://github.com/sigstore/rekor">rekor</a> and <a href="https://github.com/sigstore/fulcio">fulcio</a> make what was once a cumbersome process for releasing software almost an afterthought.</p><p>To support bringing these tools closer to end users and enable deployments in their own Kubernetes clusters, a set of <a href="https://helm.sh/">Helm Charts</a> are available to streamline the overall lifecycle of these tools. Recently, an enhancement was introduced to the <a href="https://github.com/sigstore/helm-charts">sigstore Helm Charts</a> to incorporate Helm’s own provenance capabilities; a natural step for a project itself that emphasizes security and verification at each phase of the software delivery process.</p><p>The remainder of this discussion describes how sigstore’s own Helm chart’s achieve provenance and the steps that can be taken to verify the authenticity prior to use.</p><h3>Helm Provenance</h3><p>The Helm project has long since supported the signing and verifying charts through its own set of <a href="https://helm.sh/docs/topics/provenance">provenance and integrity capabilities</a>. While the use of certificate based signatures as emphasized by the sigstore project are not yet supported, Helm does make use of the <a href="https://gnupg.org/">GnuPG</a> suite of tools.</p><p>At chart packaging time, a <em>provenance </em>record (a file with a .prov suffix)<em> </em>is created alongside the packaged chart containing the contents of the <em>Chart.yaml</em> file, a hash of the packaged chart, and the signature of the signed provenance file. The combination of the packaged chart, the provenance file, and the public key associated with the private key used during the signing process enables consumers the ability to verify Helm charts.</p><p>For now, PGP based signatures are the only supported method for signing charts. However, there have been discussions within the Helm community on the inclusion of other tools, such as those from the sigstore project, to sign and verify Helm content.</p><h3>Importing the Public GPG Key</h3><p>In order to verify any Helm chart, whether it be from the sigstore project or from any distributor, the GPG public key associated with the private key that was used at the time of packaging and signing must be configured on the local machine.</p><p>The sigstore project maintains the public key within the <a href="https://github.com/sigstore/helm-charts">helm-charts GitHub repository</a> and the following command can be used to retrieve the public key from the repository and import it to the keyring:</p><pre>curl -L <a href="https://raw.githubusercontent.com/sigstore/helm-charts/main/security/pubkey.gpg">https://raw.githubusercontent.com/sigstore/helm-charts/main/security/pubkey.gpg</a> | gpg --import --batch</pre><p>With the public key imported into the keyring, the final step that may require configuring depending on whether GnuPG v2 is installed is to convert the keyring to a v1 format. If v2 is installed, use the following commands can be used to export the public and private keys into a format that Helm accepts.</p><pre>$ gpg --export &gt;~/.gnupg/pubring.gpg<br>$ gpg --export-secret-keys &gt;~/.gnupg/secring.gpg</pre><h3>Verifying Signed sigstore Helm Charts</h3><p>Now that every chart produced by the sigstore project is signed and includes multiple points of distribution, consumers can take advantage of the flexibility, but more importantly, enables them to assure the legitimacy of the content using multiple forms of verification. Let’s walk through the methods for which a chart can be verified given that all of the prerequisites have been completed.</p><p>First, to verify the content of a chart, it first must be obtained from its hosting location: by default, this would be a <a href="https://helm.sh/docs/topics/chart_repository/">Helm chart repository</a>. A chart repository is a standard web server that hosts Helm charts along with a metadata file describing all of the charts contained within the repository.</p><p>The helm Command Line Interface can be used to perform most of the steps that will be addressed within this article. If you do not have the CLI installed, follow the steps within the <a href="https://helm.sh/docs/intro/install">Helm documentation</a>.</p><p>Once the helmCLI is installed, add the sigstore Helm repository and update the local metadata.</p><pre>helm repo add sigstore https://sigstore.github.io/helm-charts<br>helm repo update</pre><p>With the chart repository added, search for all charts in the sigstore repository:</p><pre>helm search repo sigstore/</pre><p>A result similar to the following will be returned</p><pre>NAME                    CHART VERSION   APP VERSION     DESCRIPTION                                       <br>sigstore/cosigned       v0.1.9          v1.4.1          The Helm chart for Cosigned                       <br>sigstore/rekor          0.2.9           0.3.0           Part of the sigstore project, Rekor is a timest...</pre><p>While multiple charts are available in the repository, retrieve the <em>rekor</em> chart which enables a deployment the localized deployment of the rekor Transparency server using the helm pull command to download the contents to your machine:</p><pre>helm pull sigstore/rekor</pre><p>List the files in the current working directory to confirm the packaged chart was downloaded successfully.</p><pre>$ ls</pre><pre>rekor-0.2.9.tgz</pre><p>The good news is that Helm downloaded the chart successfully. The bad news, given that the goal of this effort is to verify the chart, is that the provenance file was not downloaded.</p><p>By default, the provenance files is not downloaded even though it is available in the chart repository unless explicitly specified. Use the --prov flag of the helm pull command to instruct Helm to also download the provenance file as shown below:</p><pre>helm pull --prov sigstore/rekor</pre><p>List the files in the current directory to confirm both the packaged chart and the provenance file are present which should resemble an output similar to the following:</p><pre>rekor-0.2.9.tgz      rekor-0.2.9.tgz.prov</pre><p>With the packaged chart as well as the provenance file available locally, use the helm verify command to assert the authenticity of the downloaded rekor Helm chart.</p><pre>helm verify rekor-0.2.9.tgz</pre><p>The chart was successfully verified is a response similar to the following is displayed:</p><pre>Signed by: Sigstore Helm Release key &lt;<a href="/service/mailto:sigstore-dev@googlegroups.com">sigstore-dev@googlegroups.com</a>&gt;<br>Using Key With Fingerprint: 84374A9AC522B09A22159DEFDF12B9D33D094FFD<br>Chart Hash Verified: sha256:06248bba5b7180229b1f8459d5a9933476a8c8dbb7f5c93d69faf64027bbdf4a</pre><h3>Verifying OCI Based Helm Charts</h3><p>Helm includes supports for packaging and <a href="https://helm.sh/docs/topics/registries">storing charts within OCI registries</a> and this architecture aligns well with the sigstore project as the cosign tool uses the same approach to store signatures as artifacts within registries.</p><p><em>Note: As of the time of this writing, the OCI capabilities within Helm is marked as experimental. Full support is expected in an upcoming release.</em></p><p>While Helm has included support for managing charts as OCI artifacts for several versions, a number of breaking changes occurred as part of the 3.7.0 release. The steps for verifying OCI based Helm charts below assume a helm CLI version of 3.7.0 or greater.</p><p>Prior to moving forward, if you have retrieved the rekor chart from the Helm repository earlier in this discussion, remove the packaged chart and the provenance file:</p><pre>rm rekor-*.tgz*</pre><p>As OCI support in Helm is still experimental, the <em>HELM_EXPERIMENTAL_OCI</em> environment variable must be set as follows:</p><pre>export HELM_EXPERIMENTAL_OCI=1</pre><p>When pulling OCI based Helm charts, the specific version of the chart is required to be specified as a parameter in the helm pull command using the --version flag as there is no current support for determining the versions that are available within the registry. Since the chart versions align between both OCI registries and Chart repositories, the version number can be determined by searching the chart repository.</p><p>While we do know the most recent version of the rekor chart based on the work from the prior section, thehelm repo search command can be used to confirm the version as depicted in the following command:</p><pre>helm search repo sigstore/rekor</pre><p>Retrieve the most recent version of the rekor chart and the associated provenance from the OCI registry; in this case version 0.2.9:</p><pre>helm pull --prov oci://ghcr.io/sigstore/helm-charts/rekor --version=0.2.9</pre><p>With both the packaged chart and the provenance file downloaded once again, but this time from the OCI registry, use the helm verify command to confirm the authenticity of the chart:</p><pre>helm verify rekor-0.2.9.tgz</pre><h3>Transparency Log Verification</h3><p>While we have used the rekor chart to demonstrate how Helm charts from the sigstore project can be verified based on the signature applied at release time, rekor itself can be used as another form of verification.</p><p>Rekor is an immutable transparency log that software maintainers can publish metadata related to their artifacts for which consumers can use to make informed decisions based on the lifecycle of the resource.,</p><p>In addition to publishing signed content to a Helm Chart repository and an OCI registry, the release process for sigstore charts also publishes content to the <a href="https://rekor.sigstore.dev/">public instance of Rekor</a>.</p><p>The integration with Rekor to upload and verify signed Helm charts is facilitated through the use of the <a href="https://github.com/sigstore/helm-sigstore">Helm sigstore plugin</a>. A detailed overview of the plugin can be found in <a href="https://medium.com/@sabre1041/integrating-helm-into-the-sigstore-project-d51564ea001f">this article</a>.</p><p>To be able to verify charts stored in Rekor, install the Helm sigstore plugin on your local machine:</p><pre>helm plugin install <a href="https://github.com/sigstore/helm-sigstore">https://github.com/sigstore/helm-sigstor</a>e</pre><p>With the plugin now installed, verify the previously downloaded and signed rekor chart. The plugin uses many of the same tools as the built in verification process within Helm itself, so no additional actions are required.</p><pre>helm sigstore verify rekor-0.2.9.tgz</pre><p>A successful verification of the chart will display both the index and UUID of the entry in the rekor server as shown below:</p><pre>Chart Verified Successfully From Helm entry:</pre><pre>Rekor Server: <a href="https://rekor.sigstore.dev/">https://rekor.sigstore.dev</a><br>Rekor Index: 971013<br>Rekor UUID: 03835f8f6cf9619752d5853db0b538e0226f745c8e0aaf2f19ba8f23b4612efa</pre><p>If there is an interest, additional details regarding the content stored in rekor can be queried using the <a href="https://docs.sigstore.dev/rekor/cli/">Rekor CLI</a> and the UUID displayed as an output from thehelm sigstore verifycommand:</p><p>As illustrated through the steps provided within this article, the combination of the provenance capabilities found natively within Helm as well as the use of the rekor transparency log provides chart consumers several different layers of verification to confidently install Helm charts produced by the sigstore project into their environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68846dfa1eb7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating Helm into the sigstore Project]]></title>
            <link>https://medium.com/@sabre1041/integrating-helm-into-the-sigstore-project-d51564ea001f?source=rss-a2972cbca1dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/d51564ea001f</guid>
            <dc:creator><![CDATA[Andrew Block]]></dc:creator>
            <pubDate>Wed, 08 Sep 2021 13:02:14 GMT</pubDate>
            <atom:updated>2021-09-08T13:04:14.354Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i2OxRfoPXp8b6xwx7-E8Ig.png" /></figure><p><a href="https://helm.sh/">Helm</a> has simplified how applications are deployed and managed in <a href="https://kubernetes.io/">Kubernetes</a>. As the de facto package manager for Kubernetes, Helm enables the orchestration of complex deployments by running only a few commands. But, given that Helm is yet another component of the software supply chain when deploying applications to Kubernetes, it is imperative that steps be taken to assess the resources being deployed and ensure they have not been tampered with. In this post, we will introduce a set of tools from the sigstore project — and when combined with existing features of the Helm project — improve the security posture of Helm charts which can then be integrated into any software security toolchain.</p><h4>Helm Provenance</h4><p>Asserting the integrity of a piece of software is one of the most common tasks when securing the software supply chain. This process typically involves the verification of a digital signature that has been placed on the software asset itself or alongside. Helm has long since provided support for signing and verifying Helm charts through its set of <a href="https://helm.sh/docs/topics/provenance/">provenance tools</a>. At the time of chart packaging, a separate provenance file is created alongside the package containing several pieces of information — including a PGP based digital signature that can be used to assess the validity of the chart.</p><p>All that is needed to sign a Helm chart is a valid PGP keypair, and of course, the Helm CLI. On the consumption side, similar to verifying any other type of software that has been signed, only the public key associated with the private key is needed.</p><p>But, if signing and verifying can be accomplished by creating a PGP keypair and running a few commands, can it not be integrated into an existing software supply chain?</p><p>It can, but we can do better.</p><p>One of the inherent challenges when operating in a public/private key infrastructure is that the consumer places a level of trust on the validity of the public key. Several high profile security incidents, including the <a href="https://en.wikipedia.org/wiki/2020_United_States_federal_government_data_breach">SolarWinds security breach</a> (known as Sunburst), were partially attributed to a misconfigured PKI infrastructure. In the case of SolarWinds breach, the attackers gained access to the code servers and distributed software that had been signed with a compromised PKI. Since the consumers trusted software signed with these keys, they willingly installed the malicious software, unbeknownst to them.</p><p>So, what can we do to reduce this type of situation from occurring with our Helm charts? This is where the sigstore project can help.</p><h4>What is sigstore and how can it help?</h4><p><a href="http://sigstore/">Sigstore</a> is a <a href="https://linuxfoundation.org/">Linux Foundation</a> project which contains tooling that is focused on making it safer to package and distribute open source software and can be used by anyone participating in the software development and release process. Included in the sigstore ecosystem is <a href="https://github.com/sigstore/rekor">Rekor</a>, a transparency log and timestamping service that enables software publishers a location to publish signed metadata produced by software maintainers. This immutable tamper resistant ledger provides a mechanism that allows consumers to make informed choices in the software they are about to use.</p><p>A publicly hosted Rekor instance is available for anyone to use at <a href="https://rekor.sigstore.dev/">https://rekor.sigstore.dev</a>. In addition, you can also deploy a self managed instance of your own instance in your environment (A Helm chart is available and the steps on how it can be deployed to a Kubernetes cluster is described <a href="https://medium.com/@sabre1041/setting-up-your-own-rekor-transparency-log-server-using-helm-fc7bbeafb59c">here</a>).</p><h4>Integrating Helm with sigstore</h4><p>Entries within the Rekor transparency log consist of one of the available types. One of the benefits of Rekor is that it employs a pluggable model for types which allows anyone to define their own extension points and extend the existing set of types. <a href="https://github.com/sigstore/rekor/blob/main/pkg/types/rekord/rekord_schema.json">Rekord</a> is the default type, but there is a <a href="https://github.com/sigstore/rekor/blob/main/pkg/types/README.md">growing list of types supported</a> by Rekor. Given the fact that it is relatively easy to integrate with the types found in Rekor, a new type supporting Helm was introduced.</p><p>All Rekor types extend the <a href="https://github.com/sigstore/rekor/tree/main/pkg/types#base-schema">default base schema</a> (also called a ProposedEntry) and one of the primary goals when implementing the schema for Helm support was for it to be modeled using the same provenance schematics that are provided by Helm natively. This included signature support using PGP and capturing assets that are essential to the Helm signing and verification process. The result was an <a href="https://github.com/sigstore/rekor/blob/main/pkg/types/helm/v0.0.1/helm_v0_0_1_schema.json">entry</a> consisting of the following:</p><ul><li>The provenance file for the signed Helm chart (captured but not stored)</li><li>The detached signature included in the provenance file</li><li>Public key associated with the private key used to sign the chart</li><li>The checksum of the packaged chart</li></ul><p>Each of these data points are readily available and familiar to anyone who has worked with signed Helm charts. The somewhat challenging part is to apply the appropriate format to comply with the Helm schema. Rekor does provide a command line interface to interact with the exposed API which can be used for submission, but for custom types, like Helm, there is an assumption that entries are properly formatted beforehand. In order to streamline the interaction from an end user perspective and to simplify the integration between Helm and sigstore, a purpose built tool would need to be created.</p><h4>Introducing the Helm sigstore Plugin</h4><p>Helm has the capacity for access tools from the Helm CLI that is located outside of the core codebase through the use of Plugins. The plugins themselves are ordinary executables, but the <a href="https://helm.sh/docs/topics/plugins/">plugin system</a> provides the capability to not only invoke them from within Helm, but also manage their lifecycle, including the installation and update process.</p><p>The <a href="https://github.com/sigstore/helm-sigstore">Helm sigstore plugin</a> is a Helm plugin that brings the capabilities provided by the sigstore project (specifically Rekor) to the Helm ecosystem. Not only can it aid in the publishing of Helm chart content to a Rekor server, it can also be used to verify previously published resources.</p><p>Like any other Helm plugin, installation is a breeze. Assuming you have Helm previously installed and configured, the Helm Sigstore plugin can be installed by executing the following command:</p><pre>$ helm plugin install <a href="https://github.com/sigstore/helm-sigstore">https://github.com/sigstore/helm-sigstore</a></pre><p>Confirm the plugin was installed correctly by running helm sigstore which will display all of the available subcommands. The capabilities provided by each subcommand is as follows:</p><ul><li>upload — Upload an existing signed packaged Helm chart to Rekor</li><li>verify — Assert the validity of a signed packaged Helm chart based on previously published content from Rekor</li><li>search — Determine whether a signed packaged Helm chart is found in the Rekor server</li></ul><p>To demonstrate the full capabilities provided by the Helm sigstore plugin, let’s walk through how one would make use of the plugin — either as a Helm chart producer or consumer.</p><h4>Using the Helm sigstore Plugin</h4><p>Multiple personas can play a role when using the Helm sigstore plugin. Helm chart producers would use the upload capability once the chart has been created, packaged and signed. Helm chart consumers would then be able to determine whether the chart they are about to install is located in the Rekor server and then subsequently verify the content of the chart.</p><p>First, acting as a chart producer, create a new Helm chart called “helm-sigstore-example” which will be used to demonstrate how Helm charts can be uploaded to Rekor using the Helm Sigstore plugin:</p><pre>$ helm create helm-sigstore-example</pre><p>Feel free to modify the contents of the chart created by the prior invocation as you see fit. The next step is to package and sign the chart. Be sure that you have a PGP keypair available along with any of the other <a href="https://helm.sh/docs/topics/provenance/#the-workflow">prerequisites necessary for signing Helm charts</a>.</p><p>Sign and package the Helm chart:</p><pre>$ helm package --sign --key &lt;key&gt; --keyring &lt;keyring&gt; helm-sigstore-example</pre><p>The result is the packaged Helm chart and the associated provenance file. Both files (similar to Helm’s provenance itself) are needed in order to publish the chart to Rekor.</p><p>Since all of the necessary resources are now available, we can now use the helm sigstore upload command provided by the Helm sigstore plugin to publish the chart to Rekor. The only required argument is the path to the packaged chart. The remaining options, such as the PGP keyring and public can, can be inferred either using the default values or from the content of the provenance file. If the --keyring option was used to sign the Helm chart, it will need to be provided as the default location is identical to that of the helm package command.</p><p>The final option to consider is the destination for which the chart will be published. By default, charts are published to the publicly hosted Rekor instance. However, the plugin can make use of a self managed Rekor instance as well by specifying the --rekor-server parameter or through the REKOR_SERVER environment variable. Steps for deploying your own instance were provided earlier.</p><p>Now, upload the Helm chart to Rekor</p><pre>$ helm sigstore upload --keyring &lt;keyring&gt; helm-sigstore-example-0.1.0.tgz</pre><pre>Created Helm entry at index 688276, available at: <a href="https://rekor.sigstore.dev/api/v1/log/entries/f5d7359c0c32bba544e9258a40c64537be773d4bb65d1fd11e32d945927bf88d">https://rekor.sigstore.dev/api/v1/log/entries/f5d7359c0c32bba544e9258a40c64537be773d4bb65d1fd11e32d945927bf88d</a></pre><p>Congratulations, you just published your first Helm chart to a Rekor instance using the Helm sigstore plugin!</p><p>With the chart successfully published to Rekor, we can now change personas to a role that represents the majority in the Helm community: the consumer.</p><p>As a consumer of Helm charts, or any software, you have the opportunity (and responsibility) for asserting the content prior to use. The Helm sigstore plugin provides several options that consumers can use to manage Helm charts.</p><p>First, you can determine whether a chart has been previously published to Rekor. The mere fact that a publisher has taken the time to not only sign a chart, but publish its content, is a good sign they have security in mind. The search subcommand of the Helm sigstore plugin queries whether a chart has been published to the targeted Rekor instance.</p><p>Let’s use the previously published helm-sigstore-example chart to demonstrate searching for charts in Rekor.</p><pre>$ helm sigstore search helm-sigstore-example-0.1.0.tgz</pre><pre>The Following Records were Found</pre><pre>Rekor Server: <a href="https://rekor.sigstore.dev/">https://rekor.sigstore.dev</a></pre><pre>Rekor UUID: f5d7359c0c32bba544e9258a40c64537be773d4bb65d1fd11e32d945927bf88d</pre><p>The Rekor UUID values along with the server are displayed if the chart was located. To see what would happen when a chart could not be located, feel free to create and sign a new Helm chart and then use the helm sigstore search command once again pointing to the new chart.</p><p>While just determining whether a chart has been published to Rekor or not is a good first step, it is important that the content be verified as to ensure that it has not been tampered with since it was published. Use the helm sigstore verify subcommand to confirm the signed and packaged chart matches the content in the Rekor server. The public key that was used to sign the chart must be available either as a standalone file or imported into a PGP keyring. Verify the chart by executing the following command:</p><pre>$ helm sigstore verify --keyring &lt;keyring&gt; helm-sigstore-example-0.1.0.tgz</pre><pre>Chart Verified Successfully From Helm entry:</pre><pre>Rekor Server: <a href="https://rekor.sigstore.dev/">https://rekor.sigstore.dev</a></pre><pre>Rekor Index: 688276</pre><pre>Rekor UUID: f5d7359c0c32bba544e9258a40c64537be773d4bb65d1fd11e32d945927bf88d</pre><p>Great! The chart was verified successfully. So, what does the verification process entail?</p><ul><li>A match between the public key being specified and the entry in Rekor</li><li>A match between the digest included in the provenance file and the entry in Rekor</li><li>PGP verification of the provenance file (similar to the default verification Helm performs when installing signed charts)</li></ul><p>At this point, given that the chart completed the verification process, you should have the confidence knowing that no malicious action or corruption occurred and can make informed choices on its usage.</p><h4>We’re Just Getting Started</h4><p>Very much like the sigstore project itself, the integration with the Helm ecosystem is still in its infancy. There are a lot of ideas and opportunities in the works. One of the areas of future investigation and collaboration with the <a href="https://github.com/helm/community">upstream Helm community</a> is around the inclusion of additional methods for signing charts beyond PGP. Signed Helm chart adoption still remains relatively low, and this statistic can be partially attributed to the complexities and management of PGP keys. By lowering the barrier of entry and enabling signing of Helm charts with ease, the benefits can be realized by both chart producers and consumers.</p><p>Of course none of this would be possible without contributions from the community. Does the integration of Helm with the sigstore project sound interesting to you? To get involved, check out the <a href="https://sigstore.dev/">sigstore website</a>, <a href="https://github.com/sigstore">GitHub organization</a> or join the <a href="https://sigstore.slack.com/">sigstore workspace on Slack</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d51564ea001f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up your own Rekor Transparency Log Server using Helm]]></title>
            <link>https://medium.com/@sabre1041/setting-up-your-own-rekor-transparency-log-server-using-helm-fc7bbeafb59c?source=rss-a2972cbca1dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc7bbeafb59c</guid>
            <dc:creator><![CDATA[Andrew Block]]></dc:creator>
            <pubDate>Wed, 28 Jul 2021 15:14:25 GMT</pubDate>
            <atom:updated>2021-07-28T15:14:25.502Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i2OxRfoPXp8b6xwx7-E8Ig.png" /></figure><p><a href="https://github.com/sigstore/rekor">Rekor</a> is an immutable transparency log server underneath the <a href="https://sigstore.dev/">sigstore</a> project that can be used by software maintainers to store signed records describing their application. Consumers can then lookup these records to verify the content for the software they are about to use. Rekor plays a pivotal role in the secure software supply chain as it provides another level of assurance that the software artifact that consumers are about to use has not been modified since the producer created it. Deploying your own instance of Rekor within a Kubernetes environment using Helm is a quick and easy way to advance your understanding of the role a transparency log has and how it can be incorporated into the software delivery process.</p><p>The sigstore community hosts a publicly available instance of Rekor at <a href="https://rekor.sigstore.dev/">https://rekor.sigstore.dev</a>. This is great for anyone who wants to distribute or make use of content targeted for the general public. However, given that most organizations create content that is not intended for public consumption, providing an alternative method of deploying Rekor is desired. In addition, if you are like me, when starting to learn about new concepts and beginning to get my hands dirty, I prefer to not have my “learnings” become public knowledge.</p><p>To support deploying an instance of Rekor within a Kubernetes environment, a Helm chart is available to simplify the deployment of the Rekor server along with its dependent components. The Rekor architecture consists of the following:</p><ul><li><a href="https://sigstore.dev/get_started/server/">Rekor Server</a> — Exposes an API based server for validation and a transparency log for storage</li><li><a href="https://redis.io/">Redis</a> — In-memory cache</li><li><a href="https://github.com/google/trillian">Trillian</a> — A transparent, highly scalable and cryptographically verifiable data store.</li><li><a href="https://www.mysql.com/">MySQL</a> — Storage for Trillian</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*bdz7tUqYTQecioDQarHNcw.png" /><figcaption>Rekor architecture</figcaption></figure><p>We won’t go into the details of Rekor’s architecture, but if you are interested, more information can be found on the <a href="https://github.com/sigstore/rekor">Rekor project page</a>.</p><h3>Deploying Rekor using Helm</h3><p>Rekor is just one of the available Helm charts located in the <a href="https://github.com/sigstore/helm-charts">sigstore Helm chart repository</a>. Adding a chart repository and managing Helm content is accomplished by making use of the Helm CLI. If you do not have the Helm CLI installed on your local machine, it can be installed using any of the methods described <a href="https://helm.sh/docs/intro/install/">here</a>.</p><p>Once the Helm CLI is installed, configured and available, execute the following commands to set up the sigstore Helm chart repository.</p><pre>$ helm repo add sigstore <a href="https://sigstore.github.io/helm-charts">https://sigstore.github.io/helm-charts</a></pre><pre>$ helm repo update</pre><p>You can view all of the charts available in the sigstore Helm repository by running the following command:</p><pre>$ helm search repo sigstore/</pre><p>The Rekor chart is quite extensible and supports being deployed to a variety of Kubernetes deployment targets. The options available can be inspected by viewing the content in the Git repository or using the CLI to display information about the chart.</p><pre>$ helm show all sigstore/rekor</pre><p>Given that Rekor exposes an API, the most important area to focus on is how traffic will reach the server itself. The chart supports exposing the server via an <a href="https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer">LoadBalancer service</a> or as an Ingress in conjunction with an existing <a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/">Ingress Controller</a>. Additional options are available, but for the purpose of this discussion, let’s assume a Kubernetes deployment target with an existing Ingress controller. If you do not have an existing Kubernetes environment, you can use <a href="https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/">minikube and enable the ingress plugin</a> which will deploy an instance of the <a href="https://kubernetes.github.io/ingress-nginx/">NGINX ingress controller</a>.</p><p>It is important to not only integrate tools, like Rekor, into the software delivery process, but do so using secure practices. This involves ensuring the communication between the client and server makes use of secure protocols, like TLS and HTTPS. In addition, this is also a requirement that is employed by Rekor itself. TLS certificates are associated with an Ingress resource by specifying the name of the Secret within the same namespace containing the certificates. Certificates can be provided from a variety of sources including generating your own manually (self signed), from a corporate Certificate Authority or using a tool like cert-manager which automates the generation and management within a Kubernetes environment. Regardless of how you provide the certificates, be sure that a Secret is available when the Helm chart is installed.</p><p><em>Note: As mentioned previously, there are multiple methods for managing the communication from external sources including facilitating TLS termination at Rekor itself.</em></p><p>Now, deploy the Rekor Helm chart. If you have not created a dedicated namespace for Rekor, create one. In the example below, a new namespace called rekor will be created and the current kubeconfig context will be changed to target this namespace.</p><pre>$ kubectl create namespace rekor</pre><pre>$ kubectl config set-context --current --namespace=rekor</pre><p>Since we are using an Ingress for access to the Rekor server, two Helm values need to be specified: The hostname of the server which will be configured in the Ingress resource and the secret containing the TLS certificates.</p><p>Deploy the Rekor Helm chart by executing the following command:</p><pre>$ helm upgrade -i -n rekor rekor sigstore/rekor --set=server.ingress.hostname=&lt;hostname&gt; --set=server.ingress.tls.secretName=&lt;secret_name&gt;</pre><p><em>Note: Some ingress controllers support additional configurations through annotations placed on the Ingress resource. This can be accomplished by passing the </em><em>--set=server.ingress.annotations.&quot;&lt;annotation_name&gt;&quot;=&lt;value&gt; parameter. If the name of the annotation contains periods or forward slashes, they will need to be escaped with a \ preceding the character.</em></p><p>Once the chart has been installed, verify each of the pods are running and Ready</p><pre>$ kubectl get pods -n rekor</pre><pre>NAME                                         READY   STATUS    RESTARTS   AGE</pre><pre>rekor-mysql-55954594fb-lxv8b                 1/1     Running   0          1m</pre><pre>rekor-redis-7db47db5f8-bgc4t                 1/1     Running   0          1m</pre><pre>rekor-server-8655b97fb6-zp2rc                1/1     Running   2          1m</pre><pre>rekor-trillian-log-server-866fc8d44d-79sph   1/1     Running   0          1m</pre><pre>rekor-trillian-log-signer-7cf56bcf7-8pqgt    1/1     Running   0          1m</pre><p>The rekor server pod may indicate multiple restarts under the status field. This is normal as it was waiting for dependencies to become available.</p><p>Next, confirm that you are able to query the Rekor API by retrieving the current state of the transparency log.</p><pre>$ curl https://&lt;hostname&gt;/api/v1/log</pre><p>A message similar to the following indicates a successful response:</p><pre>{&quot;rootHash&quot;:&quot;e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855&quot;,&quot;signedTreeHead&quot;:&quot;Rekor\n0\n47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=\nTimestamp: 1627450674310182057\n\n— rekor.sigstore.dev OTg2NzBFAiAdOitKMFxlww8GgyZL/rOUxDtIezdDkIg+y1qASSzlvgIhAMCug58E6rOhY74VkY2UapbV9S8weQKxL69vyZ6xV2MD\n&quot;,&quot;treeSize&quot;:0}</pre><h3>Upload an Entry</h3><p>Several different types of records can be stored in Rekor. While entries can be submitted directly via the REST API, the easiest way to submit a record without having to be concerned with the underlying details is to use the Rekor CLI (rekor-cli). To confirm the functionality of the Rekor server deployed via the Helm chart, first install the Rekor CLI to your machine using the steps described <a href="https://sigstore.dev/get_started/client/">here</a>.</p><p>Once installed, use the rekor-cli to upload a recent version of the Jenkins CI server to your instance of Rekor:</p><pre>$ rekor-cli upload --rekor_server=https://&lt;hostname&gt; --artifact=https://get.jenkins.io/war-stable/2.277.3/jenkins.war --type=jar --artifact-hash=3e22c7e8cd7c8ee1e92cbaa8d0d303a7b53e07bc2a152ddc66f8ce55caea91ab</pre><pre>Created entry at index 0, available at: https://&lt;hostname&gt;/api/v1/log/entries/5bf721a65011f3c1273d728021cf669603e7b96b68d3e86249801a8eeb0a8c34</pre><p>If the upload operation was successful, the log index and the url of the created record will be provided as a response. The value of the last path parameter (5bf721a65011f3c1273d728021cf669603e7b96b68d3e86249801a8eeb0a8c34 in the example response above is the uuid).</p><p><em>Note: Followers of the sigstore project may recall that this example was used in the </em><a href="https://blog.sigstore.dev/sigstore-project-update-april-2021-f01d7ea5c60e"><em>March 2021 project update article</em></a><em>.</em></p><p>To retrieve the entry from Rekor, use the get subcommand and reference the provided uuid value:</p><pre>$ rekor-cli get --rekor_server=https://&lt;hostname&gt; --uuid=&lt;uuid&gt;</pre><p>The details provided in the response allows you to both inspect how values are represented within the Rekor server, but also (more importantly) verify the content of software that you are attempting to utilize.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc7bbeafb59c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>