Protect Ruby Application
Instructions to protect Ruby application with K2 Platform
Overview
In this section, we outline the steps for protecting your first Ruby application with the K2 Platform.
Prerequisites
Language
Application Server
Frameworks
DBs
Attack Coverage
Deployments
Ruby Interpreter
Ruby 2.6
Puma
Passenger
Unicorn
Webrick
Rails version 6.0
Sinatra
SQLite 3
Mysql2
Mongo
PostgreSQL
Amazon Aurora (MySQL)
Amazon Aurora (Postgres SQL)
RCE
SQL Injection
File Access
File Integrity
SSRF
Xpath
LDAP
RCI
RXSS
Stored XSS
NoSqli (for Mongo only)
Host Mode
Container Mode
EKS
ECS
MRI
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 Ruby Web Application
To protect your Ruby web applications and APIs, your application must be started with K2's Ruby Language Agent.
Please choose your environment and go through K2's Ruby language agent installation from below tabs and follow instructions
Checkout our Ruby Language Agent Installation Page for Node/VM/EC2
Node/VM/EC2Checkout our Ruby Language Agent Installation Page for Kubernetes
KubernetesCheckout our Ruby Language Agent Installation Page for AWS ECS/EKS/Fargate
AWS ECS/EKS/FargateStep 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 Ruby 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?