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

refactor: mod rename #73

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/kitabisa/teler-proxy/discussions
url: https://github.com/teler-sh/teler-proxy/discussions
about: Ask questions and discuss with other community members
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ labels: 'documentation'
<!--
To make it easier for us to help you, please include as much useful information as possible.

Before opening a new issue, please search existing issues https://github.com/kitabisa/teler-proxy/issues
Before opening a new issue, please search existing issues https://github.com/teler-sh/teler-proxy/issues
-->

## Summary
Expand Down
20 changes: 10 additions & 10 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ builds:
- -trimpath
- -pgo={{ .Env.PGO_FILE }}
ldflags:
- -s -w -X github.com/kitabisa/{{ .ProjectName }}/common.Version={{ .Version }}
- -s -w -X github.com/teler-sh/{{ .ProjectName }}/common.Version={{ .Version }}

- id: "{{ .ProjectName }}_darwin-arm64"
binary: "{{ .ProjectName }}"
Expand All @@ -40,7 +40,7 @@ builds:
- -trimpath
- -pgo={{ .Env.PGO_FILE }}
ldflags:
- -s -w -X github.com/kitabisa/{{ .ProjectName }}/common.Version={{ .Version }}
- -s -w -X github.com/teler-sh/{{ .ProjectName }}/common.Version={{ .Version }}

- id: "{{ .ProjectName }}_linux-amd64"
binary: "{{ .ProjectName }}"
Expand All @@ -56,7 +56,7 @@ builds:
- -trimpath
- -pgo={{ .Env.PGO_FILE }}
ldflags:
- -s -w -X github.com/kitabisa/{{ .ProjectName }}/common.Version={{ .Version }}
- -s -w -X github.com/teler-sh/{{ .ProjectName }}/common.Version={{ .Version }}

- id: "{{ .ProjectName }}_linux-arm64"
binary: "{{ .ProjectName }}"
Expand All @@ -72,7 +72,7 @@ builds:
- -trimpath
- -pgo={{ .Env.PGO_FILE }}
ldflags:
- -s -w -X github.com/kitabisa/{{ .ProjectName }}/common.Version={{ .Version }}
- -s -w -X github.com/teler-sh/{{ .ProjectName }}/common.Version={{ .Version }}

- id: "{{ .ProjectName }}_windows-amd64"
binary: "{{ .ProjectName }}"
Expand All @@ -89,7 +89,7 @@ builds:
- -pgo={{ .Env.PGO_FILE }}
- -buildmode=exe
ldflags:
- -s -w -X github.com/kitabisa/{{ .ProjectName }}/common.Version={{ .Version }}
- -s -w -X github.com/teler-sh/{{ .ProjectName }}/common.Version={{ .Version }}

archives:
- id: build
Expand Down Expand Up @@ -117,10 +117,10 @@ changelog:

dockers:
- image_templates:
- "ghcr.io/kitabisa/{{ .ProjectName }}:{{ .Tag }}"
- "ghcr.io/kitabisa/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}"
- "ghcr.io/kitabisa/{{ .ProjectName }}:v{{ .Major }}"
- "ghcr.io/kitabisa/{{ .ProjectName }}:latest"
- "ghcr.io/teler-sh/{{ .ProjectName }}:{{ .Tag }}"
- "ghcr.io/teler-sh/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}"
- "ghcr.io/teler-sh/{{ .ProjectName }}:v{{ .Major }}"
- "ghcr.io/teler-sh/{{ .ProjectName }}:latest"
dockerfile: Dockerfile.goreleaser
use: docker
build_flag_templates:
Expand All @@ -132,5 +132,5 @@ dockers:
- "--label=org.opencontainers.image.ref.name={{ .Tag }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.url=https://github.com/kitabisa/{{ .ProjectName }}"
- "--label=org.opencontainers.image.url=https://github.com/teler-sh/{{ .ProjectName }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
FROM golang:alpine

ARG VERSION="docker"
ARG LDFLAGS="-s -w -X github.com/kitabisa/teler-proxy/common.Version=${VERSION}"
ARG LDFLAGS="-s -w -X github.com/teler-sh/teler-proxy/common.Version=${VERSION}"
ARG PGO_FILE="default.pgo"

