Git Product home page Git Product logo

release-sdk's Introduction

release-sdk

Interfaces and implementations for building Kubernetes releases.

release-sdk's People

Contributors

aroradaman avatar cpanato avatar dependabot[bot] avatar embik avatar justaugustus avatar k8s-ci-robot avatar matglas avatar nitishfy avatar palnabarun avatar puerco avatar pushkarj avatar rawlingsj avatar saschagrunert avatar upodroid avatar wilsonehusin avatar xmudrii avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

release-sdk's Issues

Replace calls to git binary in git package with pure go code

Our git package has several calls to the git package. In order to be able to use our binaries in leaner container images (ie distroless) we need to write alternatives to some of its functions to pure go, and drop the calls to the git binary.

Create a SECURITY_CONTACTS file.

As per the email sent to kubernetes-dev[1], please create a SECURITY_CONTACTS
file.

The template for the file can be found in the kubernetes-template repository[2].
A description for the file is in the steering-committee docs[3], you might need
to search that page for "Security Contacts".

Please feel free to ping me on the PR when you make it, otherwise I will see when
you close this issue. :)

Thanks so much, let me know if you have any questions.

(This issue was generated from a tool, apologies for any weirdness.)

[1] https://groups.google.com/forum/#!topic/kubernetes-dev/codeiIoQ6QE
[2] https://github.com/kubernetes/kubernetes-template-project/blob/master/SECURITY_CONTACTS
[3] https://github.com/kubernetes/community/blob/master/committee-steering/governance/sig-governance-template-short.md

Images with SBOMs attached report as signed with sign.IsSigned()

If an image is not signed but has an sbom attached, passing it to sign.IsSigned() will return a false positive.

Can be rproduced with this reference :
gcr.io/ulabs-cloud-tests/supply-chain-demo@sha256:97fa9dd10904972265ca625373490ceed4066062d50063b910b020b80fdd7f20

# Download its signature
cosign download signature gcr.io/ulabs-cloud-tests/supply-chain-demo@sha256:97fa9dd10904972265ca625373490ceed4066062d50063b910b020b80fdd7f20
Error: no signatures associated with gcr.io/ulabs-cloud-tests/supply-chain-demo@sha256:97fa9dd10904972265ca625373490ceed4066062d50063b910b020b80fdd7f20
main.go:46: error during command execution: no signatures associated with gcr.io/ulabs-cloud-tests/supply-chain-demo@sha256:97fa9dd10904972265ca625373490ceed4066062d50063b910b020b80fdd7f20

# Download its SBOM:
cosign download sbom gcr.io/ulabs-cloud-tests/supply-chain-demo@sha256:97fa9dd10904972265ca625373490ceed4066062d50063b910b020b80fdd7f20
Found SBOM of media type: text/spdx
SPDXVersion: SPDX-2.2
DataLicense: CC0-1.0
SPDXID: SPDXRef-DOCUMENT
DocumentName: github.com/puerco/supply-chain-demo
DocumentNamespace: http://spdx.org/spdxpackages/github.com/puerco/supply-chain-demo
Creator: Tool: ko 0.11.0
....

sign: Implement attestation signing

What would you like to be added:

Our signing library should implement signing of in-toto attestations

Why is this needed:

We need to build our own attestation signing code for three main reasons:

  1. Signing our provenance attestations during the release process
  2. Being able to attest of image promoter runs via a signed attestation
  3. Making sure we can produce general purpose code and tools that other projects in the kubernetes org (and elsewhere) can leverage to generate attestation and build attesting features into other projects.

/kind feature

`ListTags` on replay always returns empty slice

func (c *githubNotesReplayClient) ListTags(
ctx context.Context, owner, repo string, opt *github.ListOptions,
) ([]*github.RepositoryTag, *github.Response, error) {
data, err := c.readRecordedData(gitHubAPIListTags)
if err != nil {
return nil, nil, err
}
result := []*github.RepositoryTag{}
record := apiRecord{Result: result}
if err := json.Unmarshal(data, &record); err != nil {
return nil, nil, err
}
return result, record.response(), nil
}

