Beruflich Dokumente
Kultur Dokumente
Seminar Report
Submitted by
Certificate
This is to certify that the Seminar Report titled (“Green SQL“) submitted by Mr.Karan
Krishna Dahiwale of 5 thSemester towards the partial fulfillment of requirement for t he
award of Diploma in Information Technologyawarded by Government Polytechnic,
Nagpur, is approved.
(Mr.LD Vilhekar)
Guide
Date:
Place: Nagpur.
Page 3 of 16
ABSTRACT
There are many devices and services that are under constant attack in today’s business
environments. Popular vectors for attack include browsers and smartphones, but the goal of an
attack is not the device, service or application. Attackers exploit weaknesses in devices and
services in order to get to important business information which is stored in a database. Thus it
is essential that businesses protect critical information stored in databases.
GreenSQL provides database security that prevents SQL injection attacks, monitors
database activity, protects systems behind a database firewall and applies dynamic data
masking. The software began as an open source project in 2007; by 2009 it had become so
popular that the founders got serious and rewrote the code base to be production ready. It has
been downloaded over 130,000 times, and there are currently over 200 paying customers
worldwide
Page 4 of 16
CONTENTS
1. Introduction.
1.1 History of GreenSQL.
1.2 SQL Injection.
1.3 GreenSQL Architecture.
2. Getting Started.
2.1 Requirements.
2.2 SupportedDatabaseServers
2.3 GreenSQL Common Functions
3. GreenSQLAdvantages.
4. Policies.
5. Conclusion.
6. Reference.
Page 5 of 16
List of figures
1. Introduction
Overview.
About GreenSQL
What is GreenSQL?
• Management console
• Legitimate Query:SELECT * from users where username = ‘Alice’ and password = ‘123456’
• Injected SQL code: SELECT * from users where username = ‘Alice’ and password = ‘123456’
or ‘1’=‘1
• Read files
• Write Files
Demo: Attack
• Find directory with write permissions – templates_c / templates / temp – images / files / cache.
– system() function
– $_GET['cmd']
– $_POST['cmd']
Page 9 of 16
GreenSQL Architecture.
GreenSQL works as a reverse proxy for MySQL connections. This means, that instead of
connecting TO THE MySQL server, your applications will connect to THE GreenSQL server.
GreenSQL will analyze SQL queries and then, if they're safe, will forward them to the back-end
MySQL server. The following picture describes the whole process.
As you can see, GreenSQL calls the real database server to execute SQL commands and
the web application connects to the GreenSQL server as if it were a real database server.
GreenSQL can be installed together with the database server on the same computer or it can use a
distinct server. By defaultGreenSQL listens on local port 127.0.0.1:3305 redirecting SQL
requests to 127.0.0.1:3306 (the default MySQL setting). These settings can be altered using the
GreenSQL Console.
Page 10 of 16
2.Getting Started
2.1 Requirements.
To ensure GreenSQL operates properly, the following minimum system requirements
must be met:
Operating Systems:
BUTTON DESCRIPTION
Toggle for hiding/displaying the Functions Bar.
View:Per Database
Enables you to create a new item as required.
Cancels action
3. GreenSQL Advantages
Easy Management
Open Source
Cross Platform
Rapid Deployment
Well established
4.Policies
This chapter describes the policy feature, the core of GreenSQL’s ability to
provide constant protection to databases. GreenSQL enables organizations to define their own
security policy using the GreenSQL Policy function. Should there be a breach of policy, you may
elect to be immediately alerted (See: ). The system will respond to a breach in the manner
defined by the relevant enacted policy. GreenSQL Policy has an automated Learning Mode
which learns and builds policies, according to the specific usage of each database. You can
accept or reject the rules custom made for you. Learning Mode dramatically reduces the
operational overhead required to implement a secure and reliable policy for all access to your
database. Similarly, you can manually configure policies and create custom rules by creating
Query Groups which consist of patterns to be monitored, allowed or blocked. You can also apply
an Intrusion Prevention System (IPS) or Intrusion Detection System (IDS) policy based on a risk
profile, anomaly detection and preconfigured signature detection.
Database Firewall – Enables you to create custom rules by specifying the type of the
rule (Query Groups or Table Based), source IP address(es), database user(s),
application name(s), schedule and patterns or conditions where a query will be
blocked, allowed or monitored. You can also enable or disable caching per policy.
Risk Based – IPS/IDS – Monitors or blocks SQL injection attacks and/or queries
according to preconfigured a risk profile (See: Risk Profiles). If the IDS policy is
selected, GreenSQL will monitor queries detected as intrusions. If the IPS policy is
selected, GreenSQL will block queries detected as intrusions.
Page 15 of 16
5.Conclusion
SQL and code injection are some of the most critical vulnerabilities in web applications .
GreenSQL gives administrators a tool that is especially useful for protecting mission-critical web
applications that (still) have not been intensely scrutinized for vulnerabilities.
GreenSQL is available in a number of variants. Even the Express version provides good
basic protection, which is sufficient to protect a company blog or moderately busy shop. The
commercial versions offer additional features, such as alerts and reports, keep an eye on who
connects to a database, and conceal privileged information.
The GreenSQL security solution is easy to install and put into operation within a short
time. Extensive documentation helps if something is unclear. The ability to learn queries
automatically saves administrators much work and prevents them from forgetting important
requests later on. This minimizes trouble and complaints from users at very early stages. The
developers have ensured from the outset that only users from the associated network can connect
to the GreenSQL server. It is possible to restrict GreenSQL, without further firewall rules, to a
single IP address or localhost. Certificates help to verify the authenticity of the server.
Although GreenSQL cannot protect against all the uncertainties of the World Wide Web,
it is a useful security solution that can put an end to attacks at the database level and
meaningfully supplement other security measures in the enterprise.
Page 16 of 16
6.0 Bibliography:
[1] Justin Clarke, SQL Injection Attacks and Defense, Second Edition, Syngress Publication, July
2, 2012,ISBN-13: 978-1597494243
[2] GreenSQL Available: http://www.greensql.net/
[3] GreenSQL Available: http://www.howtoforge.com/preventing-mysqlinjection-attacks-with-
greensql-on-debian-etch
[4] GreenSQL Available: http://www.greensql.com/docs
[5] GreenSQL Available: http://www.greensql.com/support/knowledge
[6] GreenSQL Available: http://www.greensql.com/whygreensql-db-security/top-10-reasons
[7] GreenSQL Available: http://community.spiceworks.com/topic/212598- database-firewall-
greensql[8] GreenSQL Available: http://www.techrepublic.com/blog/opensource/firewallmysql-
with-greensql/317
[9] GreenSQL Available: http://opensourcedba.wordpress.com/2012/03/26/databas e-firewalls-
from-oracle-and-greensql/.