Harden-Runner 开源项目使用教程

Harden-Runner 开源项目使用教程

harden-runner Network egress filtering and runtime security for GitHub-hosted and self-hosted runners harden-runner 项目地址: https://gitcode.com/gh_mirrors/ha/harden-runner

1. 项目介绍

Harden-Runner 是一个用于 GitHub-hosted 和 self-hosted runners 的网络出口过滤和运行时安全工具。它通过强化运行器来增强 GitHub Actions 工作流的运行时安全性。Harden-Runner 的主要功能包括监控和过滤出站网络流量、检测源代码篡改、监控文件和进程活动等。

2. 项目快速启动

2.1 安装步骤

首先,将 Harden-Runner GitHub Action 添加到你的 GitHub Actions 工作流文件中。以下是一个示例配置:

name: Example Workflow
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: step-security/harden-runner@v2.10.0
        with:
          egress-policy: audit
      - run: echo "Hello, World!"

2.2 配置说明

  • uses: step-security/harden-runner@v2.10.0: 使用 Harden-Runner 的最新版本。
  • egress-policy: audit: 设置为审计模式,记录所有出站网络流量。

2.3 查看日志

在 GitHub Actions 的日志中,你可以看到 Harden-Runner 生成的安全洞察和建议链接。点击链接可以查看详细的网络和文件事件监控报告。

3. 应用案例和最佳实践

3.1 案例研究

  • Google 开源项目 Flank: Harden-Runner 成功检测到 Google 开源项目 Flank 中的供应链攻击。
  • Kapiche: Kapiche 使用 Harden-Runner 强化其 GitHub Actions 软件供应链安全。
  • Arcjet: Arcjet 通过 Harden-Runner 增强了其 CI/CD 安全性。

3.2 最佳实践

  • 监控网络流量: 使用 Harden-Runner 监控和过滤出站网络流量,防止代码和 CI/CD 凭证的泄露。
  • 检测源代码篡改: 通过 Harden-Runner 检测源代码是否在构建过程中被篡改,防止后门注入。
  • 最小权限原则: 使用 Harden-Runner 确定并设置最小的 GITHUB_TOKEN 权限,减少泄露风险。

4. 典型生态项目

4.1 GitHub Actions Runner Controller (ARC)

ARC 是一个 Kubernetes 操作符,用于编排 GitHub Actions 的自托管运行器。Harden-Runner 可以与 ARC 结合使用,通过安装 ARC Harden-Runner daemonset 来监控所有在 Kubernetes 集群上运行的作业。

4.2 自托管 VM 运行器

对于在 EC2 等虚拟机上运行的自托管运行器,可以通过安装 Harden-Runner 代理来监控所有在 VM 上运行的作业。Harden-Runner 支持临时和持久运行器。

通过以上步骤,你可以快速上手并安全地使用 Harden-Runner 来强化你的 GitHub Actions 工作流。

harden-runner Network egress filtering and runtime security for GitHub-hosted and self-hosted runners harden-runner 项目地址: https://gitcode.com/gh_mirrors/ha/harden-runner

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

牧桔好Victor

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值