Protect Go Application

Instructions to protect Go application with K2 Platform

Overview

In this section, we outline the steps for protecting your first Go application with the K2 Platform.

Prerequisites

Core Features: SQLI, FILE_ACCESS, CMDI, SSRF,NOSQLI(mongo),JS,XPATH,XSS,LDAP

Package-specific features(list of packages listed):

RCEval* (need to find evaluate package),XXE(golang clients don't support execution)

GRPC support.

Packages

K2 imports needed

Supported

& Tested versions

K2 releases

golang core

net os system database/sql

k2secure

1.14 1.15 1.16

k2secure_mongo

syscall/JS = Javascript WASM

(experimental in GoLang)

https://golang.org/pkg/syscall/js/

Supported Frameworks

Framework

Supported

Remark

Supported

Used net/http hooks

Supported

Used net/http hooks

Supported

Used net/http hooks

Supported

Used net/http hooks

Not Supposed

Supported

A powerful HTTP router and URL matcher for building Go web servers Not a web server

Not Supposed

Build over fasthttp

Supported

A high performance HTTP request router that scales well

Not a web server

Supported

Used net/http hooks

Supported

No longer maintained Classy web framework for Go

Supported

lightweight, idiomatic and composable router for building Go HTTP services Not a web server

Supported

Rapid Web Development w/ Go Not a web server

Steps

Step 1 : K2 Portal and Account Creation

We need to make sure In order to use K2 Platform You need to create an account on K2 Portal.

K2 Portal can be used as SaaS model or you can deploy entire portal on your On-Premises.

At this point you have successfully created an account with K2 Portal

Step 2 : K2 Agents Installation

Install K2 Agent in your environment to perform CVE Scan and Vulnerability Detection in your applications.

Choose the environment from tabs below and follow the instructions for agent installation.

Checkout our K2 Agents Installation Page for Node/VM/EC2

Node/VM/EC2

Step 3 : Protect Go Web Application

‌To protect your Go web applications and APIs, your application must be started with K2's Go Language Agent.

Please choose your environment and go through K2's Go language agent installation from below tabs and follow instructions

Check out our Go Language Agent Installation Page for Node/VM/EC2

Node/VM/EC2

Step 4 : Attacking and Preventing first Attack

For demonstration purposes we are creating a docker container with vulnerable application and running it with our already downloaded K2 Go language agent.

SQL Injection Attack

Now you can go to Attacks section in K2 Manager and see there will be one attack captured by K2 Manager or Alternatively go to Attacks | K2 Portal.

Congratulations you've successfully prevented SQL injection attack.

What Next ?

if you are interested in looking at various genres of attacks prevented by K2 platform, Checkout below page

Run Demo Exploits

Last updated

Was this helpful?