|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Dec 2004
Messaggi: 3573
|
apache2.2 hardening: modsecurity2 e chroot
Visto che per altre esigenze ho dovuto tirar su un serverino xen e allacciare una nuova linea con 1.5 Mb di upload (powered by cisco 1841
![]() Purtroppo non ho molto tempo da dedicargli e quindi posso metterci mano solo nel poco tempo libero che ho a disposizione e sarei ben felice di sapere se qualcuno ha gia affrontato le mie stesse problematiche: debian lenny con apache2.2 e mod-security2 2.5.5 con il quale tra le altre cose ho chrootato apache (ma con mod_chroot ho gli stessi problemi). Ovviamente apache non è in grado di raggiungere /usr/share/phpmyadmin e quindi ho copiato quella cartella dentro il chroot. Il problema è che senza chroot quando provo a connettermi a un database ricevo questo errore #2002 - Il server non risponde (o il socket del server locale MySQL non è correttamente configurato) come è giusto che sia dal momento che mysql-server non è installato, mentre se apache è chrootato quando provo a connettermi non succede nulla ![]() Idee?
__________________
Debian amd64 | Gentoo amd64 | AMD Athlon64 3800+ X2@2701Mhz vcore 1.49V | Placing an unpatched Windows computer directly onto the Internet in the hope that it downloads the patches faster than it gets exploited are odds that you wouldn't bet on in Vegas | e-mail+jabber: darkbasic|a.t|linuxsystems|d.o.t|it | www.linuxsystems.it |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Dec 2004
Messaggi: 3573
|
Possibile che sia l'unico uomo al mondo che ha provato ad utilizzare phpmyadmin con apache chrootato?
Non riesco a trovare niente nemmeno con google ![]()
__________________
Debian amd64 | Gentoo amd64 | AMD Athlon64 3800+ X2@2701Mhz vcore 1.49V | Placing an unpatched Windows computer directly onto the Internet in the hope that it downloads the patches faster than it gets exploited are odds that you wouldn't bet on in Vegas | e-mail+jabber: darkbasic|a.t|linuxsystems|d.o.t|it | www.linuxsystems.it |
![]() |
![]() |
![]() |
#3 |
Senior Member
Iscritto dal: Oct 2003
Città: La Spezia
Messaggi: 962
|
ciao
il socket di mysql dove lo fai ascoltare? dentro la chroot? devi naturalmente installarlo mysql...
__________________
![]() ![]() Gigabyte ga-p55-ud6 | Intel i7 860 | 2x2gb Corsair xms3 | Adaptec 2410sa | raid1 barracuda 500gb 7200.12 | Intel x25-m 80gb G2 | ATI radeon 4890 | tutto in downclock (non ho parenti all'enel) |
![]() |
![]() |
![]() |
#4 |
Senior Member
Iscritto dal: Sep 2003
Città: Bergamo
Messaggi: 1176
|
Se usi apache chrootato la via migliore per connetterti al db non è via socket (a meno che tu lo sposti dentro la jail), ma utilizzando il protocollo tcp impostando che si connetta al tuo localhost (127.0.0.1). Assicurati di non avere il parametro "skip-networking" nel file my.cnf e per sicurezza controlla che il server mysql sia accessibile solo da localhost (sempre da my.cnf).
__________________
VGA? No grazie, preferisco le SERIALI! http://daniele.vigano.me | Home server HP Proliant MicroServer (Fedora 64bit) | Notebook Dell Latitude E5450 (Fedora 64bit) | Mobile Moto G3 GEM HPC Cluster Dell PowerEdge R720xd + R720 + R420 + M1000e + M915 (Ubuntu LTS 64bit) up to 1000 cores | EATON UPS |
![]() |
![]() |
![]() |
#5 |
Senior Member
Iscritto dal: Dec 2004
Messaggi: 3573
|
Innanzitutto grazie per le risposte!
Non c'è nessun server mysql installato, il server mysql è su un'altra macchina virtuale. Quello che mi chiedo è: perché non mi da il messaggio di errore (cosa che fa se apache non è chrootato)? Ho notato che anche non avendo installato mysql-server ho comunque il file /etc/mysql/my.cnf... perché?
__________________
Debian amd64 | Gentoo amd64 | AMD Athlon64 3800+ X2@2701Mhz vcore 1.49V | Placing an unpatched Windows computer directly onto the Internet in the hope that it downloads the patches faster than it gets exploited are odds that you wouldn't bet on in Vegas | e-mail+jabber: darkbasic|a.t|linuxsystems|d.o.t|it | www.linuxsystems.it |
![]() |
![]() |
![]() |
#6 | |
Senior Member
Iscritto dal: Dec 2004
Messaggi: 3573
|
Quote:
![]()
__________________
Debian amd64 | Gentoo amd64 | AMD Athlon64 3800+ X2@2701Mhz vcore 1.49V | Placing an unpatched Windows computer directly onto the Internet in the hope that it downloads the patches faster than it gets exploited are odds that you wouldn't bet on in Vegas | e-mail+jabber: darkbasic|a.t|linuxsystems|d.o.t|it | www.linuxsystems.it |
|
![]() |
![]() |
![]() |
#7 |
Senior Member
Iscritto dal: Dec 2004
Messaggi: 3573
|
up
__________________
Debian amd64 | Gentoo amd64 | AMD Athlon64 3800+ X2@2701Mhz vcore 1.49V | Placing an unpatched Windows computer directly onto the Internet in the hope that it downloads the patches faster than it gets exploited are odds that you wouldn't bet on in Vegas | e-mail+jabber: darkbasic|a.t|linuxsystems|d.o.t|it | www.linuxsystems.it |
![]() |
![]() |
![]() |
#8 | ||
Senior Member
Iscritto dal: Sep 2003
Città: Bergamo
Messaggi: 1176
|
Quote:
Quote:
Mysql sulla macchina remota non dovrà avere il parametro 'skip-networking' mentre l'utente che tu vuoi utilizzare dovrà avere i permessi di connessione dalla macchina con apache. Per esempio lo puoi impostare con il comando GRANT lanciato su mysql: Codice:
GRANT ALL ON mydb.* TO 'mioutente'@'ipapache'; Codice:
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'mioutente'; GRANT ALL ON mydb.* TO 'mioutente'@'localhost' IDENTIFIED BY 'password'; GRANT ALL ON mydb.* TO 'mioutente'@'ipapache' IDENTIFIED BY 'password'; Così dovrebbe andare tutto...
__________________
VGA? No grazie, preferisco le SERIALI! http://daniele.vigano.me | Home server HP Proliant MicroServer (Fedora 64bit) | Notebook Dell Latitude E5450 (Fedora 64bit) | Mobile Moto G3 GEM HPC Cluster Dell PowerEdge R720xd + R720 + R420 + M1000e + M915 (Ubuntu LTS 64bit) up to 1000 cores | EATON UPS |
||
![]() |
![]() |
![]() |
#9 | |
Senior Member
Iscritto dal: Dec 2004
Messaggi: 3573
|
Quote:
![]()
__________________
Debian amd64 | Gentoo amd64 | AMD Athlon64 3800+ X2@2701Mhz vcore 1.49V | Placing an unpatched Windows computer directly onto the Internet in the hope that it downloads the patches faster than it gets exploited are odds that you wouldn't bet on in Vegas | e-mail+jabber: darkbasic|a.t|linuxsystems|d.o.t|it | www.linuxsystems.it |
|
![]() |
![]() |
![]() |
#10 |
Senior Member
Iscritto dal: Dec 2004
Messaggi: 3573
|
up
__________________
Debian amd64 | Gentoo amd64 | AMD Athlon64 3800+ X2@2701Mhz vcore 1.49V | Placing an unpatched Windows computer directly onto the Internet in the hope that it downloads the patches faster than it gets exploited are odds that you wouldn't bet on in Vegas | e-mail+jabber: darkbasic|a.t|linuxsystems|d.o.t|it | www.linuxsystems.it |
![]() |
![]() |
![]() |
#11 |
Senior Member
Iscritto dal: Dec 2004
Messaggi: 3573
|
up
__________________
Debian amd64 | Gentoo amd64 | AMD Athlon64 3800+ X2@2701Mhz vcore 1.49V | Placing an unpatched Windows computer directly onto the Internet in the hope that it downloads the patches faster than it gets exploited are odds that you wouldn't bet on in Vegas | e-mail+jabber: darkbasic|a.t|linuxsystems|d.o.t|it | www.linuxsystems.it |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 00:08.