It seems that we need to pass reference to apiRecord initializer, i.e.

	result := []*github.RepositoryTag{}
-	record := apiRecord{Result: result}
+	record := apiRecord{Result: &result}

Create a SECURITY_CONTACTS file.

As per the email sent to kubernetes-dev[1], please create a SECURITY_CONTACTS
file.

The template for the file can be found in the kubernetes-template repository[2].
A description for the file is in the steering-committee docs[3], you might need
to search that page for "Security Contacts".

Please feel free to ping me on the PR when you make it, otherwise I will see when
you close this issue. :)

Thanks so much, let me know if you have any questions.

(This issue was generated from a tool, apologies for any weirdness.)

[1] https://groups.google.com/forum/#!topic/kubernetes-dev/codeiIoQ6QE
[2] https://github.com/kubernetes/kubernetes-template-project/blob/master/SECURITY_CONTACTS
[3] https://github.com/kubernetes/community/blob/master/committee-steering/governance/sig-governance-template-short.md

sign: cache transports and signed references

We can (TTL) cache the transports as well as the information if an image has a signature available or not. This way we can lookup the cache on signature verification:

isSigned, err := s.IsImageSigned(reference)

Omit parsing the reference multiple times:

ref, err := s.impl.ParseReference(reference)

Reuse the transport for digest lookup:

dig, err := s.impl.Digest(ref.String())

We can also add a new API to batch verify multiple images in parallel.

API users like promo-tools can then pass around the signer to keep the information available during application lifecycle.

Refers to kubernetes-sigs/promo-tools#637

Use `gregjones/httpcache` to reduce rate limit quota consumption

GitHub API supports conditional requests using ETag and If-None-Match. By using gregjones/httpcache, this will reduce GitHub API rate limit quota consumption when local cache is still "current" โ€” particularly useful in release notes workflow for release team when generating both markdown and JSON in one sitting.

func NewWithToken(token string) (*GitHub, error) {
ctx := context.Background()
client := http.DefaultClient
state := "unauthenticated"
if token != "" {
state = strings.TrimPrefix(state, "un")
client = oauth2.NewClient(ctx, oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: token},
))
}
logrus.Debugf("Using %s GitHub client", state)
return &GitHub{
client: &githubClient{github.NewClient(client)},
options: DefaultOptions(),
}, nil
}

Transitive dependencies on github.com/hashicorp/go-retryablehttp required to build

What happened:

Cannot build release-sdk commands without pulling in MPL-licensed projects not in the CNCF allowlist.

go mod why github.com/hashicorp/go-retryablehttp shows this path to github.com/hashicorp/go-retryablehttp which is MPL-licensed and not included in the CNCF allowlist:

# github.com/hashicorp/go-retryablehttp
sigs.k8s.io/release-sdk/sign
github.com/sigstore/cosign/cmd/cosign/cli/rekor
github.com/sigstore/rekor/pkg/client
github.com/hashicorp/go-retryablehttp

https://github.com/cncf/foundation/blob/main/license-exceptions/

https://github.com/cncf/foundation/blob/main/allowed-third-party-license-policy.md#cncf-allowlist-license-policy

cncf/foundation#138

What you expected to happen:

No dependencies on MPL-licensed projects not explicitly allowlisted

How to reproduce it (as minimally and precisely as possible):

run go mod vendor to see code actually used/linked by release-sdk and observe go-retryablehttp code is required to build.

Populate the SignedObject with the information about signed image/artifact

The SignedObject object returned when signing and verifying images/artifacts signed with the sign package is currently empty. We should put some information about the signed artifact in that object, so consumers can use it for validation or exposing that information to users.

We can include information such as:

  • SHA/digest of the signed image/artifact
  • Link to the signature (.sig) file

Eventually, we might want to include other information as needed.

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.