SlideShare a Scribd company logo
1 of 57
Download to read offline
Your host & some logistics
I'm Jean-Jérôme from the Severalnines Team and I'm
your host for today's webinar!
Feel free to ask any questions in the Questions section of
this application or via the Chat box.
You can also contact me directly via the chat box or via
email: jj@severalnines.com during or after the webinar.
About Severalnines and ClusterControl
What we do
Manage Scale
MonitorDeploy
ClusterControl Automation & Management
☐ Provisioning
☐ Deploy a cluster in minutes
☐ On-premises or in the cloud
(AWS)
☐ Monitoring
☐ Systems view
☐ 1sec resolution
☐ DB / OS stats & performance
advisors
☐ Configurable dashboards
☐ Query Analyzer
☐ Real-time / historical
☐ Management
☐ Multi cluster/data-center
☐ Automate repair/recovery
☐ Database upgrades
☐ Backups
☐ Configuration management
☐ Cloning
☐ One-click scaling
Supported Databases
Customers
MongoDB Security
How to Secure MongoDB (with ClusterControl)
Art van Scheppingen, Senior Support Engineer
Agenda
☐ What is the MongoDB ransom hack?
☐ What other security threats are valid for MongoDB?
☐ How to secure MongoDB from ransomware
☐ Try to hack yourself
☐ ClusterControl MongoDB security advisors
☐ Live Demo
What is the MongoDB ransom hack?
What is the news about?
☐ 40,000 public MongoDB servers found vulnerable in 2015
☐ Any user is admin
☐ Discovery by the University of Saarland in Germany
☐ Nothing happened for almost two years
☐ Someone rediscovers the vulnerability and hijacks servers
What is this vulnerability exactly?
☐ Default binding to every network interface (0.0.0.0)
☐ From MongoDB 3.0 onwards, changed to 127.0.0.1
☐ Often changed by a sysadmin/dba/devops in multi tenant env
☐ Default ports
☐ 27017 / 27018 / 27019
☐ Authentication and authorization disabled by default
☐ With authentication disabled, anyone is admin
☐ Exposed publicly on (cloud) hosts without firewall rules
What is this ransomware then?
☐ December 2016 ransomware emerged
☐ Scripted approach
☐ Copies all your data
☐ Removes all databases / collections
☐ Creates a WARNING collection containing:
{
"_id" : ObjectId("5859a0370b8e49f123fcc7da"),
"mail" : "<some@emailaddress.com>",
"note" : "SEND 0.2 BTC TO THIS ADDRESS 13zaxGVjj9MNc2jyvDRhLyYpkCh323MsMq AND CONTACT THIS EMAIL WITH
YOUR IP OF YOUR SERVER TO RECOVER YOUR DATABASE !"
}
☐ Even if you pay, you most likely never see your data back!
Is MongoDB at fault here?
☐ Default behaviour
☐ Well documented default settings
☐ Deliberately exposed by users with MongoDB 3.0 onwards
☐ MongoDB security guide certainly not followed up
☐ Is MongoDB at fault here?
Who is targeted by the ransomware?
☐ MongoDB instances with a combination of this:
☐ Bound to a public interface
☐ Bound to a default port
☐ No (or weak) authentication enabled
☐ No firewall rules or security groups in place
☐ Ransomware scans hosts for (default) ports that respond
☐ Identifies MongoDB instances
Have people secured their MongoDB servers by now?
Other vulnerabilities
HTTP interface
☐ Generally runs on MongoDB port + 1000 (e.g. 28017)
☐ HTTP status interface
☐ Operational data
☐ Logs
☐ Status reports
☐ REST interface
☐ Allows sending commands
☐ Allows receiving data
☐ HTTP interface has been deprecated in MongoDB 3.2
Serverside Javascript
☐ Generally useful for mapReduce operations
☐ May be vulnerable to command injections and buffer overflows
db.myCollection.find( { $where: function() { return obj.credits - obj.debits < 0; } } );
☐ Segfaults can cause a denial of service
MongoDB wire protocol
☐ Buildinfo responds with the MongoDB version
☐ Necessary for determining SCRAM-SHA-1 compatibility
☐ Version specific vulnerabilities may be targeted this way
☐ LDAP authentication vulnerability (SERVER-20691) up to 3.0.6
☐ Denial of Service (SERVER-17521) in 3.0.0
☐ No critical vulnerabilities for current versions
☐ https://www.mongodb.com/alerts/
Excessive rights
☐ Roles/users are stored in the database you connect to
☐ Local users with userAdmin role
☐ Able to grant admin role to any database they have rights to
☐ Normally you can’t bypass local authentication
☐ Except when you authenticate command line
[user@server ~]$ mongo -u user -p pass --authenticationDatabase test
☐ Or switch databases after authentication
Excessive rights (2)
[user@server ~]$ mongo -u admin -p admin test
mongodb_0:PRIMARY> db.createUser({ user: "user",
pwd: "pass",
roles: [
{ role: "readWrite", db: "test" },
{ role: "userAdmin", db: "test" }
{ role: "userAdmin", db: "exploited" }
]
})
[user@server ~]$ mongo -u user -p pass --authenticationDatabase test
mongodb_0:PRIMARY> db.createUser({ user: "exploit",
pwd: "pass",
roles: [
{ role: "readWrite", db: "exploited" },
{ role: "dbAdmin", db: "exploited" }
]
})
[user@server ~]$ mongo -u exploit -p pass --authenticationDatabase test exploited
mongodb_0:PRIMARY>
How to secure MongoDB from
ransomware
1. Enabling authentication
☐ Explicitly enabled in the /etc/mongod.conf
security:
Authentication: on
☐ Implicitly enabled in the /etc/mongod.conf
security:
keyFile: /etc/mongo-cluster.key
☐ Don’t forget to create an admin account first!
2. Don’t use weak passwords
☐ Enabling authentication will not give 100% protection
☐ Brute force user / password combinations
☐ Easy to guess users / passwords
☐ Scripts can brute force thousands of combinations remotely
☐ Brute force tools are readily available
3. Authorization users by roles
☐ Better create a user per role
☐ Don’t hand out excessive rights
☐ ClusterControl will create a separate admin and backup user
4. Add a replication keyfile
☐ New secondaries can join freely
☐ Only possible from primary with clusterManager or admin role
☐ Without a keyfile any host can join a replicaSet
☐ Keyfiles are not publicly exposed
☐ Enabling replication keyfile will implicitly enable
authentication
☐ Replication keyfiles are enabled by default in ClusterControl
5. Make backups regularly
☐ Ensure to make backups regularly!
☐ In case someone is still able to hack your system
☐ Point in time recovery through the oplog
☐ Oplog can’t be controlled/tampered with remotely
☐ ClusterControl has a great backup interface
☐ (Shard) consistent backups
6. Run MongoDB on a non-standard port
☐ MongoDB default ports are well known to attackers
☐ Setting non-standard ports may deflect fixed port scanners
☐ One line change in the /etc/mongod.conf
net:
port: 17027
☐ ClusterControl allows port customization during deploy time
☐ Post deploy: configuration change (from UI) and restart required
7. Does your application require public access?
☐ Publicly available when MongoDB is bound to all interfaces
☐ Does your application only need access via localhost?
☐ Default setting in /etc/mongod.conf
net:
bindIp: 127.0.0.1
7. Does your application require public access?
☐ Hosting and cloud environments may require separation
☐ Ensure data gets transmitted via private (internal) network
net:
bindIp: 127.0.0.1,172.16.1.234
8. Enable firewall rules or security groups
☐ Enable firewall rule or security groups
☐ Even if the host is on a private network
☐ Attackers may also come from the inside
☐ Compromised web server as jumpbox
☐ Limit access only to hosts that really need to connect
9. Disable serverside Javascript
☐ If you don’t need it, you can disable it:
security:
javascriptEnabled: False
10. Disable http interface
☐ Deprecated from MongoDB 3.2 onwards
☐ If you don’t need it, you can disable it:
net:
http:
enabled: False
RESTInterfaceEnabled: False
Enable audit logging
☐ Enable the audit log, when possible
☐ MongoDB Enterprise
☐ Percona Server MongoDB
☐ Scan for unexpected behaviour:
auditLog:
destination: file
format: BSON
path: /var/lib/mongodb/auditLog.bson
filter: '{ atype: { $in: [ "dropCollection", "dropDatabase", "dropIndexes", "renameCollection" ] } }'
Try to hack yourself
Check for external connectivity
☐ Use an external box (any AWS box would suffice)
☐ Try to telnet to your host
telnet your.host.com 27017
☐ A response indicates MongoDB ports are open
Trying your.host.com...
Connected to your.host.com.
Escape character is '^]'.
Check for external connectivity (2)
☐ Install nmap and scan
[you@host ~]$ sudo yum install nmap
[you@host ~]$ nmap -p 27017 --script mongodb-databases your.host.com
PORT STATE SERVICE REASON
27017/tcp open unknown syn-ack
| mongodb-databases:
| ok = 1
| databases
| 1
| empty = false
| sizeOnDisk = 83886080
| name = test
...
| 2
| empty = true
| sizeOnDisk = 1
| name = admin
|_ totalSize = 167772160
Check for external connectivity (3)
☐ MongoDB port closed: (properly firewalled)
Starting Nmap 6.40 ( http://nmap.org ) at 2017-01-16 14:37 UTC
Nmap scan report for 10.10.22.17
Host is up (0.00013s latency).
PORT STATE SERVICE
27017/tcp closed unknown
☐ Authentication enabled, but port still open:
Starting Nmap 6.40 ( http://nmap.org ) at 2017-01-16 14:36 UTC
Nmap scan report for 10.10.22.17
Host is up (0.00031s latency).
PORT STATE SERVICE
27017/tcp open mongodb
| mongodb-databases:
| code = 13
| ok = 0
|_ errmsg = not authorized on admin to execute command { listDatabases: 1.0 }
☐ MongoDB build information:
[you@host ~]$ nmap -p 27017 --script mongodb-info 10.10.22.17
Starting Nmap 6.40 ( http://nmap.org ) at 2017-01-16 14:37 UTC
Nmap scan report for 10.10.22.17
Host is up (0.00078s latency).
PORT STATE SERVICE
27017/tcp open mongodb
| mongodb-info:
| MongoDB Build info
| javascriptEngine = mozjs
| buildEnvironment
| distmod =
| target_arch = x86_64
…
| openssl
| running = OpenSSL 1.0.1e-fips 11 Feb 2013
| compiled = OpenSSL 1.0.1e-fips 11 Feb 2013
| versionArray
| 1 = 2
| 2 = 11
| 3 = -100
| 0 = 3
| version = 3.2.10-3.0
…
| Server status
| errmsg = not authorized on test to execute command { serverStatus: 1.0 }
| code = 13
|_ ok = 0
Check for excessive privileges
☐ MongoDB authenticates against the database you connect to
☐ Additional rights to other databases may be defined
☐ Connect command line with the authenticationDatabase
☐ Also switching databases will not re-authenticate
use mydatastore
db.createUser(
{
user: "user",
pwd: "password",
roles: [ { role: "readWrite", db: "mysdatastore" },
{ role: "readWrite", db: "admin" } ]
}
);
☐ Notice the additional rights on the admin database!
Check for excessive privileges (2)
☐ Review all privileges of all databases
my_mongodb_0:PRIMARY> use mydatastore
switched to db mydatastore
my_mongodb_0:PRIMARY> db.getUsers();
[
{
"_id" : "mysdatastore.user",
"user" : "user",
"db" : "mysdatastore",
"roles" : [
{
"role" : "readWrite",
"db" : "mysdatastore"
},
{
"role" : "readWrite",
"db" : "admin"
}
]
}
]
ClusterControl MongoDB security features
ClusterControl MongoDB deployment
☐ Enables authentication
☐ Enables replication key
☐ Binds to configured ip address
☐ Port numbers can be customized
☐ Disables http / REST api
☐ Forces creation of an admin account
☐ Separation of roles
☐ Admin
☐ Backup user
ClusterControl Authentication advisor
☐ Checks if authentication has been enabled
☐ Explicitly
☐ Implicitly (e.g. replication key)
☐ Warns if authentication has been disabled
ClusterControl Authentication advisor
ClusterControl Authorization advisor
☐ Verifies users/roles per database
☐ Checks for weak passwords
☐ Checks for excessive roles
☐ Checks for excessive roles on other databases
☐ Warns if these conditions haven’t been met
ClusterControl Authorization advisor
ClusterControl: live demo
Demo
Q & A
Thank you!
☐ Severalnines Blog on MongoDB
☐ https://severalnines.com/blog-categories/mongodb
☐ ClusterControl for MongoDB
☐ https://severalnines.com/product/clustercontrol/for_mongodb
☐ Download ClusterControl
☐ https://severalnines.com/download-clustercontrol-database-m
anagement-system
☐ Contact: info@severalnines.com

More Related Content

What's hot

02 banking trojans-thomassiebert
02 banking trojans-thomassiebert02 banking trojans-thomassiebert
02 banking trojans-thomassiebert
geeksec80
 

What's hot (20)

BlueHat v17 || Detecting Compromise on Windows Endpoints with Osquery
BlueHat v17 || Detecting Compromise on Windows Endpoints with Osquery BlueHat v17 || Detecting Compromise on Windows Endpoints with Osquery
BlueHat v17 || Detecting Compromise on Windows Endpoints with Osquery
 
Hack ASP.NET website
Hack ASP.NET websiteHack ASP.NET website
Hack ASP.NET website
 
Webinar: Securing your data - Mitigating the risks with MongoDB
Webinar: Securing your data - Mitigating the risks with MongoDBWebinar: Securing your data - Mitigating the risks with MongoDB
Webinar: Securing your data - Mitigating the risks with MongoDB
 
Vault - Secret and Key Management
Vault - Secret and Key ManagementVault - Secret and Key Management
Vault - Secret and Key Management
 
ChromeからMacBookのTouchIDでWebAuthenticationする ~Idance vol1~
ChromeからMacBookのTouchIDでWebAuthenticationする ~Idance vol1~ChromeからMacBookのTouchIDでWebAuthenticationする ~Idance vol1~
ChromeからMacBookのTouchIDでWebAuthenticationする ~Idance vol1~
 
Web acceleration mechanics
Web acceleration mechanicsWeb acceleration mechanics
Web acceleration mechanics
 
Secure Communications with VisualWorks - CSTUC 2006
Secure Communications with VisualWorks - CSTUC 2006Secure Communications with VisualWorks - CSTUC 2006
Secure Communications with VisualWorks - CSTUC 2006
 
Testing NodeJS Security
Testing NodeJS SecurityTesting NodeJS Security
Testing NodeJS Security
 
JSON Android
JSON AndroidJSON Android
JSON Android
 
Descargar datos con JSON en Android
Descargar datos con JSON en AndroidDescargar datos con JSON en Android
Descargar datos con JSON en Android
 
Docker and Fargate
Docker and FargateDocker and Fargate
Docker and Fargate
 
Mobile Programming - Network Universitas Budi Luhur
Mobile Programming - Network Universitas Budi LuhurMobile Programming - Network Universitas Budi Luhur
Mobile Programming - Network Universitas Budi Luhur
 
02 banking trojans-thomassiebert
02 banking trojans-thomassiebert02 banking trojans-thomassiebert
02 banking trojans-thomassiebert
 
Hiding secrets in Vault
Hiding secrets in VaultHiding secrets in Vault
Hiding secrets in Vault
 
Talk about html5 security
Talk about html5 securityTalk about html5 security
Talk about html5 security
 
VisualWorks Security Reloaded - STIC 2012
VisualWorks Security Reloaded - STIC 2012VisualWorks Security Reloaded - STIC 2012
VisualWorks Security Reloaded - STIC 2012
 
HashiCorp Vault Plugin Infrastructure
HashiCorp Vault Plugin InfrastructureHashiCorp Vault Plugin Infrastructure
HashiCorp Vault Plugin Infrastructure
 
HashiCorp's Vault - The Examples
HashiCorp's Vault - The ExamplesHashiCorp's Vault - The Examples
HashiCorp's Vault - The Examples
 
Building A Poor man’s Fir3Ey3 Mail Scanner
Building A Poor man’s Fir3Ey3 Mail ScannerBuilding A Poor man’s Fir3Ey3 Mail Scanner
Building A Poor man’s Fir3Ey3 Mail Scanner
 
Exploring, understanding and monitoring macOS activity with osquery
Exploring, understanding and monitoring macOS activity with osqueryExploring, understanding and monitoring macOS activity with osquery
Exploring, understanding and monitoring macOS activity with osquery
 

Viewers also liked

Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
Severalnines
 
Webinar slides: MySQL & MariaDB load balancing with ProxySQL & ClusterControl...
Webinar slides: MySQL & MariaDB load balancing with ProxySQL & ClusterControl...Webinar slides: MySQL & MariaDB load balancing with ProxySQL & ClusterControl...
Webinar slides: MySQL & MariaDB load balancing with ProxySQL & ClusterControl...
Severalnines
 

Viewers also liked (15)

Tracxn Research - Insurance Tech Landscape, February 2017
Tracxn Research - Insurance Tech Landscape, February 2017Tracxn Research - Insurance Tech Landscape, February 2017
Tracxn Research - Insurance Tech Landscape, February 2017
 
Trabajo Gloria Fuertes
Trabajo Gloria FuertesTrabajo Gloria Fuertes
Trabajo Gloria Fuertes
 
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
 
An introduction of different types of glasses
An introduction of different types of glassesAn introduction of different types of glasses
An introduction of different types of glasses
 
Webinar slides: MySQL & MariaDB load balancing with ProxySQL & ClusterControl...
Webinar slides: MySQL & MariaDB load balancing with ProxySQL & ClusterControl...Webinar slides: MySQL & MariaDB load balancing with ProxySQL & ClusterControl...
Webinar slides: MySQL & MariaDB load balancing with ProxySQL & ClusterControl...
 
Gs08 modernize your data platform with sql technologies wash dc
Gs08 modernize your data platform with sql technologies   wash dcGs08 modernize your data platform with sql technologies   wash dc
Gs08 modernize your data platform with sql technologies wash dc
 
Tracxn Research - Mobile Advertising Landscape, February 2017
Tracxn Research - Mobile Advertising Landscape, February 2017Tracxn Research - Mobile Advertising Landscape, February 2017
Tracxn Research - Mobile Advertising Landscape, February 2017
 
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
 
2017 iosco research report on financial technologies (fintech)
2017 iosco research report on  financial technologies (fintech)2017 iosco research report on  financial technologies (fintech)
2017 iosco research report on financial technologies (fintech)
 
ПДД ДС Семицветик Шахты
ПДД ДС Семицветик ШахтыПДД ДС Семицветик Шахты
ПДД ДС Семицветик Шахты
 
Make Up Look
Make Up LookMake Up Look
Make Up Look
 
March birthstone where does aquamarine come from
March birthstone where does aquamarine come fromMarch birthstone where does aquamarine come from
March birthstone where does aquamarine come from
 
Bingo sinfones br_4x4_3_cartones
Bingo sinfones br_4x4_3_cartonesBingo sinfones br_4x4_3_cartones
Bingo sinfones br_4x4_3_cartones
 
Экскурсия в лес
Экскурсия в лесЭкскурсия в лес
Экскурсия в лес
 
Webinar slides: Top 9 Tips for building a stable MySQL Replication environment
Webinar slides: Top 9 Tips for building a stable MySQL Replication environmentWebinar slides: Top 9 Tips for building a stable MySQL Replication environment
Webinar slides: Top 9 Tips for building a stable MySQL Replication environment
 

Similar to Webinar slides: How to Secure MongoDB with ClusterControl

Webinar slides: Become a MongoDB DBA - What to Monitor (if you’re really a My...
Webinar slides: Become a MongoDB DBA - What to Monitor (if you’re really a My...Webinar slides: Become a MongoDB DBA - What to Monitor (if you’re really a My...
Webinar slides: Become a MongoDB DBA - What to Monitor (if you’re really a My...
Severalnines
 
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
CODE BLUE
 
Webinar Slides: Become a MongoDB DBA (if you’re really a MySQL user)
Webinar Slides: Become a MongoDB DBA (if you’re really a MySQL user)Webinar Slides: Become a MongoDB DBA (if you’re really a MySQL user)
Webinar Slides: Become a MongoDB DBA (if you’re really a MySQL user)
Severalnines
 
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODEMSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
annalakshmi35
 
Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability Systems
Marcelo Pinheiro
 

Similar to Webinar slides: How to Secure MongoDB with ClusterControl (20)

Webinar: Architecting Secure and Compliant Applications with MongoDB
Webinar: Architecting Secure and Compliant Applications with MongoDBWebinar: Architecting Secure and Compliant Applications with MongoDB
Webinar: Architecting Secure and Compliant Applications with MongoDB
 
Achieving compliance With MongoDB Security
Achieving compliance With MongoDB Security Achieving compliance With MongoDB Security
Achieving compliance With MongoDB Security
 
Attacking Big Data Land
Attacking Big Data LandAttacking Big Data Land
Attacking Big Data Land
 
Telemetry indepth
Telemetry indepthTelemetry indepth
Telemetry indepth
 
Webinar slides: Become a MongoDB DBA - What to Monitor (if you’re really a My...
Webinar slides: Become a MongoDB DBA - What to Monitor (if you’re really a My...Webinar slides: Become a MongoDB DBA - What to Monitor (if you’re really a My...
Webinar slides: Become a MongoDB DBA - What to Monitor (if you’re really a My...
 
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
 
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
 
Containers with systemd-nspawn
Containers with systemd-nspawnContainers with systemd-nspawn
Containers with systemd-nspawn
 
오픈 소스 프로그래밍 - NoSQL with Python
오픈 소스 프로그래밍 - NoSQL with Python오픈 소스 프로그래밍 - NoSQL with Python
오픈 소스 프로그래밍 - NoSQL with Python
 
DevOops & How I hacked you DevopsDays DC June 2015
DevOops & How I hacked you DevopsDays DC June 2015DevOops & How I hacked you DevopsDays DC June 2015
DevOops & How I hacked you DevopsDays DC June 2015
 
Resilience Testing
Resilience Testing Resilience Testing
Resilience Testing
 
How to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita GalkinHow to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita Galkin
 
Real World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationReal World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS Application
 
Percona Live 2021 - MongoDB Security Features
Percona Live 2021 - MongoDB Security FeaturesPercona Live 2021 - MongoDB Security Features
Percona Live 2021 - MongoDB Security Features
 
Webinar Slides: Become a MongoDB DBA (if you’re really a MySQL user)
Webinar Slides: Become a MongoDB DBA (if you’re really a MySQL user)Webinar Slides: Become a MongoDB DBA (if you’re really a MySQL user)
Webinar Slides: Become a MongoDB DBA (if you’re really a MySQL user)
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 
MongoDB World 2018: Transactions and Durability: Putting the “D” in ACID
MongoDB World 2018: Transactions and Durability: Putting the “D” in ACIDMongoDB World 2018: Transactions and Durability: Putting the “D” in ACID
MongoDB World 2018: Transactions and Durability: Putting the “D” in ACID
 
MongoDB 3.2 - a giant leap. What’s new?
MongoDB 3.2 - a giant leap. What’s new?MongoDB 3.2 - a giant leap. What’s new?
MongoDB 3.2 - a giant leap. What’s new?
 
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODEMSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
MSWD:MERN STACK WEB DEVELOPMENT COURSE CODE
 
Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability Systems
 

More from Severalnines

Webinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBWebinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDB
Severalnines
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlWebinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Severalnines
 
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Severalnines
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Severalnines
 
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Severalnines
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLWebinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Severalnines
 
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBWebinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Severalnines
 
Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?
Severalnines
 
Webinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High AvailabilityWebinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High Availability
Severalnines
 

More from Severalnines (20)

Cloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaSCloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaS
 
Tips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloudTips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloud
 
Working with the Moodle Database: The Basics
Working with the Moodle Database: The BasicsWorking with the Moodle Database: The Basics
Working with the Moodle Database: The Basics
 
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDBSysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
 
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
 
Webinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBWebinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDB
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlWebinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
 
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
 
Disaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBDisaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDB
 
MariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseMariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash Course
 
Performance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBPerformance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDB
 
Advanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona ServerAdvanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona Server
 
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket KnifePolyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
 
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLWebinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
 
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningWebinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
 
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBWebinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
 
Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?
 
Webinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High AvailabilityWebinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High Availability
 

Recently uploaded

Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
SofiyaSharma5
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
ellan12
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Sheetaleventcompany
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
Diya Sharma
 

Recently uploaded (20)

Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 

Webinar slides: How to Secure MongoDB with ClusterControl

  • 1. Your host & some logistics I'm Jean-Jérôme from the Severalnines Team and I'm your host for today's webinar! Feel free to ask any questions in the Questions section of this application or via the Chat box. You can also contact me directly via the chat box or via email: jj@severalnines.com during or after the webinar.
  • 2. About Severalnines and ClusterControl
  • 3. What we do Manage Scale MonitorDeploy
  • 4. ClusterControl Automation & Management ☐ Provisioning ☐ Deploy a cluster in minutes ☐ On-premises or in the cloud (AWS) ☐ Monitoring ☐ Systems view ☐ 1sec resolution ☐ DB / OS stats & performance advisors ☐ Configurable dashboards ☐ Query Analyzer ☐ Real-time / historical ☐ Management ☐ Multi cluster/data-center ☐ Automate repair/recovery ☐ Database upgrades ☐ Backups ☐ Configuration management ☐ Cloning ☐ One-click scaling
  • 7. MongoDB Security How to Secure MongoDB (with ClusterControl) Art van Scheppingen, Senior Support Engineer
  • 8. Agenda ☐ What is the MongoDB ransom hack? ☐ What other security threats are valid for MongoDB? ☐ How to secure MongoDB from ransomware ☐ Try to hack yourself ☐ ClusterControl MongoDB security advisors ☐ Live Demo
  • 9. What is the MongoDB ransom hack?
  • 10. What is the news about? ☐ 40,000 public MongoDB servers found vulnerable in 2015 ☐ Any user is admin ☐ Discovery by the University of Saarland in Germany ☐ Nothing happened for almost two years ☐ Someone rediscovers the vulnerability and hijacks servers
  • 11. What is this vulnerability exactly? ☐ Default binding to every network interface (0.0.0.0) ☐ From MongoDB 3.0 onwards, changed to 127.0.0.1 ☐ Often changed by a sysadmin/dba/devops in multi tenant env ☐ Default ports ☐ 27017 / 27018 / 27019 ☐ Authentication and authorization disabled by default ☐ With authentication disabled, anyone is admin ☐ Exposed publicly on (cloud) hosts without firewall rules
  • 12. What is this ransomware then? ☐ December 2016 ransomware emerged ☐ Scripted approach ☐ Copies all your data ☐ Removes all databases / collections ☐ Creates a WARNING collection containing: { "_id" : ObjectId("5859a0370b8e49f123fcc7da"), "mail" : "<some@emailaddress.com>", "note" : "SEND 0.2 BTC TO THIS ADDRESS 13zaxGVjj9MNc2jyvDRhLyYpkCh323MsMq AND CONTACT THIS EMAIL WITH YOUR IP OF YOUR SERVER TO RECOVER YOUR DATABASE !" } ☐ Even if you pay, you most likely never see your data back!
  • 13. Is MongoDB at fault here? ☐ Default behaviour ☐ Well documented default settings ☐ Deliberately exposed by users with MongoDB 3.0 onwards ☐ MongoDB security guide certainly not followed up ☐ Is MongoDB at fault here?
  • 14. Who is targeted by the ransomware? ☐ MongoDB instances with a combination of this: ☐ Bound to a public interface ☐ Bound to a default port ☐ No (or weak) authentication enabled ☐ No firewall rules or security groups in place ☐ Ransomware scans hosts for (default) ports that respond ☐ Identifies MongoDB instances
  • 15.
  • 16.
  • 17.
  • 18. Have people secured their MongoDB servers by now?
  • 19.
  • 20.
  • 21.
  • 23. HTTP interface ☐ Generally runs on MongoDB port + 1000 (e.g. 28017) ☐ HTTP status interface ☐ Operational data ☐ Logs ☐ Status reports ☐ REST interface ☐ Allows sending commands ☐ Allows receiving data ☐ HTTP interface has been deprecated in MongoDB 3.2
  • 24. Serverside Javascript ☐ Generally useful for mapReduce operations ☐ May be vulnerable to command injections and buffer overflows db.myCollection.find( { $where: function() { return obj.credits - obj.debits < 0; } } ); ☐ Segfaults can cause a denial of service
  • 25. MongoDB wire protocol ☐ Buildinfo responds with the MongoDB version ☐ Necessary for determining SCRAM-SHA-1 compatibility ☐ Version specific vulnerabilities may be targeted this way ☐ LDAP authentication vulnerability (SERVER-20691) up to 3.0.6 ☐ Denial of Service (SERVER-17521) in 3.0.0 ☐ No critical vulnerabilities for current versions ☐ https://www.mongodb.com/alerts/
  • 26. Excessive rights ☐ Roles/users are stored in the database you connect to ☐ Local users with userAdmin role ☐ Able to grant admin role to any database they have rights to ☐ Normally you can’t bypass local authentication ☐ Except when you authenticate command line [user@server ~]$ mongo -u user -p pass --authenticationDatabase test ☐ Or switch databases after authentication
  • 27. Excessive rights (2) [user@server ~]$ mongo -u admin -p admin test mongodb_0:PRIMARY> db.createUser({ user: "user", pwd: "pass", roles: [ { role: "readWrite", db: "test" }, { role: "userAdmin", db: "test" } { role: "userAdmin", db: "exploited" } ] }) [user@server ~]$ mongo -u user -p pass --authenticationDatabase test mongodb_0:PRIMARY> db.createUser({ user: "exploit", pwd: "pass", roles: [ { role: "readWrite", db: "exploited" }, { role: "dbAdmin", db: "exploited" } ] }) [user@server ~]$ mongo -u exploit -p pass --authenticationDatabase test exploited mongodb_0:PRIMARY>
  • 28. How to secure MongoDB from ransomware
  • 29. 1. Enabling authentication ☐ Explicitly enabled in the /etc/mongod.conf security: Authentication: on ☐ Implicitly enabled in the /etc/mongod.conf security: keyFile: /etc/mongo-cluster.key ☐ Don’t forget to create an admin account first!
  • 30. 2. Don’t use weak passwords ☐ Enabling authentication will not give 100% protection ☐ Brute force user / password combinations ☐ Easy to guess users / passwords ☐ Scripts can brute force thousands of combinations remotely ☐ Brute force tools are readily available
  • 31. 3. Authorization users by roles ☐ Better create a user per role ☐ Don’t hand out excessive rights ☐ ClusterControl will create a separate admin and backup user
  • 32. 4. Add a replication keyfile ☐ New secondaries can join freely ☐ Only possible from primary with clusterManager or admin role ☐ Without a keyfile any host can join a replicaSet ☐ Keyfiles are not publicly exposed ☐ Enabling replication keyfile will implicitly enable authentication ☐ Replication keyfiles are enabled by default in ClusterControl
  • 33. 5. Make backups regularly ☐ Ensure to make backups regularly! ☐ In case someone is still able to hack your system ☐ Point in time recovery through the oplog ☐ Oplog can’t be controlled/tampered with remotely ☐ ClusterControl has a great backup interface ☐ (Shard) consistent backups
  • 34. 6. Run MongoDB on a non-standard port ☐ MongoDB default ports are well known to attackers ☐ Setting non-standard ports may deflect fixed port scanners ☐ One line change in the /etc/mongod.conf net: port: 17027 ☐ ClusterControl allows port customization during deploy time ☐ Post deploy: configuration change (from UI) and restart required
  • 35. 7. Does your application require public access? ☐ Publicly available when MongoDB is bound to all interfaces ☐ Does your application only need access via localhost? ☐ Default setting in /etc/mongod.conf net: bindIp: 127.0.0.1
  • 36. 7. Does your application require public access? ☐ Hosting and cloud environments may require separation ☐ Ensure data gets transmitted via private (internal) network net: bindIp: 127.0.0.1,172.16.1.234
  • 37. 8. Enable firewall rules or security groups ☐ Enable firewall rule or security groups ☐ Even if the host is on a private network ☐ Attackers may also come from the inside ☐ Compromised web server as jumpbox ☐ Limit access only to hosts that really need to connect
  • 38. 9. Disable serverside Javascript ☐ If you don’t need it, you can disable it: security: javascriptEnabled: False
  • 39. 10. Disable http interface ☐ Deprecated from MongoDB 3.2 onwards ☐ If you don’t need it, you can disable it: net: http: enabled: False RESTInterfaceEnabled: False
  • 40. Enable audit logging ☐ Enable the audit log, when possible ☐ MongoDB Enterprise ☐ Percona Server MongoDB ☐ Scan for unexpected behaviour: auditLog: destination: file format: BSON path: /var/lib/mongodb/auditLog.bson filter: '{ atype: { $in: [ "dropCollection", "dropDatabase", "dropIndexes", "renameCollection" ] } }'
  • 41. Try to hack yourself
  • 42. Check for external connectivity ☐ Use an external box (any AWS box would suffice) ☐ Try to telnet to your host telnet your.host.com 27017 ☐ A response indicates MongoDB ports are open Trying your.host.com... Connected to your.host.com. Escape character is '^]'.
  • 43. Check for external connectivity (2) ☐ Install nmap and scan [you@host ~]$ sudo yum install nmap [you@host ~]$ nmap -p 27017 --script mongodb-databases your.host.com PORT STATE SERVICE REASON 27017/tcp open unknown syn-ack | mongodb-databases: | ok = 1 | databases | 1 | empty = false | sizeOnDisk = 83886080 | name = test ... | 2 | empty = true | sizeOnDisk = 1 | name = admin |_ totalSize = 167772160
  • 44. Check for external connectivity (3) ☐ MongoDB port closed: (properly firewalled) Starting Nmap 6.40 ( http://nmap.org ) at 2017-01-16 14:37 UTC Nmap scan report for 10.10.22.17 Host is up (0.00013s latency). PORT STATE SERVICE 27017/tcp closed unknown ☐ Authentication enabled, but port still open: Starting Nmap 6.40 ( http://nmap.org ) at 2017-01-16 14:36 UTC Nmap scan report for 10.10.22.17 Host is up (0.00031s latency). PORT STATE SERVICE 27017/tcp open mongodb | mongodb-databases: | code = 13 | ok = 0 |_ errmsg = not authorized on admin to execute command { listDatabases: 1.0 }
  • 45. ☐ MongoDB build information: [you@host ~]$ nmap -p 27017 --script mongodb-info 10.10.22.17 Starting Nmap 6.40 ( http://nmap.org ) at 2017-01-16 14:37 UTC Nmap scan report for 10.10.22.17 Host is up (0.00078s latency). PORT STATE SERVICE 27017/tcp open mongodb | mongodb-info: | MongoDB Build info | javascriptEngine = mozjs | buildEnvironment | distmod = | target_arch = x86_64 … | openssl | running = OpenSSL 1.0.1e-fips 11 Feb 2013 | compiled = OpenSSL 1.0.1e-fips 11 Feb 2013 | versionArray | 1 = 2 | 2 = 11 | 3 = -100 | 0 = 3 | version = 3.2.10-3.0 … | Server status | errmsg = not authorized on test to execute command { serverStatus: 1.0 } | code = 13 |_ ok = 0
  • 46. Check for excessive privileges ☐ MongoDB authenticates against the database you connect to ☐ Additional rights to other databases may be defined ☐ Connect command line with the authenticationDatabase ☐ Also switching databases will not re-authenticate use mydatastore db.createUser( { user: "user", pwd: "password", roles: [ { role: "readWrite", db: "mysdatastore" }, { role: "readWrite", db: "admin" } ] } ); ☐ Notice the additional rights on the admin database!
  • 47. Check for excessive privileges (2) ☐ Review all privileges of all databases my_mongodb_0:PRIMARY> use mydatastore switched to db mydatastore my_mongodb_0:PRIMARY> db.getUsers(); [ { "_id" : "mysdatastore.user", "user" : "user", "db" : "mysdatastore", "roles" : [ { "role" : "readWrite", "db" : "mysdatastore" }, { "role" : "readWrite", "db" : "admin" } ] } ]
  • 49. ClusterControl MongoDB deployment ☐ Enables authentication ☐ Enables replication key ☐ Binds to configured ip address ☐ Port numbers can be customized ☐ Disables http / REST api ☐ Forces creation of an admin account ☐ Separation of roles ☐ Admin ☐ Backup user
  • 50. ClusterControl Authentication advisor ☐ Checks if authentication has been enabled ☐ Explicitly ☐ Implicitly (e.g. replication key) ☐ Warns if authentication has been disabled
  • 52. ClusterControl Authorization advisor ☐ Verifies users/roles per database ☐ Checks for weak passwords ☐ Checks for excessive roles ☐ Checks for excessive roles on other databases ☐ Warns if these conditions haven’t been met
  • 55. Demo
  • 56. Q & A
  • 57. Thank you! ☐ Severalnines Blog on MongoDB ☐ https://severalnines.com/blog-categories/mongodb ☐ ClusterControl for MongoDB ☐ https://severalnines.com/product/clustercontrol/for_mongodb ☐ Download ClusterControl ☐ https://severalnines.com/download-clustercontrol-database-m anagement-system ☐ Contact: info@severalnines.com