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
SQL database drivers used with database/sql golang core : GitHub - go-sql-driver/mysql: Go MySQL Driver is a MySQL driver for Go's (golang) database/sql package
GitHub - mattn/go-sqlite3: sqlite3 driver for go using database/sql
Otto - Javascript interpreter
GitHub - robertkrimen/otto: A JavaScript interpreter in Go (golang)
k2secure_otto
Supported Frameworks
Framework
Supported
Remark
Supported
lightweight, idiomatic and composable router for building Go HTTP services 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.
K2 Platform is offered as SaaS software and can be used directly visiting SaaS portal i.e. https://k2io.net or if you are an AWS customer then you can buy subscription to K2 SaaS portal on AWS Marketplace.
K2 Portal As SaaSK2 Platform is also offered as On-Premises based solution and can be deployed directory on your local infrastructure or if you are an AWS customer then you can subscribe to K2Cloud AMI and deploy K2 On-Premises portal on AWS.
For more details
K2 Portal On-PremisesStep 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/EC2Checkout our K2 Agents Installation Page for Kubernetes
KubernetesCheckout our K2 Agents Installation Page for AWS ECS/Fargate
AWS ECS/FargateCheckout our K2 Agents Installation Page for AWS EKS
AWS EKSCheckout our K2 Agents Installation Page for Windows
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/EC2Step 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 ExploitsLast updated
Was this helpful?