Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[govulncheck] Periodic Prow Job for govulncheck #100

Closed
4 tasks done
Tracked by #95
PushkarJ opened this issue Aug 28, 2023 · 13 comments
Closed
4 tasks done
Tracked by #95

[govulncheck] Periodic Prow Job for govulncheck #100

PushkarJ opened this issue Aug 28, 2023 · 13 comments
Assignees
Labels
area/dependency Issues or PRs related to dependency changes sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/release Categorizes an issue or PR as relevant to SIG Release. sig/security Categorizes an issue or PR as relevant to SIG Security.

Comments

@PushkarJ
Copy link
Member

PushkarJ commented Aug 28, 2023

Description

Run govulncheck periodically in default mode symbol level on https://github.com/kubernetes/kubernetes for:

  • master branch i.e. HEAD
  • release-1.stable-version
  • release-1.prev-stable-minor-version
  • release-1.oldest-stable-minor-version

This will allow to get a sense of new vulnerabilities identified and help facilitate decision on cherry picks

Implementation Details

Create a new yaml file here: https://github.com/kubernetes/test-infra/tree/0e5705d1a7cfe4c0ba8e2518a15c26f8ebc1b66d/config/jobs/kubernetes/sig-security named as govulncheck-periodic.yaml that looks something like this:

periodics:
  - interval: 6h
    name: check-dependency-stats-periodical
    decorate: true
    decoration_config:
      timeout: 5m
    extra_refs:
    - org: kubernetes
      repo: kubernetes
      base_ref: master
      path_alias: k8s.io/kubernetes
    spec:
      containers:
      - image: golang
        command:
        - /bin/bash
        args:
        - -c
    spec:
      containers:
      - image: golang
        command:
        - /bin/bash
        args:
        - -c
        - |
          set -euo pipefail
          export WORKDIR=${ARTIFACTS:-$TMPDIR}
          export PATH=$PATH:$GOPATH/bin
          mkdir -p "${WORKDIR}"
          pushd "$WORKDIR"
          go install golang.org/x/vuln/cmd/govulncheck@latest
          popd
          
          govulncheck -scan module ./... > "${WORKDIR}/head.txt"
          
          stable=$(curl -Ls https://dl.k8s.io/release/stable.txt)
          minorversion=$(echo $stable | cut -d. -f2)
          prevminorversion=$(expr $minorversion - 1)
          oldestminorversion=$(expr $prevminorversion - 1)
          
          b1=$(echo "release-1.${minorversion}")
          b2=$(echo "release-1.${prevminorversion}")
          b3=$(echo "release-1.${oldestminorversion}")
          git reset --hard HEAD
          git checkout $b1
          govulncheck -scan module ./... > "${WORKDIR}/b1.txt"
          git reset --hard HEAD
          git checkout $b2
          govulncheck -scan module ./... > "${WORKDIR}/b2.txt"
          git reset --hard HEAD
          git checkout $b3
          govulncheck -scan module ./... > "${WORKDIR}/b3.txt"
          for file in *.txt; do if [ -s $file ]; then cat *.txt; exit -1; fi; done
  annotations:
    testgrid-create-test-group: "true"
    testgrid-dashboards: sig-security-govulncheck-periodics
    description: Runs `govulncheck` periodically on master and supported release branches

Tips and Caveats

Parent

#95

Periodic Jobs:

https://prow.k8s.io/job-history/gs/kubernetes-jenkins/logs/ci-kubernetes-verify-1-30
https://prow.k8s.io/job-history/gs/kubernetes-jenkins/logs/ci-kubernetes-verify-1-29
https://prow.k8s.io/job-history/gs/kubernetes-jenkins/logs/ci-kubernetes-verify-1-28
https://prow.k8s.io/job-history/gs/kubernetes-jenkins/logs/ci-kubernetes-verify-1-27
https://prow.k8s.io/job-history/gs/kubernetes-jenkins/logs/ci-kubernetes-verify-master

Backport PRs

kubernetes/kubernetes#124750
kubernetes/kubernetes#124751
kubernetes/kubernetes#125772

Links to Release branches script

https://github.com/kubernetes/kubernetes/blob/release-1.27/hack/verify-govulncheck.sh
https://github.com/kubernetes/kubernetes/blob/release-1.28/hack/verify-govulncheck.sh
https://github.com/kubernetes/kubernetes/blob/release-1.29/hack/verify-govulncheck.sh
https://github.com/kubernetes/kubernetes/blob/release-1.30/hack/verify-govulncheck.sh

@PushkarJ
Copy link
Member Author

/sig security architecture release
/area dependency

@k8s-ci-robot k8s-ci-robot added sig/security Categorizes an issue or PR as relevant to SIG Security. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/release Categorizes an issue or PR as relevant to SIG Release. area/dependency Issues or PRs related to dependency changes labels Aug 28, 2023
@PushkarJ PushkarJ changed the title [govulncheck] Periodic scan with govulncheck [govulncheck] Periodic Prow Job for govulncheck Aug 28, 2023
@ArkaSaha30
Copy link
Member

/assign

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 27, 2024
@PushkarJ
Copy link
Member Author

/remove-lifecycle stale

This is planned to be worked on soon

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 28, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 28, 2024
@PushkarJ
Copy link
Member Author

Relevant slack conversation: https://kubernetes.slack.com/archives/C01CUSVMHPY/p1716151527074909

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 25, 2024
@PushkarJ
Copy link
Member Author

Periodics are running for master / HEAD, v1.30, v1.29, v1.28 and v1.27. They are working for master , v1.30 and v1.29. Added a backport fix for v1.28: kubernetes/kubernetes#125772 to maintain n-2 support of releases. Once that is merged and once release team agrees that v1.27 backport is needed or not, we will be done with the work needed to close this issue :)

Big thanks to @ArkaSaha30 for taking this forward to where it is today!

@PushkarJ
Copy link
Member Author

remove-lifecycle rotten

@PushkarJ
Copy link
Member Author

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jun 27, 2024
@PushkarJ
Copy link
Member Author

PushkarJ commented Jul 9, 2024

With kubernetes/kubernetes#125772 merged we can mark this issue as closed (complete)

Any future patch version upgrades to govulncheck do not need an issue but any minor (breaking only) and major version upgrade it is recommended to discuss it in an issue before opening a PR.

/close

@k8s-ci-robot
Copy link
Contributor

@PushkarJ: Closing this issue.

In response to this:

With kubernetes/kubernetes#125772 merged we can mark this issue as closed (complete)

Any future patch version upgrades to govulncheck do not need an issue but any minor (breaking only) and major version upgrade it is recommended to discuss it in an issue before opening a PR.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@tabbysable
Copy link
Member

Relevant slack conversation: https://kubernetes.slack.com/archives/C01CUSVMHPY/p1716151527074909

for future reference: in this slack thread, it was decided to implement the govulncheck scanning as a verify-*.sh script which then runs both periodically and pre-commit.

So that means this issue, as well as #99, were both closed by kubernetes/kubernetes#120562

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dependency Issues or PRs related to dependency changes sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/release Categorizes an issue or PR as relevant to SIG Release. sig/security Categorizes an issue or PR as relevant to SIG Security.
Projects
Status: In Progress
Development

No branches or pull requests

5 participants