LABEL org.opencontainers.image.authors="Dwi Siswanto <me@dw1.io>"
LABEL org.opencontainers.image.description="teler Proxy enabling seamless integration with teler WAF to protect locally running web service against a variety of web-based attacks"
LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL org.opencontainers.image.ref.name="${VERSION}"
LABEL org.opencontainers.image.title="teler-proxy"
LABEL org.opencontainers.image.url="https://github.com/kitabisa/teler-proxy"
LABEL org.opencontainers.image.url="https://github.com/teler-sh/teler-proxy"
LABEL org.opencontainers.image.version="${VERSION}"

WORKDIR /app
Expand Down
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
APP_NAME = teler-proxy
VERSION = $(shell git describe --always --tags)

GO_LDFLAGS = "-s -w -X 'github.com/kitabisa/teler-proxy/common.Version=${VERSION}'"
GO_MOD_VERSION := $(shell grep -Po '^go \K([0-9]+\.[0-9]+(\.[0-9]+)?)$$' go.mod)
GO := go${GO_MOD_VERSION}
GO_LDFLAGS = "-s -w -X 'github.com/teler-sh/teler-proxy/common.Version=${VERSION}'"

ifeq ($(shell which ${GO}),)
GO = go
endif

vet:
go vet ./...
$(GO) vet ./...

lint:
golangci-lint run --tests=false ./...
Expand All @@ -13,13 +19,13 @@ semgrep:
semgrep --config auto

bench:
go test ./pkg/tunnel/... -run "^$$" -bench . -cpu 4 -benchmem $(ARGS)
$(GO) test ./pkg/tunnel/... -run "^$$" -bench . -cpu 4 -benchmem $(ARGS)

cover: FILE := /tmp/teler-coverage.out # Define coverage file
cover: PKG := ./pkg/tunnel/...
cover:
go test -race -coverprofile=$(FILE) -covermode=atomic $(PKG)
go tool cover -func=$(FILE)
$(GO) test -race -coverprofile=$(FILE) -covermode=atomic $(PKG)
$(GO) tool cover -func=$(FILE)

pprof: ARGS := -cpuprofile=cpu.out -memprofile=mem.out -benchtime 30s
pprof: bench
Expand All @@ -29,7 +35,7 @@ pgo:
cp cpu.out default.pgo

test:
go test -race -v ./pkg/tunnel/...
$(GO) test -race -v ./pkg/tunnel/...

test-all: test vet lint semgrep

Expand Down
51 changes: 25 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
# teler Proxy

