traefik_github_actions_ip_whitelist_plugin

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

README

Traefik Github Actions IP Whitelist Plugin

pre-commit

A middleware plugin for Traefik that whitelists TCP connections from Github Actions or other specified addresses. The Github Actions addresses are automatically retrieved from the Gitbub Meta information endpoint .

Configuration

testData:
  additionalCIDRs:
    - 13.67.144.0/21
    - 13.67.152.0/24
    - 13.67.153.0/28
  • additionalCIDRs additional CIDRs to be added in the whitelist
Example configuration
  • Static configuration
pilot:
  token: <token>

experimental:
  plugins:
    github-actions-ip-whitelist:
      moduleName: github.com/vaspapadopoulos/traefik-github-actions-ip-whitelist-plugin
      version: v0.1.0
  • Dynamic configuration
tcp:
  routers:
    my-service.com:
      service: my-service
      middlewares:
        - githubActionsIpWhitelist
  middlewares:
    githubActionsIpWhitelist:
      plugin:
        github-actions-ip-whitelist:
          additionalCIDRs:
            - 13.67.144.0/21
            - 13.67.152.0/24
            - 13.67.153.0/28
  services:
    my-service:
      loadBalancer:
        servers:
          - url: <url>

Documentation

Overview

Package traefik_github_actions_ip_whitelist_plugin Traefik Github Actions IP Whitelist Plugin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AdditionalCIDRs []string
}

Config the plugin configuration.

func CreateConfig

func CreateConfig() *Config

CreateConfig creates the default plugin configuration.

type GithubActionWhitelist

type GithubActionWhitelist struct {
	// contains filtered or unexported fields
}

GithubActionWhitelist a Github Action IP Whitelist plugin.

func (*GithubActionWhitelist) ServeTCP

func (wl *GithubActionWhitelist) ServeTCP(conn TcpWriteCloser)

type GithubMetaResponse

type GithubMetaResponse struct {
	Actions []string `json:"enabled,omitempty"`
}

type TcpHandler

type TcpHandler interface {
	ServeTCP(conn TcpWriteCloser)
}

TcpHandler is the TCP Handlers interface.

func New

func New(ctx context.Context, next TcpHandler, config *Config, name string) (TcpHandler, error)

New creates a new Github Action IP Whitelist plugin.

type TcpWriteCloser

type TcpWriteCloser interface {
	net.Conn
	// CloseWrite on a network connection, indicates that the issuer of the call
	// has terminated sending on that connection.
	// It corresponds to sending a FIN packet.
	CloseWrite() error
}

TcpWriteCloser describes a net.Conn with a CloseWrite method.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL