VPS & Dedicated Server

NodeWatch: Cara Mudah Menghentikan Penyalahgunaan VPS pada OpenVZ

Artikel berikut sangat berguna bagi anda yang memiliki Dedicated Server khususnya para klien Aditif.Net untuk mengamankan akun VPS pada OpenVZ dari gangguan teknis. Masalah penyalahgunaan akun VPS yang terjadi umumnya adalah penggunaan resource berlebih hingga kemungkinan terjadinya penyerangan server dengan metode DDOS sehingga menyebabkan server tidak dapat diakses.

Cara Mudah Menghentikan Penyalahgunaan VPS pada OpenVZ bisa dilakukan dengan aplikasi NodeWatch. Informasi lengkap dapat anda baca langsung melalui alamat web vpsantiabuse.com.

NodeWatch telah dikembangkan secara konstan sejak tahun 2009 & telah aktif digunakan pada banyak node VPS yang menjalankan kernel OpenVZ. NodeWatch telah disediakan secara gratis pada awal tahun 2013 dan telah dimasukkan banyak perubahan berdasarkan umpan balik dari pengguna baru. NodeWatch mendukung Sistem Operasi berbasis Linux 64-bit RHEL/CentOS 5.x, 6.x.

Berikut adalah langkah mudah instalasi NodeWatch pada Dedicated Server anda.

1. Buka alamat web vpsantiabuse.com dan daftarkan email anda u/ mndapatkan License Key secara Gratis!

2. Login SSH dg user root ke Dedicated Server anda

3. Lakukan download & install NodeWatch

wget http://deploy.vpsantiabuse.com/nodewatch-install.sh
sh nodewatch-install.sh

4. Setelah selesai install, selanjutnya buka dan edit konfigurasi /nodewatch/scripts/nodewatch_config.php

vi /nodewatch/scripts/nodewatch_config.php

Dan isikan License Key, Email (opsional No.HP u/ mndapatkan notifikasi SMS)

// e-mail address for alerts
$admin_email = 'your@email'; 

// your license key, see http://vpsantiabuse.com/
$license_key = '1293819230781023'; 

// in test mode Nodewatch will not perform suspensions and will not send SMS alerts
// however, e-mail alerts will still be sent
// Change this to 0 once configured and tested
$testmode = 1;

Keterangan: $testmode dapat diganti menjadi 0

Konfigurasi opsional berikutnya

// set to true to enables SMS alerts
$sms_alerts = true; 

// cell phone for sms alerts; for US/Canada: '555-5555-555'; 

// international example: '+55-555-5555-555' 
// (+55 = country code with "+" prefix)

// multiple numbers example: '555-5555-555,+66-666-6666-666' 
// (up to 3 phone numbers are supported)
$sms_phoneno = '123-4567-890'; 

// change to true to disable scanning customers' VPS for weak root passwords
$disable_nodewatch_passwords = false; 

// change to true to disable scanning customers' VPS for blacklisted process names
$disable_nodewatch_processes = false; 

// From: address for e-mail alerts. If not specified, $admin_email will be used.
$admin_email_from = 'info@hostname.server.com'; 

// Do not include inbound packets in pps accounting (this will effectively lead to inbound DoS attacks being ignored)
$limit_packets_ignore_ingress = false;

Konfigurasi tambahan u/ update NodeWatch via web

// set to true to enable
$nodewatch_web_update_enabled = true; // change to false to disable web updates

// link to update.php, http only
$nodewatch_web_update_url = 'http://yourdomain.com/update.php'; 
           
// password for nodewatch-web, must match the password 
// set in config.php of your nodewatch-web installation
$nodewatch_web_password = 'secret';

Integrasi dg SolusVM (opsional)

// set to true to enable
$solusvm_calls_enabled = true; 

// IP address of the SolusVM master
$solusvm_master_ip = '1.2.3.4';

// API id must be created in the SolusVM Admin panel, menu: Configuration->Api Access 
$solusvm_master_api_id = 'ididididididididididididididid';    

// API key must be created in the SolusVM Admin panel, menu: Configuration->Api Access
$solusvm_master_api_key = 'keykeykeykeykeykeykeykeykeykey';   

// Numeric Node ID of this physical server. It can be looked up in the SolusVM Admin panel, menu: Nodes->List Nodes
$solusvm_node_id = '2';

Setelah selesai konfigurasi & disimpan, lakukan restart NodeWatch dg perintah berikut.

sudo /nodewatch/scripts/nodewatch_restart.sh

Tunggu sekitar 1-2menit (lama waktu bergantung kesibukan server saat itu, mungkin bs lebih lama dari 5-20menit), dan jalankan perintah berikut u/ melihat statistik node VPS.

watch -n 1 cat /tmp/nodewatch_stats

Alerts

Anda dapat mengubah nilai berikut jika default batas standar tidak bekerja u/ server anda. Modifikasi nilai-nilai dalam nodewatch_config.php berikut berdasarkan kemampuan server & sesuaikan batas max. penggunaan akun per-VPS.

$limits_packets [ 5 ]  =  160000;   // Send alert when over 160kpps during 5 seconds
$limits_packets [ 15 ] =  150000;   // Send alert when over 150kpps during 15 seconds
$limits_packets [ 60 ] =  130000;   // Send alert when over 130kpps during 1 minute
$limits_packets [ 180 ] = 120000;   // Send alert when over 120kpps during 3 minutes
$limits_packets [ 900 ] = 110000;   // Send alert when over 110kpps during 15 minutes
$limit_smtp = 200; 
Send alert when VPS exceeds 200 simultaneous SMTP conntrack sessions.
$limit_ssh = 30;
Send alert when VPS exceeds 30 simultaneous outgoing SSH conntrack sessions.
$limit_conntrack = 30000; 
Send alert when VPS spawns over 30000 conntrack sessions

Notifikasi pesan akan dikirimkan ke email yang diisikan dalam file nodewatch_config.php jika ada akun VPS yg menyentuh nilai batas tersebut. Jika nomor telepon diisikan dalam file konfigurasi, maka pemberitahuan SMS akan dikirimkan juga.

Suspend/Pembekuan VPS Otomatis

Silahkan lakukan modifikasi sesuai keperluan dalam file nodewatch_config.php untuk merubah nilai sesuai kemampuan server.

$limit_packets_suspend = 500000;
Suspend VPS if it exceeds 500000 packets per second.
$limit_smtp_suspend = 1000;
Suspend VPS if it exceeds 1000 simultaneous SMTP conntrack sessions.
$limit_ssh_suspend = 100;
Suspend VPS if it exceeds 100 simultaneous outgoing SSH conntrack sessions.
$limit_conntrack_suspend = 55000;
Suspend VPS if it spawns over 55000 conntrack sessions

Notifikasi pesan akan dikirimkan ke email yang diisikan dalam file nodewatch_config.php jika ada akun VPS yg ter-suspend secara otomatis. Jika nomor telepon diisikan dalam file konfigurasi, maka pemberitahuan SMS akan dikirimkan juga.

Jika detail SolusVM Master diisikan dalam file konfigurasi, Nodewatch juga akan mengirimkan pemberitahuan kepada SolusVM Master.

Bagaimana Suspend VPS bekerja?

Nodewatch akan mengeksekusi perintah shell berikut untuk men-suspend VPS.

vzctl set VEID --disabled yes --save

Hal ini untuk mencegah start VPS, tapi tidak menghentikannya.
Setelah VPS dinonaktifkan, Nodewatch menghapus semua alamat IP yang ditugaskan ke VPS.

vzctl set VEID --ipdel all

Perintah tersebut menghentikan semua lalu lintas jaringan ke/dari VPS sementara VPS sedang ditutup. Perhatikan bahwa tindakan ini memiliki efek sementara, tidak ada perubahan pada file-file konfigurasi yang dibuat karena tidak memakai parameter –save.

Kemudian Nodewatch menghentikan VPS dg eksekusi perintah berikut.

vzctl stop VEID

Cara unsuspend VPS setelah suspensi otomatis

vzctl set VEID --disabled no --save
You can then start the VPS:
vzctl start VEID

Jika detail konfigurasi u/ SolusVM Master diisi, maka Anda juga dapat unsuspend VPS langsung dari SolusVM Master.

Cara Whitelist VPS

Jika Anda perlu untuk memungkinkan pelanggan Anda untuk menjalankan program email massal, milis, dll, sangat mudah untuk memberikan daftar putih (whitelist) VPS mereka. Cukup menambahkan VEID mereka satu (atau beberapa) dari file-file berikut.

/nodewatch/scripts/smtp_whitelist – for smtp connections
/nodewatch/scripts/ssh_whitelist – for ssh connections
/nodewatch/scripts/conntrack_whitelist – for conntrack connections
/nodewatch/scripts/processes_whitelist – for malware processes
/nodewatch/scripts/pps_whitelist – for packet counters

Untuk whitelist multiple VPS, tambahkan 1 VEID perbaris.

Dimulai dengan versi 3.20, perubahan yang dibuat untuk Whitelist diterapkan segera, tidak perlu me-restart Nodewatch.

Perhatikan bahwa Anda masih akan mendapatkan e-mail dan SMS alert bahkan jika VPS adalah daftar putih. Jika Anda ingin menonaktifkan alert, tambahkan titik setelah VEID.

Berikut adalah contoh entri whitelist valid.

1140
1150
1160.
1170.

Keterangan u/ contoh whitelist diatas.
– VPS 1140 & 1150 tidak akan tersuspend, notifikasi sms alert tetap terkirim.
– VPS 1160 & 1170 tidak akan tersuspend, notifikasi sms alert tidak dikirim.

Keamanan canggih pendeteksi password lemah root VPS

Nodewatch menggunakan metode John the Ripper untuk secara otomatis memindai akun VPS pengguna yg menggunakan password yang lemah. (John terinstal secara otomatis selama instalasi Nodewatch, tidak perlu menginstal secara terpisah). Ketika password yang lemah ditemukan, maka sistem akan secara otomatis mengganti password secara acak. Sebuah pesan kemudian dikirimkan ke VPS konsol pengguna dengan password baru serta catatan dikirim ke syslog dalam VPS.

Keamanan canggih pendeteksi proses Malware

Nodewatch secara aktif mencari trojan umum, alat serangan DoS, backdoors, dll.
Beberapa contoh yg dapat dideteksi Nodewatch adalah sbb.

.IptabLes 
.IptabLex 
ICE-unixx 
freeBSD 
b26

Jika proses malware terdeteksi, VPS akan segera dinonaktifkan dan peringatan dikirim.

Konfigurasi Terpusat

Nodewatch 3.40 dan versi yang lebih baru mendukung konfigurasi jarak jauh (remote) terpusat.
Berikut adalah cara melakukan konfigurasi terpusat jarak jauh.

1) Ubah nama nodewatch_config.php menjadi nodewatch_config.txt
2) Buka nodewatch_config.txt di editor teks dan hapus tag pembuka dan penutup php (<?php dan ?>)
3) Upload nodewatch_config.txt ke remote server HTTP
4) Pastikan link untuk nodewatch_config.txt berfungsi dg baik dan Anda dapat melihat variabel konfigurasi di jendela browser
5) Pada node VPS (Server DS), buat file konfigurasi baru (/nodewatch/scripts/nodewatch_config.php) dengan isi sebagai berikut.

<?php
    $nodewatch_remote_config = 'http://example.com/nodewatch/nodewatch_config.txt'; 
?>

Kemudian restart Nodewatch seperti biasa dan otomatis akan men-download remote file konfigurasi.
Nodewatch akan kembali men-download file konfigurasi setelah eksekusi manual nodewatch_restart.sh.

CATATAN: Versi saat ini dari Nodewatch tidak mendukung komentar dalam konfigurasi jarak jauh. Silakan hapus semua komentar sebelum meng-upload file. Ini akan diperbarui dan dibahas dalam rilis berikutnya.

Update/memperbarui versi terbaru dari NodeWatch

sudo /nodewatch/scripts/update.sh

Menjalankan script ini akan memperbarui dan restart instalasi Nodewatch Anda. Biarkan 2-3 menit setelah update untuk melihat statistik kembali.

Cara Uninstall NodeWatch

sudo rm -f /etc/cron.d/vpsantiabuse
sudo /nodewatch/scripts/nodewatch_restart.sh
sudo rm -rf /nodewatch

Selesai.
Semoga membantu.
Terimakasih.

Salam,
Aditif.Net
Domain Hosting Provider

Post Comment