🧩

security-responder-bump

security-responder-bump · v
作者 manuelbuil 公开目录收录

简介

Automates the process of bumping security-responder in RKE2 and rke2-charts using the latest commit from rancher/rke2-security-responder. Can optionally bump Go and create a new patch release in rancher/rke2-security-responder first. Use this skill when asked to perform a security-responder bump or update on RKE2, rke2-charts, or rke2-security-responder (including Go bumps, releases, master issues

通过你的 Agent 添加

安装目录:security-responder-bump/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/security-responder-bump/
Codex CLI~/.codex/skills/security-responder-bump/
DeepSeek Harness~/.agents/skills/security-responder-bump/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

技能正文


name: security-responder-bump description: Automates the process of bumping security-responder in RKE2 and rke2-charts using the latest commit from rancher/rke2-security-responder. Can optionally bump Go and create a new patch release in rancher/rke2-security-responder first. Use this skill when asked to perform a security-responder bump or update on RKE2, rke2-charts, or rke2-security-responder (including Go bumps, releases, master issues/PRs, and backports).

RKE2 Security Responder Bump Automation Skill

This skill automates the process of updating rke2-security-responder across rke2-charts and rke2. The entire process is driven by fetching the latest commit on the default branch from the upstream repository rancher/rke2-security-responder.


CRUCIAL MANDATE: NO AUTOMATIC MERGING, GIT IDENTITY & ISSUE METADATA

  • NEVER AUTOMERGE PRs: Under no circumstances should this skill or any agent attempt to automatically merge any created Pull Requests (on rke2-security-responder, rke2-charts or rke2). Your scope is strictly limited to creating the issues and Pull Requests.
  • MANUAL REVIEW ONLY: All PRs must remain open to be reviewed, approved, and manually merged by human maintainers.
  • IF A STEP SAYS 'WAIT FOR MERGE': You must pause, clearly present the link to the created PR to the user, and ask them to manually review and merge it. Do not attempt to run any gh pr merge or similar commands.
  • GIT IDENTITY CONFIGURATION: Before making any commits, ensure that the local Git configuration uses the correct human identity and email (e.g., git config user.name "Manuel Buil" and git config user.email "mbuil@suse.com") so that commits and Signed-off-by trailers have correct authorship.
  • BACKPORT BRANCH RESTRICTION (MINIMUM BRANCH 1.37): The rke2-security-responder component was introduced in RKE2 starting in branch 1.37 (release-1.37). NEVER create backport issues or PRs for branches lower than 1.37 (such as 1.36, 1.35, 1.34). Only 1.37 (and any newer release branches) are valid backport targets.
  • ISSUE ASSIGNEES & RELEASE MILESTONES (GitHub MCP / CLI): All created issues (both master issues and backport issues in rancher/rke2) MUST have the correct assignee and active release milestone configured:
    • Identify User / Assignee: Must be assigned to Manuel Buil (manuelbuil, mbuil@suse.com). Can verify authenticated user via get_me via MCP or run gh api user --jq .login to obtain the username.
    • Identify Milestone Number: Must have the active release milestone assigned, specifically 2026-10 Release Cycle (milestone ID 371). Can query or verify open milestones via ui_get(method="milestones", owner="rancher", repo="rke2") or gh api repos/rancher/rke2/milestones --jq '.[] | select(.state=="open") | {title: .title, number: .number}'.
    • Create / Update Issue with MCP or CLI: Pass assignees: ["manuelbuil"] and milestone: 371 (or the active release milestone ID).
  • FILE PERMISSIONS MANDATE (scripts/build-images MUST REMAIN 755 / 100755 EXECUTABLE): When modifying scripts/build-images, its file permissions must remain 755 (100755 executable). If modifying or creating commits via the GitHub API (Trees API or MCP push_files), git tree entries default to 100644 unless mode: "100755" is explicitly specified. Ensure that scripts/build-images retains 755 (100755 executable) permissions and verify that the resulting git diff in the Pull Request does not contain an unwanted file permission change (e.g., old mode 100755 new mode 100644).

Automation Flow

Step 0 (Optional): Bump Go & Create Release in rke2-security-responder

Run this optional step when requested to bump the Go version or create a new patch release for rke2-security-responder before bumping rke2-charts and rke2. If bumping Go is not needed, skip directly to Step 1.

  1. Identify Target Go Version:

    • Determine target Go version $GO_VERSION (e.g., 1.26.10). If not specified, ask the user or check the required Go version.
  2. Clone or Navigate to rke2-security-responder:

    git checkout main && git pull
    git checkout -b bump-go-$GO_VERSION
    
  3. Determine Next Patch Release Version:

    • Inspect charts/rke2-security-responder/Chart.yaml on main to read the current version $CURRENT_VERSION (e.g., 0.1.8):
      grep -E "^version:" charts/rke2-security-responder/Chart.yaml
      
    • Increment the patch component to obtain $NEW_SR_VERSION (e.g., 0.1.8 -> 0.1.9).
  4. Update Files to Bump Go and Release Version:

    • .github/workflows/ci.yml:
      • Update go-version: to '$GO_VERSION' in both Set up Go job steps.
      • Update golangci-lint version: in the lint job if bumping to a newer Go version (e.g. v2.15.0 or newer for Go 1.27+), as older golangci-lint binaries built on an older Go compiler will fail with the Go language version used to build golangci-lint is lower than the targeted Go version.
    • Dockerfile: Update the builder stage base image:
      FROM rancher/hardened-build-base:v${GO_VERSION}b1 AS builder
      
    • charts/rke2-security-responder/Chart.yaml: Update version and appVersion:
      version: $NEW_SR_VERSION
      appVersion: "$NEW_SR_VERSION"
      
    • charts/rke2-security-responder/values.yaml: Update image tag:
      image:
        repository: rancher/rke2-security-responder
        tag: v$NEW_SR_VERSION
      
    • go.mod: Update the Go directive:
      go $GO_VERSION
      
  5. Verify Version Invariants: Run the repository check script to ensure consistency across chart files:

    ./scripts/check-chart-version.sh
    
  6. Commit Changes with Sign-Off (-s):

    git commit -a -s -m "Bump go to $GO_VERSION"
    
  7. Push and Create Pull Request on rancher/rke2-security-responder:

    • Base Branch: main
    • Title: Bump go to $GO_VERSION and prepare for $NEW_SR_VERSION release
    • Body: Bump go to $GO_VERSION and prepare for $NEW_SR_VERSION release
    • CLI Command:
      gh pr create --repo rancher/rke2-security-responder --base "main" --title "Bump go to $GO_VERSION and prepare for $NEW_SR_VERSION release" --body "Bump go to $GO_VERSION and prepare for $NEW_SR_VERSION release"
      
  8. Pause and Ask (WAIT FOR MERGE):

    • Present the PR link to the user and request manual review and merge.
    • Do NOT attempt to auto-merge.
  9. Create GitHub Release in rancher/rke2-security-responder:

    • Once the PR is merged into main, checkout main and pull the latest changes:
      git checkout main && git pull
      
    • Create the release using the GitHub CLI with generated release notes:
      gh release create "v$NEW_SR_VERSION" --repo rancher/rke2-security-responder --title "v$NEW_SR_VERSION" --generate-notes
      
    • Note: Creating the release tag v$NEW_SR_VERSION automatically triggers the .github/workflows/release.yml GitHub Actions workflow to build and push multi-arch container images (linux/amd64, linux/arm64) to Docker Hub and Prime registry.
    • Verify workflow completion:
      gh run list --repo rancher/rke2-security-responder --workflow release.yml --limit 1
      
    • Once the release is published, proceed to Step 1 to bump rke2-charts and rke2 using the new release commit.

Step 1: Discover Latest Commit & Version from Upstream

  1. Query the latest commit SHA from the default branch of rancher/rke2-security-responder:

    gh api repos/rancher/rke2-security-responder/commits?per_page=1 --jq '.[0].sha'
    

    Note the commit SHA as $SR_COMMIT (e.g., a04158faecec1e864aee07d5ebf9aba772c5a91a).

  2. Query the upstream chart version from charts/rke2-security-responder/Chart.yaml at $SR_COMMIT:

    gh api "repos/rancher/rke2-security-responder/contents/charts/rke2-security-responder/Chart.yaml?ref=$SR_COMMIT" --jq '.content' | base64 -d
    

    Extract the version field as $SR_VERSION (e.g., 0.1.8). The image tag will be v$SR_VERSION (e.g., v0.1.8).


Step 2: Update rke2-charts

  1. Clone or navigate to the rke2-charts repository.
  2. Checkout and pull the default branch (main-source):
    git checkout main-source && git pull
    
  3. Checkout a new branch:
    git checkout -b bump-security-responder-$SR_VERSION
    
  4. Modify packages/rke2-security-responder/package.yaml:
    • Update the commit field with $SR_COMMIT.
    • Maintain packageVersion: 01 (unless instructed otherwise, or if bumping commit without changing the upstream chart version where packageVersion should be incremented). Example package.yaml:
    url: https://github.com/rancher/rke2-security-responder.git
    subdirectory: charts/rke2-security-responder
    commit: a04158faecec1e864aee07d5ebf9aba772c5a91a
    packageVersion: 01
    
  5. Commit the change with sign-off (-s):
    git commit -a -s -m "Bump rke2-security-responder to v$SR_VERSION"
    
  6. Push and create a Pull Request on rancher/rke2-charts targeting main-source:
    • Title: Bump rke2-security-responder to v$SR_VERSION
    • Body:
      Bumps rke2-security-responder to commit $SR_COMMIT (v$SR_VERSION).
      
    • CLI Command:
      gh pr create --repo rancher/rke2-charts --base "main-source" --title "Bump rke2-security-responder to v$SR_VERSION" --body "Bumps rke2-security-responder to commit $SR_COMMIT (v$SR_VERSION)."
      
  7. Pause and Ask (WAIT FOR MERGE):
    • Present the PR link to the user and ask them to manually review and merge it.
    • Do NOT attempt to auto-merge.
    • Once merged, wait a few minutes for GitHub Actions CI on rke2-charts to package the chart and publish it onto the main branch.

Step 3: Identify Generated Chart Version

The generated chart version follows the format <SR_VERSION><packageVersion>:

  • Example: $SR_VERSION = 0.1.8, packageVersion = 01 -> $CHART_VERSION = 0.1.801. Verify that the chart exists on the main branch of rke2-charts:
gh api "repos/rancher/rke2-charts/contents/charts/rke2-security-responder/rke2-security-responder?ref=main" --jq '.[].name'

(Confirm $CHART_VERSION before proceeding).


Step 4: Create Master Issue (RKE2)

Create an issue on rancher/rke2:

  • Title: Bump rke2-security-responder to v$SR_VERSION
  • Assignee: Assign to Manuel Buil (manuelbuil, mbuil@suse.com).
  • Milestone: Set to active release milestone, specifically 2026-10 Release Cycle (milestone ID 371).
  • Body:
    There is a new version of rke2-security-responder.
    
    **Describe the solution you'd like**
    Bump rke2-security-responder to v$SR_VERSION (commit $SR_COMMIT).
    
  • GitHub MCP Tool Call:
    issue_write(
      method: "create",
      owner: "rancher",
      repo: "rke2",
      title: "Bump rke2-security-responder to v$SR_VERSION",
      assignees: ["manuelbuil"],
      milestone: 371,
      body: "There is a new version of rke2-security-responder.\n\n**Describe the solution you'd like**\nBump rke2-security-responder to v$SR_VERSION (commit $SR_COMMIT)."
    )
    
  • CLI Fallback Command:
    gh issue create --repo rancher/rke2 --title "Bump rke2-security-responder to v$SR_VERSION" --assignee "manuelbuil" --milestone "2026-10 Release Cycle" --body "There is a new version of rke2-security-responder.
    
    **Describe the solution you'd like**
    Bump rke2-security-responder to v$SR_VERSION (commit $SR_COMMIT)."
    

(Retrieve and note the created master issue number, e.g., #11357)


Step 5: Create Master PR (RKE2)

  1. Clone or navigate to the rke2 repository.
  2. Checkout and pull master:
    git checkout master && git pull
    
  3. Checkout a new branch:
    git checkout -b bump-security-responder-$SR_VERSION
    
  4. Modify charts/chart_versions.yaml:
    • Locate the entry for /charts/rke2-security-responder.yaml.
    • Update version to $CHART_VERSION (e.g., 0.1.801):
        - version: 0.1.801
          filename: /charts/rke2-security-responder.yaml
          bootstrap: false
      
  5. Modify scripts/build-images:
    • Locate ${REGISTRY}/rancher/rke2-security-responder:<OLD_TAG> in the section generating images-core.txt.
    • Update the image tag to v$SR_VERSION (e.g., ${REGISTRY}/rancher/rke2-security-responder:v0.1.8).
    • File Permissions Check: Ensure scripts/build-images preserves its 755 (100755 executable) permissions so that no mode changes (old mode 100755 new mode 100644) appear in the diff.
  6. Commit the changes with sign-off (-s):
    git commit -a -s -m "Bump rke2-security-responder to v$SR_VERSION"
    
  7. Push and create a Pull Request on rancher/rke2 targeting master:
    • Title: Bump rke2-security-responder to v$SR_VERSION
    • Body:
      #### Proposed Changes
      Bump rke2-security-responder to v$SR_VERSION
      
      #### Types of Changes
      Version bump
      
      #### Verification
      Deploy RKE2 and verify that rke2-security-responder pod is deployed and running successfully.
      
      #### Linked Issues
      Resolves #<MASTER_ISSUE_NUMBER>
      
      #### User-Facing Change
      Bump rke2-security-responder to v$SR_VERSION
      
    • CLI Command:
      gh pr create --repo rancher/rke2 --base "master" --title "Bump rke2-security-responder to v$SR_VERSION" --body "#### Proposed Changes
      Bump rke2-security-responder to v$SR_VERSION
      
      #### Types of Changes
      Version bump
      
      #### Verification
      Deploy RKE2 and verify that rke2-security-responder pod is deployed and running successfully.
      
      #### Linked Issues
      Resolves #<MASTER_ISSUE_NUMBER>
      
      #### User-Facing Change
      Bump rke2-security-responder to v$SR_VERSION"
      

(Retrieve and note the master PR number, e.g., #11358)


Step 6: Ask for Backport Branches (RKE2)

Ask the user which release branches they want to backport the security-responder bump to (e.g., 1.37).

  • CRITICAL BRANCH RESTRICTION (>= 1.37 ONLY):
    • rke2-security-responder was introduced starting in 1.37 (release-1.37).
    • NEVER create backport issues or PRs for any branch lower than 1.37 (such as 1.36, 1.35, or 1.34).
    • If the user mentions or requests branches lower than 1.37, explain that rke2-security-responder is not supported or present in those branches, and do NOT create backports for them. Only proceed with 1.37 or newer branches.

Step 7: Create Backport Issues & PRs (RKE2)

For each target backport branch ($branch, e.g., 1.37):

A. Create Backport Issue (RKE2):
  • Title: [Release-$branch] - Bump rke2-security-responder
  • Labels: kind/backport
  • Assignee: Assign to Manuel Buil (manuelbuil, mbuil@suse.com).
  • Milestone: Set to active release milestone, specifically 2026-10 Release Cycle (milestone ID 371).
  • Body:
    Backport fix for Bump rke2-security-responder to v$SR_VERSION
    
    * #<MASTER_ISSUE_NUMBER>
    
  • GitHub MCP Tool Call:
    issue_write(
      method: "create",
      owner: "rancher",
      repo: "rke2",
      title: "[Release-$branch] - Bump rke2-security-responder",
      labels: ["kind/backport"],
      assignees: ["manuelbuil"],
      milestone: 371,
      body: "Backport fix for Bump rke2-security-responder to v$SR_VERSION\n\n* #<MASTER_ISSUE_NUMBER>"
    )
    
  • CLI Fallback Command:
    gh issue create --repo rancher/rke2 --title "[Release-$branch] - Bump rke2-security-responder" --label "kind/backport" --assignee "manuelbuil" --milestone "2026-10 Release Cycle" --body "Backport fix for Bump rke2-security-responder to v$SR_VERSION
    
    * #<MASTER_ISSUE_NUMBER>"
    

(Retrieve and note the RKE2 backport issue number, e.g., #11363)

B. Create Backport PR (RKE2):
  1. Checkout and pull the release branch:
    git checkout release-$branch && git pull
    
  2. Create a new branch:
    git checkout -b bump-security-responder-$SR_VERSION-$branch
    
  3. Apply changes to charts/chart_versions.yaml and scripts/build-images:
    • In charts/chart_versions.yaml: Update /charts/rke2-security-responder.yaml to $CHART_VERSION (e.g., 0.1.801).
    • In scripts/build-images: In images-core.txt, update ${REGISTRY}/rancher/rke2-security-responder:<OLD_TAG> to ${REGISTRY}/rancher/rke2-security-responder:v$SR_VERSION. Ensure scripts/build-images preserves 755 (100755 executable) permissions so no mode change is introduced.
  4. Commit with sign-off:
    git commit -a -s -m "Bump rke2-security-responder to v$SR_VERSION"
    
  5. Push and create the PR targeting release-$branch on rancher/rke2:
    • Title: [Release $branch] Bump rke2-security-responder
    • Body:
      Issue: https://github.com/rancher/rke2/issues/<BACKPORT_ISSUE_NUMBER>
      Backport: https://github.com/rancher/rke2/pull/<MASTER_PR_NUMBER>
      
    • CLI Command:
      gh pr create --repo rancher/rke2 --base "release-$branch" --title "[Release $branch] Bump rke2-security-responder" --body "Issue: https://github.com/rancher/rke2/issues/<BACKPORT_ISSUE_NUMBER>
      Backport: https://github.com/rancher/rke2/pull/<MASTER_PR_NUMBER>"
      

正文来自原始仓库, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

原始仓库

作者的项目地址:https://github.com/manuelbuil/PoCs

标签

没有标签

同类 Skill