Go agent release notes


v0.1.0-beta.5 - 23 May 2019

GitHub Release

New Features

  • Middleware functions for gRPC over HTTP2 (called interceptors). Details on https://godoc.org/github.com/sqreen/go-agent/sdk/middleware/sqgrpc (#23)

  • IP whitelist: support to make the agent completely ignore requests whose IP addresses match a whitelist entry. Everything related to Sqreen, including events, will be ignored for whitelisted requests. (#69)

  • Agent failsafe modes: the agent cannot stop the Go app by catching every internal error. It either tries to restart it or stop it. Panic-ing and stopping the host app is no longer an option. (#67)

Minor Changes

  • Internal event batch improvements:

    • Increased batch buffer capacity from 60 to 6000 entries in order to be able to handle more events, sent by batches of 60 events per heartbeat.

    • Remove the batch bookkeeping goroutine and include its logic into the main event processing loop.

v0.1.0-beta.4 - 16 April 2019

This release adds the ability to block IP addresses or users in your Go web services by adding support for security automation according to your playbooks and their configured security responses.

Note that redirecting users or IP addresses is not supported yet.

GitHub Release

New features

Security automation

It's now possible to block IP addresses or users. When a playbook triggers, it notifies the agent and provides the batch of security responses. They are asynchronously stored into data structures optimized for fast lookup and low memory usage. Middleware functions can thus perform fast lookups to block requests in a few microseconds to exit request handlers as fast as possible. Learn more in our security automation documentation.

Blocking IP addresses

You don't need to make any changes to continue blocking IP addresses. We have updated our middleware functions to block requests whose IP addresses match a security response. Sqreen aborts the request with HTTP status code 500 and Sqreen's default HTML information page.

Blocking users

Blocking users by combining SDK methods Identify() and MatchSecurityResponse() to firstly associate a user to the current request, and secondly to check if it matches a security response. When a security response matches, stop the request handler and any related goroutines as soon as possible.

Usage example:

uid := sdk.EventUserIdentifiersMap{"uid": "my-uid"}
sqUser := sdk.FromContext(ctx).ForUser(uid)
sqUser.Identify()
if match, err := sqUser.MatchSecurityResponse(); match {
  // Return now to stop further handling the request and let Sqreen's
  // middleware apply the configured security response and abort the
  // request. The returned error may help aborting from sub-functions by
  // returning it to the callers when the Go error handling pattern is
  // used.
  return err
}

We strongly recommend creating a user-authentication middleware function to seamlessly integrate user-blocking in all your user-authenticated endpoints.

Fix

  • Escape the event type name to avoid JSON marshaling error. Note that this case could not happen in previous agent versions. (#52)

Minor change

  • Avoid repeating commands within the same command batch. (51)

v0.1.0-beta.3 - 22 March 2019

GitHub Release

New Features

  • Get the client IP address out of the HAProxy header X-Unique-Id using the new configuration variable ip_header_format.

  • New configuration option strip_http_referer/SQREEN_STRIP_HTTP_REFERER allowing to avoid sending the Referer HTTP header to the Sqreen backend when it contains sensitive data.

  • Ability to disable/enable the agent through the dashboard settings using the Sqreen status button.

Breaking Changes

  • Agent internals are now under a private Go package and can no longer be imported. Any sub-package under github.com/sqreen/go-agent/agent was not supposed to be imported and is now private to avoid future confusions.

Fixes

  • Remove duplicate User-Agent entry sent twice in the request record.

  • Fix IPv4 and IPv6 matching against private network definitions.

  • Remove useless empty request records mistakenly created while not carrying any SDK observation.

Minor Changes

  • Better memory management and footprint when the agent is disabled by removing globals. This will be also required to be able to cleanly restart the agent by self-managing the initializations.

v0.1.0-beta.2 - 14 February 2019

GitHub Release

New feature

  • Add a new Identify() SDK method allowing to explicitly associate a user to the current request. As soon as we add the support for the security reponses, it will allow to block users.

v0.1.0-beta.1 - 7 February 2019

GitHub Release

This version is a new major version towards the v0.1.0 as it proposes a new andstable SDK API, that now will only be updated upon user feedback. So please, share your impressions with us.

New Features

  • New web framework middleware supports:
  • Standard Go's net/http package.
  • Echo.

  • Multiple custom events can now be easily associated to a user using the user-scoped methods under ForUser(). For example, to send two custom events for a given user, do:

sqUser := sqreen.ForUser(uid)
sqUser.TrackEvent("my.event.one")
sqUser.TrackEvent("my.event.two")
  • The configuration file can now be stored into multiple locations, the current working directory or the executable one, or enforced using the new configuration environment variable SQREEN_CONFIG_FILE.

  • The custom client IP header configured in SCREEN_IP_HEADER is now also sent to Sqreen so that it can better understand what IP headers were considered by the agent to determine what is the actual client IP address.

Breaking Changes

  • Stable SDK API of "Sqreen for Go":

  • Avoid name conflicts with framework packages by prefixing Sqreen's middleware packages with sq. For example, gin becomes sqgin.

  • Cleaner Go documentation now entirely included in the SDK and middleware packages Go documentations. So no more need to go inside the agent documentation to know more on some SDK methods, it is now all documented in the same place, with lot of examples.

  • Clearer SDK API: The flow of security events that can send to Sqreen is now well-defined by a tree of SDK methods that can only be used the right way.

    • The SDK handle getter function name is renamed from GetHTTPRequestContext() into a simpler FromContext().

    • User-related SDK methods are now provided by ForUser(), for example: sqreen.TrackAuth(true, uid) becomes sqreen.ForUser(uid).TrackAuthSuccess().

v0.1.0-alpha.5 - 24 January 2019

GitHub Release

New features

  • SDK:

    • Ability to associate a user to a single event using WithUserIdentifier().
    • Track user creations using TrackSignup().
    • Track user authentications using TrackAuth().
  • Agent:

    • Proxy configuration: take into account {HTTPS,HTTP,NO}_PROXY environment variables (and their lowercase alternatives).
    • Token: organization token support.

Fixes

  • agent/config: avoid conflicts with global viper configs.
  • sdk: better documentation with examples.