Archive

Articles taggués ‘securite’

mod_geoip2 Apache module

22/01/2024 Comments off

The mod_geoip2 module embeds GeoIP database lookups into the Apache web server. It is only capable of looking up the IP of a client that connects to the web server, as opposed to looking up arbitrary addresses.

This module works with Apache 2. Please use mod_geoip with Apache 1.

Installation

You may download the latest release of mod_geoip2 or get the latest development version from GitHub. See the included INSTALL file in the tarball for installation details.

Overview

The mod_geoip2 module uses the libGeoIP library to look up geolocation information for a client as part of the http request process. This module is free software, and is licensed under the Apache license.

To compile and install this module, you must first install libGeoIP 1.4.3 or newer.

The mod_geoip2 module takes effect either during request header parsing phase or the post read request phase, depending on whether it is configured for server-wide use or for a specific location/directory.

When enabled, the module looks at the incoming IP address and sets some variables which provide geolocation information for that IP. The variables it set depend on the specific GeoIP database being used (Country, City, ISP, etc.). These variables can be set in either the request notes table, the environment or both depending on the server configuration.

Lire la suite…

Sauvegarder ses données avec Rsync

21/01/2024 Comments off

Source: journaldunadminlinux.fr

En parcourant pas mal de forums, j’ai pu remarquer que pas mal de jeunes admins ne connaissaient pas Rync.

Rsync est un petit outil de sauvegarde extrêmement puissant. Grâce à cette outil j’ai pu sauvegarder des centaines de  giga-octet de données sans problèmes.

Rsync se charge en plus de garder tous les droits et attributs de vos fichiers et gère en natif SSH pour faire une sauvegarde d’une machine vers une autre. Lire la suite…

Connection par ssh derrière un proxy html

18/01/2024 Comments off

Par défaut, ssh ne sait pas se connecter à un serveur si le client est placé derrière un proxy. Pour ajouter cette fonctionnalité, il faut :

– installer le paquet connect-proxy

apt-get install connect-proxy

– ajouter un fichier  ~/.ssh/config (juste pour un compte) ou /etc/ssh/ssh_config (configuration globale) contenant les lignes suivantes :

# on n'a pas besoin de connect pour le réseau local
# il faut modifier ou ajouter des lignes Host pour décrire votre réseau local Host 192.168.0.* ProxyCommand /usr/bin/connect %h %p # toutes les autres adresses utilisent la commande connect
# il faut remplacer l'adresse IP et le port par les valeurs de votre proxy
Host *
ProxyCommand /usr/bin/connect -H 192.168.0.1:8080 %h %p

On peut alors se connecter sans problème à un hôte par la commande classique : ssh identifiant@serveur

Categories: Réseau, Système Tags: , , ,

Forcer logrotate à créer une nouvelle version d’un fichier de log

11/01/2024 Comments off

Récemment, je me suis aperçu que mon dernier fichier /var/log/auth.log n’avait pas été renouvelé depuis le 17/04/2011… Evidemment, ça n’aide pas à analyser sereinement les fichiers de logs, vu la taille que ça génère: 105306586 c’est-à-dire plus de 100Mo !

Je voulais conserver 26 semaines de logs pour analyser les tentatives d’intrusion et calculer leur évolution au fur et à mesure que je renforçais la protection de mon serveur.

Tout simple:

  • créer un fichier séparé pour auth.log qu’on appelle /etc/logrotate.d/auth:

/var/log/auth.log

{
        rotate 26
        weekly
        missingok
        notifempty
        compress
        delaycompress
        sharedscripts
        postrotate
                reload rsyslog >/dev/null 2>&1 || true
        endscript
}

  • retirer la référence à /var/log/auth.log dans /etc/logrotate.d/auth
  • redémarrer le service rsyslog:
/etc/init.d/rsyslog restart

Lire la suite…

Monitor Network Connections in Mac OS X for Free with Private Eye

11/01/2024 Comments off

Source: OSXdaily

Private Eye is a free real-time network monitor app for Mac OS X that is extremely easy to use. Upon launching the app, you’ll start to see all open network connections by application and process, and you can then filter connections by app, monitor all open connections, or watch only incoming or outgoing transfer.

private-eye-network-connection-monitor-mac

Connections are reported by application, the time of the connection, and arguably the most useful, the IP address that is being connected to by the app, making it easy to see socket and routing data, letting you know exactly what app is communicating with what server or IP address, for both local and broader internet networks. If you have any interest in networking, privacy, security, or you just want to keep an eye on what apps are connecting to the internet and to where, you should download this app, but it’s also an amazingly useful tool for troubleshooting network problems and figuring out what is using the network.

 

Download and install Private Eye by putting it into your /Applications/ folder, then open PrivateEye to get started. The list of open network connections is easy to read, you’ll see a time stamp of the connection, the application name, and where the connection is going to by IP (or coming from, as determined by the arrow pointing left for in, or right for out).

private-eye-connections

Using the left side menu you can quickly break down connections to see them all, only show incoming transfers, outgoing connections, or display connections by specific application only. Apps are easy to identify in this list, as are daemons running in the background (like PubSubAgent), and command line processes belonging to the user are also visible (ssh, for example).

This is a simple yet powerful tool without the complexity or the learning curves related to compiling and using the command line tools lsof, watch, open_ports, or wireshark, and is therefore highly recommended for anyone who is interested in seeing this kind of information, whether it’s out of general curiosity, or to help troubleshoot and diagnose specific network activities.