[![Kitabisa Security](https://img.shields.io/badge/kitabisa-security%20project-blue)](#)
[![codecov](https://codecov.io/github/kitabisa/teler-proxy/graph/badge.svg?token=QST60Y6BDD)](https://codecov.io/github/kitabisa/teler-proxy)
[![Tests](https://github.com/kitabisa/teler-proxy/actions/workflows/tests.yaml/badge.svg?branch=master)](https://github.com/kitabisa/teler-proxy/actions/workflows/tests.yaml)
[![Release](https://img.shields.io/github/v/release/kitabisa/teler-proxy?color=violet)](https://github.com/kitabisa/teler-proxy/releases)
[![codecov](https://codecov.io/gh/teler-sh/teler-proxy/graph/badge.svg?token=QST60Y6BDD)](https://codecov.io/gh/teler-sh/teler-proxy)
[![Tests](https://github.com/teler-sh/teler-proxy/actions/workflows/tests.yaml/badge.svg?branch=master)](https://github.com/teler-sh/teler-proxy/actions/workflows/tests.yaml)
[![Release](https://img.shields.io/github/v/release/teler-sh/teler-proxy?color=violet)](https://github.com/teler-sh/teler-proxy/releases)
[![Platform](https://img.shields.io/badge/platform-osx%2Flinux%2Fwindows-blueviolet)](#)

<img src="https://user-images.githubusercontent.com/25837540/97091757-7200d880-1668-11eb-82c4-e5c4971d2bc8.png" align="right" width="250px"/>

teler Proxy enabling seamless integration with [teler WAF](https://github.com/kitabisa/teler-waf) to protect locally running web service against a variety of web-based attacks, such as OWASP Top 10 categories like cross-site scripting (XSS) or SQL injection, known vulnerabilities or exploits, malicious actors, botnets, unwanted crawlers or scrapers, and directory bruteforce attacks.
teler Proxy enabling seamless integration with [teler WAF](https://github.com/teler-sh/teler-waf) to protect locally running web service against a variety of web-based attacks, such as OWASP Top 10 categories like cross-site scripting (XSS) or SQL injection, known vulnerabilities or exploits, malicious actors, botnets, unwanted crawlers or scrapers, and directory bruteforce attacks.

**See also:**

* [kitabisa/teler](https://github.com/kitabisa/teler): Real-time HTTP Intrusion Detection.
* [kitabisa/teler-waf](https://github.com/kitabisa/teler-waf): Go HTTP middleware that provides teler IDS functionality.
* [teler-sh/teler](https://github.com/teler-sh/teler): Real-time HTTP Intrusion Detection.
* [teler-sh/teler-waf](https://github.com/teler-sh/teler-waf): Go HTTP middleware that provides teler IDS functionality.

https://github.com/kitabisa/teler-proxy/assets/25837540/df36af09-080a-4cff-98d8-fd2071f602fa
https://github.com/teler-sh/teler-proxy/assets/25837540/df36af09-080a-4cff-98d8-fd2071f602fa

---

Expand Down Expand Up @@ -74,7 +73,7 @@ sequenceDiagram

### Binary

Simply, download a pre-built binary from [releases page](https://github.com/kitabisa/teler-proxy/releases). Unpack and run!
Simply, download a pre-built binary from [releases page](https://github.com/teler-sh/teler-proxy/releases). Unpack and run!

### Source

Expand All @@ -85,7 +84,7 @@ Simply, download a pre-built binary from [releases page](https://github.com/kita
Using [Go](https://golang.org/doc/install) (v1.20+) compiler:

```bash
CGO_ENABLED=1 go install github.com/kitabisa/teler-proxy/cmd/teler-proxy@latest
CGO_ENABLED=1 go install github.com/teler-sh/teler-proxy/cmd/teler-proxy@latest
```

### — or
Expand All @@ -96,21 +95,21 @@ Manual building executable from source code:
> The `master` branch contains the latest code changes and updates, which might not have undergone thorough testing and quality assurance - thus, you may encounter instability and unexpected behavior.

```bash
git clone https://github.com/kitabisa/teler-proxy.git
git clone https://github.com/teler-sh/teler-proxy.git
cd teler-proxy/
# git checkout [VERSION TAG]
make build
```

> [!TIP]
> If you're using Go version 1.20 or newer, you can build the executable file with our automatically generated default PGO<sup>[<a href="https://go.dev/doc/pgo">?</a>]</sup> profile _(see [pgo branch](https://github.com/kitabisa/teler-proxy/tree/pgo))_ to improve the performance by using `make build-pgo` command.
> If you're using Go version 1.20 or newer, you can build the executable file with our automatically generated default PGO<sup>[<a href="https://go.dev/doc/pgo">?</a>]</sup> profile _(see [pgo branch](https://github.com/teler-sh/teler-proxy/tree/pgo))_ to improve the performance by using `make build-pgo` command.

### Docker

Pull the [Docker](https://docs.docker.com/get-docker/) image by running:

```bash
docker pull ghcr.io/kitabisa/teler-proxy:latest
docker pull ghcr.io/teler-sh/teler-proxy:latest
```

## Usage
Expand All @@ -123,7 +122,7 @@ teler-proxy -d <ADDR>:<PORT> [OPTIONS...]

### Options

<img src="https://github.com/kitabisa/teler-proxy/assets/25837540/caed92a2-a88b-4708-aa5b-70dc49d84aee" width="50%">
<img src="https://github.com/teler-sh/teler-proxy/assets/25837540/caed92a2-a88b-4708-aa5b-70dc49d84aee" width="50%">

Here are all the options it supports.

Expand Down Expand Up @@ -199,9 +198,9 @@ By leveraging this versatile teler WAF configuration, you can fine-tune the WAF
### Excludes

> [!WARNING]
> Threat exclusions (`Excludes`) will be deprecated in the upcoming teler-waf release (**v2**), use [`Whitelists`](#whitelists) instead. See [teler-waf#73](https://github.com/kitabisa/teler-waf/discussions/73).
> Threat exclusions (`Excludes`) will be deprecated in the upcoming teler-waf release (**v2**), use [`Whitelists`](#whitelists) instead. See [teler-waf#73](https://github.com/teler-sh/teler-waf/discussions/73).

Excludes (**excludes**) is a list of threat types (`[]int`) to exclude from the security checks. Please refer to the [docs](https://pkg.go.dev/github.com/kitabisa/teler-waf/threat#Threat).
Excludes (**excludes**) is a list of threat types (`[]int`) to exclude from the security checks. Please refer to the [docs](https://pkg.go.dev/github.com/teler-sh/teler-waf/threat#Threat).

> **Note**
> * **1** for `CommonWebAttack`
Expand All @@ -213,23 +212,23 @@ Excludes (**excludes**) is a list of threat types (`[]int`) to exclude from the

### Whitelists

Whitelists (**whitelists**) is a list of DSL expressions (`[]string`) that match request elements that should be excluded from the security checks. Please refer to the [docs](https://github.com/kitabisa/teler-waf#dsl-expression).
Whitelists (**whitelists**) is a list of DSL expressions (`[]string`) that match request elements that should be excluded from the security checks. Please refer to the [docs](https://github.com/teler-sh/teler-waf#dsl-expression).

### Customs

Customs (**customs**) is a list of custom security rules (`[]teler.Rule`) to apply to incoming requests.

These rules can be used to create custom security checks or to override the default security checks provided by teler-waf. Please refer to the [docs](https://github.com/kitabisa/teler-waf#custom-rules).
These rules can be used to create custom security checks or to override the default security checks provided by teler-waf. Please refer to the [docs](https://github.com/teler-sh/teler-waf#custom-rules).

### Customs from File

Customs from file (**customs_from_file**) specifies the file path or glob pattern (`string`) for loading custom security rules. These rules can be used to create custom security checks or to override the default security checks provided by teler IDS.

The glob pattern supports wildcards, allowing you to specify multiple files or a directory with matching files. For example, "/path/to/custom/rules/\**/*.yaml" will load all YAML files in the "rules" directory and its subdirectories. Please refer to the [docs](https://github.com/kitabisa/teler-waf#custom-rules).
The glob pattern supports wildcards, allowing you to specify multiple files or a directory with matching files. For example, "/path/to/custom/rules/\**/*.yaml" will load all YAML files in the "rules" directory and its subdirectories. Please refer to the [docs](https://github.com/teler-sh/teler-waf#custom-rules).

### Custom Response

Response (**response**) is the configuration for custom error response pages when a request is blocked or rejected. Please refer to the [docs](https://github.com/kitabisa/teler-waf#custom-response).
Response (**response**) is the configuration for custom error response pages when a request is blocked or rejected. Please refer to the [docs](https://github.com/teler-sh/teler-waf#custom-response).

### Log File

Expand All @@ -245,23 +244,23 @@ When set to `true`, log messages will not be printed to stderr. If set to `false

No update check (**no_update_check**) is a boolean flag indicating whether or not to disable automatic threat dataset updates.

When set to `true`, automatic updates will be disabled. If set to `false`, automatic updates will be enabled. By default, automatic updates are enabled (`false`). Please refer to the [docs](https://github.com/kitabisa/teler-waf#datasets).
When set to `true`, automatic updates will be disabled. If set to `false`, automatic updates will be enabled. By default, automatic updates are enabled (`false`). Please refer to the [docs](https://github.com/teler-sh/teler-waf#datasets).

### Development

Development (**development**) is a boolean flag that determines whether the request is cached or not. By default, development mode is disabled (`false`) or requests will cached. Please refer to the [docs](https://github.com/kitabisa/teler-waf#development).
Development (**development**) is a boolean flag that determines whether the request is cached or not. By default, development mode is disabled (`false`) or requests will cached. Please refer to the [docs](https://github.com/teler-sh/teler-waf#development).

### In Memory

In memory (**in_memory**) is a boolean flag that specifies whether or not to load the threat dataset into memory on initialization.

When set to `true`, the threat dataset will be loaded into memory, which can be useful when running your service or application on a distroless or runtime image, where file access may be limited or slow. If `in_memory` is set to `false`, the threat dataset will be downloaded and stored under the user-level cache directory on the first startup. Subsequent startups will use the cached dataset. Please refer to the [docs](https://github.com/kitabisa/teler-waf#datasets).
When set to `true`, the threat dataset will be loaded into memory, which can be useful when running your service or application on a distroless or runtime image, where file access may be limited or slow. If `in_memory` is set to `false`, the threat dataset will be downloaded and stored under the user-level cache directory on the first startup. Subsequent startups will use the cached dataset. Please refer to the [docs](https://github.com/teler-sh/teler-waf#datasets).

### FalcoSidekick URL

FalcoSidekick URL (**falcosidekick_url**) is the URL of the FalcoSidekick endpoint to which teler-waf's events will be forwarded.

This field should be set to the URL of your FalcoSidekick instance, including the protocol & port (e.g. "http://localhost:2801"). Please refer to the [docs](https://github.com/kitabisa/teler-waf#falco-sidekick).
This field should be set to the URL of your FalcoSidekick instance, including the protocol & port (e.g. "http://localhost:2801"). Please refer to the [docs](https://github.com/teler-sh/teler-waf#falco-sidekick).

### Verbose

Expand All @@ -273,9 +272,9 @@ To experience the power of the teler WAF Proxy in action, simply follow these st

## Community

We use the Google Groups as our dedicated mailing list. Subscribe to [teler-announce](https://groups.google.com/g/teler-announce) via [teler-announce+subscribe@googlegroups.com](mailto:teler-announce+subscribe@googlegroups.com) for important announcements, such as the availability of new releases. This subscription will keep you informed about significant developments related to [teler IDS](https://github.com/kitabisa/teler), [teler WAF](https://github.com/kitabisa/teler-waf), [teler Proxy](https://github.com/kitabisa/teler-proxy), and [teler Resources](https://github.com/kitabisa/teler-resources).
We use the Google Groups as our dedicated mailing list. Subscribe to [teler-announce](https://groups.google.com/g/teler-announce) via [teler-announce+subscribe@googlegroups.com](mailto:teler-announce+subscribe@googlegroups.com) for important announcements, such as the availability of new releases. This subscription will keep you informed about significant developments related to [teler IDS](https://github.com/teler-sh/teler), [teler WAF](https://github.com/teler-sh/teler-waf), [teler Proxy](https://github.com/teler-sh/teler-proxy), and [teler Resources](https://github.com/teler-sh/teler-resources).

For any [inquiries](https://github.com/kitabisa/teler-proxy/discussions/categories/q-a), [discussions](https://github.com/kitabisa/teler-proxy/discussions), or [issues](https://github.com/kitabisa/teler-proxy/issues) are being tracked here on GitHub. This is where we actively manage and address these aspects of our community engagement.
For any [inquiries](https://github.com/teler-sh/teler-proxy/discussions/categories/q-a), [discussions](https://github.com/teler-sh/teler-proxy/discussions), or [issues](https://github.com/teler-sh/teler-proxy/issues) are being tracked here on GitHub. This is where we actively manage and address these aspects of our community engagement.

## License

Expand Down
2 changes: 1 addition & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
replicaCount: 1

image:
repository: ghcr.io/kitabisa/teler-proxy
repository: ghcr.io/teler-sh/teler-proxy
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
Expand Down
2 changes: 1 addition & 1 deletion cmd/teler-proxy/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "github.com/kitabisa/teler-proxy/internal/runner"
import "github.com/teler-sh/teler-proxy/internal/runner"

func main() {
opt := runner.ParseOptions()
Expand Down
Loading
Loading