NOC online · 24/7Longview, TX · +1 323 412 0665
KinetikatechServers · Security · Websites
KO

이 심층 가이드는 영어로 제공됩니다.

English version

Self-Hosted Open Source Infrastructure

Building an Autonomous CI/CD Pipeline Using Self-Hosted Gitea Actions and Hardened Runner Nodes

Gitea Actions brings GitHub Actions-compatible CI/CD to self-hosted Git. The risk is that workflow jobs run arbitrary code on your infrastructure. Hardened runners isolate jobs, restrict network access, and prevent credential leakage. This guide builds a secure pipeline.

핵심 내용

  • Use ephemeral runners. Each job gets a fresh environment, preventing state leakage between runs.
  • Isolate runner nodes. Run runners on dedicated hosts or VMs, not on production servers.
  • Restrict network access. Runners should reach only the registry and Git server, not the broader network.
  • Manage secrets carefully. Use Gitea's secret management and never print secrets in logs.
  • Pin action versions. Use commit SHAs instead of tags to prevent supply-chain attacks.
  • Limit job permissions. Grant the minimum token scopes needed for each workflow.
  • Monitor runner health. Track job duration, failure rates, and resource usage.
  • Clean up after jobs. Remove containers, caches, and temporary files after each run.

Architecture

Gitea hosts the repository and orchestrates workflows. Runner nodes poll for jobs, execute them in isolated containers, and report results. Network policies restrict runner access, and secret management prevents credential exposure.

Production configuration

Hardened workflow yaml
name: build
on: [push]
jobs:
  build:
    runs-on: self-hosted
    permissions:
      contents: read
    steps:
    - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
    - name: Build
      run: |
        set -euo pipefail
        docker build -t app:$GITHUB_SHA .
    - name: Scan
      run: trivy image app:$GITHUB_SHA
Runner isolation with Docker bash
# run runner in a container with restricted network
docker run -d --name gitea-runner \
  --network runner-net \
  --read-only \
  --tmpfs /tmp \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  gitea/act_runner:latest

# firewall rules for runner network
iptables -A FORWARD -s 10.0.1.0/24 -d 10.0.0.5 -p tcp --dport 3000 -j ACCEPT
iptables -A FORWARD -s 10.0.1.0/24 -j DROP
Verify runner security bash
gitea-runner --version
# check runner logs for secret leaks
grep -r 'GITEA_TOKEN\|SECRET' /var/log/gitea-runner/ || echo 'no leaks'
# audit workflow permissions
grep -r 'permissions:' .gitea/workflows/

Edge cases from production

  • Docker socket access gives runners root on the host; use rootless Docker or a separate daemon.
  • Ephemeral runners need fast provisioning; pre-pull images to reduce startup time.
  • Secrets in workflow files are visible to anyone with read access; use Gitea's secret store.
  • Runner nodes accumulate disk from caches; schedule cleanup jobs.

자주 묻는 질문

Is Gitea Actions compatible with GitHub Actions?

Most workflows port directly, but some GitHub-specific features are not supported.

How do I scale runners?

Add more runner nodes and use labels to route jobs to appropriate hardware.

Can I use Kubernetes runners?

Yes, Gitea supports Kubernetes-based runners for dynamic scaling.

How do I prevent secret leaks?

Use Gitea's secret management, mask secrets in logs, and audit workflows regularly.

What is the main risk?

Arbitrary code execution on your infrastructure; isolate runners and restrict network access.

self-hosted open source infrastructure에 대한 Kinetikatech의 지원

저희는 이것을 수백 번 처리했습니다: Running sovereign collaboration, storage, and identity stacks on hardware you control. 서버 관리 및 웹사이트 유지보수와 함께하면 평가, 구현, 24시간 연중무휴 모니터링, 그리고 중요한 때에 30분 이내 대응이라는 완전한 사이클을 제공합니다.

엔지니어와 상담하기

서버 문제? 해킹된 웹사이트? 느린 페이지?

심각한 장애에 30분 이내 대응 — 24시간, 주 7일.

긴급 지원 요청 support@kinetikatech.com