Skip to content
This repository was archived by the owner on Nov 2, 2023. It is now read-only.

Commit 16158a6

Browse files
author
Julio Guerra
authored
v0.11.0
New Features - (#119) RASP: add Shell Injection protection support. This protection is currently dynamically applied to `os.StartProcess()` which is the only entry point of the Go standard library to execute a process. This protection can be configured at https://my.sqreen.com/application/goto/modules/rasp/details/shi. - (#119) RASP: add Local File Inclusion protection support. This protection is currently dynamically applied to `os.Open()` which is the only entry point of the Go standard library to open a file for reading. This protection can be configured at https://my.sqreen.com/application/goto/modules/rasp/details/lfi. - (#120) RASP: add Server-Side Request Forgery protection support. This protection is currently dynamically applied to `net/http.(*Client).do()` which is the only entry point of the Go standard library to perform an HTTP request. This protection can be configured at https://my.sqreen.com/application/goto/modules/rasp/details/ssrf. - (#125) RASP: enable SQL Injection protection for every MySQL, Oracle, SQLite and PostgreSQL drivers listed in the Go language wiki page https://github.com/golang/go/wiki/SQLDrivers. - (#115) RASP: store Sqreen's request protection context into the Goroutine Local Storage (GLS). Therefore, Sqreen can now protect every Go function without requiring the request Go context (eg. both `QueryContext()` and `Query()` can be now protected against SQL injections). For now, this protection context is only available in the goroutine handling the request, and sub-goroutines are not protected. Further support will be added very soon to remove this limitation. - (#121) Add IP denylist support: block every request performed by an IP address of the denylist. Every usage of whitelist and blacklist in the agent was also removed when possible. The IP denylist can be configured at https://my.sqreen.com/application/goto/settings/denylist. - (#122) Add path passlist support: requests performed on those paths are not monitored nor protected by Sqreen. The Path passlist can be configured at https://my.sqreen.com/application/goto/settings/passlist. - (#123) Export the error type returned by Sqreen protections when blocking in the new SDK package `github.com/sqreen/go-agent/sdk/types` in order to avoid retrying blocked function calls (eg. avoid retrying a blocked SQL query). It must be used along with `errors.As()` to detect such cases. Read more at https://godoc.org/github.com/sqreen/go-agent/sdk/types. - (#124) Allow to "quickly" remove the agent from a program by only removing it from the source code without disabling the program instrumentation. This is made possible by making the instrumentation fully autonomous to avoid compilation errors. Fixes - Gin Middleware: fix the HTTP status code monitoring that was possibly changed by Gin after having been already written. Internal Changes - (#126) Cache request value lookups, mainly to accelerate the In-App WAF when lots of rulesets are enabled. - (#117) Simpler Go vendoring support implementation. - (#113) Significant JavaScript performance improvements by changing the virtual machine to `github.com/dop251/goja`. - (#114) Add Goroutine Local Storage (GLS) support through static instrumentation of the Go runtime.
2 parents 7b13f78 + 75fb3b4 commit 16158a6

File tree

236 files changed

+3424
-53975
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+3424
-53975
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Example App Builds
2+
on:
3+
push:
4+
pull_request:
5+
schedule:
6+
- cron: "0 0 * * *"
7+
jobs:
8+
docker:
9+
name: Docker Examples
10+
strategy:
11+
matrix:
12+
example: [ alpine, debian, scratch ]
13+
go-version: [ rc, 1.14, 1.13, 1.12]
14+
do-vendoring: [ true, false ]
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Setup go
19+
uses: actions/setup-go@v2
20+
if: ${{ matrix.do-vendoring }}
21+
- run: go mod vendor
22+
name: Vendor the dependencies
23+
if: ${{ matrix.do-vendoring }}
24+
- run: docker build -f ${{ matrix.example }}/Dockerfile -t hello-sqreen:${{ matrix.example }} --build-arg GO_VERSION=${{ matrix.go-version }} .
25+
working-directory: examples/docker

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
# v0.11.0
2+
3+
## New Features
4+
5+
- (#119) RASP: add Shell Injection protection support. This protection is currently dynamically applied to `os.StartProcess()` which is the only entry point of the Go standard library to execute a process. This protection can be configured at https://my.sqreen.com/application/goto/modules/rasp/details/shi.
6+
7+
- (#119) RASP: add Local File Inclusion protection support. This protection is currently dynamically applied to `os.Open()` which is the only entry point of the Go standard library to open a file for reading. This protection can be configured at https://my.sqreen.com/application/goto/modules/rasp/details/lfi.
8+
9+
- (#120) RASP: add Server-Side Request Forgery protection support. This protection is currently dynamically applied to `net/http.(*Client).do()` which is the only entry point of the Go standard library to perform an HTTP request. This protection can be configured at https://my.sqreen.com/application/goto/modules/rasp/details/ssrf.
10+
11+
- (#125) RASP: enable SQL Injection protection for every MySQL, Oracle, SQLite and PostgreSQL drivers listed in the Go language wiki page https://github.com/golang/go/wiki/SQLDrivers.
12+
13+
- (#115) RASP: store Sqreen's request protection context into the Goroutine Local Storage (GLS). Therefore, Sqreen can now protect every Go function without requiring the request Go context (eg. both `QueryContext()` and `Query()` can be now protected against SQL injections). For now, this protection context is only available in the goroutine handling the request, and sub-goroutines are not protected. Further support will be added very soon to remove this limitation.
14+
15+
- (#121) Add IP denylist support: block every request performed by an IP address of the denylist. Every usage of whitelist and blacklist in the agent was also removed when possible. The IP denylist can be configured at https://my.sqreen.com/application/goto/settings/denylist.
16+
17+
- (#122) Add path passlist support: requests performed on those paths are not monitored nor protected by Sqreen. The Path passlist can be configured at https://my.sqreen.com/application/goto/settings/passlist.
18+
19+
- (#123) Export the error type returned by Sqreen protections when blocking in the new SDK package `github.com/sqreen/go-agent/sdk/types` in order to avoid retrying blocked function calls (eg. avoid retrying a blocked SQL query). It must be used along with `errors.As()` to detect such cases. Read more at https://godoc.org/github.com/sqreen/go-agent/sdk/types.
20+
21+
- (#124) Allow to "quickly" remove the agent from a program by only removing it from the source code without disabling the program instrumentation. This is made possible by making the instrumentation fully autonomous to avoid compilation errors.
22+
23+
## Fix
24+
25+
- Gin Middleware: fix the HTTP status code monitoring that was possibly changed by Gin after having been already written.
26+
27+
## Internal Changes
28+
29+
- (#126) Cache request value lookups, mainly to accelerate the In-App WAF when lots of rulesets are enabled.
30+
31+
- (#117) Simpler Go vendoring support implementation.
32+
33+
- (#113) Significant JavaScript performance improvements by changing the virtual machine to `github.com/dop251/goja`.
34+
35+
- (#114) Add Goroutine Local Storage (GLS) support through static instrumentation of the Go runtime.
36+
37+
138
# v0.10.1
239

340
## Fix

azure-pipelines.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
schedules:
2+
# Nightly run
3+
- cron: "0 0 * * *"
4+
displayName: Daily midnight run
5+
always: true
6+
branches:
7+
include:
8+
- master
9+
110
trigger:
211
- master
312
- dev
@@ -41,11 +50,23 @@ jobs:
4150
inputs:
4251
version: $(GOVERSION)
4352
- task: Go@0
53+
displayName: Build gotestsum
54+
name: build_gotestsum
55+
inputs:
56+
command: 'build'
57+
arguments: '-v gotest.tools/gotestsum'
58+
- bash: |
59+
go env
60+
go build -v gotest.tools/gotestsum
61+
./gotestsum --junitfile report.xml ./...
62+
name: go_test
4463
displayName: go test
45-
continueOnError: true
64+
- task: PublishTestResults@2
65+
condition: succeededOrFailed()
4666
inputs:
47-
command: 'test'
48-
arguments: '-v ./...'
67+
testRunner: JUnit
68+
testResultsFiles: $(System.DefaultWorkingDirectory)/**/report.xml
69+
platform: windows
4970

5071
- job: MacOS
5172
pool:
@@ -54,11 +75,13 @@ jobs:
5475
- script: |
5576
go env
5677
clang -v
57-
go build -v github.com/jstemmer/go-junit-report
58-
go test -v ./... 2>&1 | ./go-junit-report > report.xml
78+
go build -v gotest.tools/gotestsum
79+
./gotestsum --junitfile report.xml ./...
5980
name: go_test
6081
displayName: go test
6182
- task: PublishTestResults@2
83+
condition: succeededOrFailed()
6284
inputs:
6385
testRunner: JUnit
6486
testResultsFiles: $(System.DefaultWorkingDirectory)/**/report.xml
87+
platform: macos

examples/docker/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected by Sqreen.
2323
Build the docker image and tag it with the image name `hello-sqreen` by doing:
2424

2525
```console
26-
examples/docker $ docker build -t hello-sqreen:debian -f debian/Dockerfile .
26+
examples/docker $ docker build -t hello-sqreen -f debian/Dockerfile .
2727
```
2828

2929
#### Building the Alpine docker image example
@@ -47,7 +47,7 @@ by Sqreen.
4747
Build the docker image and tag it with the image name `hello-sqreen` by doing:
4848

4949
```console
50-
examples/docker $ docker build -t hello-sqreen -f alpine/Dockerfile .
50+
examples/docker $ docker build -t hello-sqreen -f scratch/Dockerfile .
5151
```
5252

5353
### Running the docker image

examples/docker/alpine/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# creating a final alpine docker image.
33

44
# Build docker image
5-
FROM golang:1 AS build
5+
ARG GO_VERSION=1
6+
FROM golang:$GO_VERSION AS build
67
# Workdir out of the GOPATH to enable the Go modules mode.
78
WORKDIR /app
89
COPY . .

examples/docker/debian/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# creating a final debian docker image.
33

44
# Build docker image
5-
FROM golang:1 AS build
5+
ARG GO_VERSION=1
6+
FROM golang:$GO_VERSION AS build
67
# Workdir out of the GOPATH to enable the Go modules mode.
78
WORKDIR /app
89
COPY . .

examples/docker/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module sqreen-hello-http
22

33
go 1.12
44

5-
require github.com/sqreen/go-agent v0.9.3
5+
require github.com/sqreen/go-agent latest

examples/docker/scratch/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# image is absolutely empty and more files need to be copied in that case.
44

55
# Build docker image
6-
FROM golang:1 AS build
6+
ARG GO_VERSION=1
7+
FROM golang:$GO_VERSION AS build
78
# Workdir out of the GOPATH to enable the Go modules mode.
89
WORKDIR /app
910
COPY . .
@@ -18,7 +19,7 @@ RUN go build -v -a -toolexec $PWD/sqreen-instrumentation-tool -o hello-sqreen .
1819
# Now prepare a directory with the shared libraries the compiled program file
1920
# requires by using ldd:
2021
# 1. Install binutils for ldd
21-
RUN apt update && apt install binutils ca-certificates
22+
RUN apt update && apt install -y binutils ca-certificates
2223
# 2. Use ldd to list the shared libraries and copy them into deps/
2324
RUN ldd hello-sqreen | tr -s '[:blank:]' '\n' | grep '^/' | \
2425
xargs -I % sh -c 'mkdir -p $(dirname deps%); cp % deps%;'

examples/gcp-app-engine/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module sqreen-hello-http
22

33
go 1.12
44

5-
require github.com/sqreen/go-agent v0.9.3
5+
require github.com/sqreen/go-agent latest

examples/heroku/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module sqreen-hello-http
22

33
go 1.12
44

5-
require github.com/sqreen/go-agent v0.9.3
5+
require github.com/sqreen/go-agent latest

0 commit comments

Comments
 (0)