Sunday, January 30, 2011

Crop Circle Muncul di Pesawahan di Magelang

Jakarta - Fenomena crop circle rupanya terjadi hingga sampai ke Magelang. Penduduk di Dusun Kumbangan, Desa Banyusari, Tegalrejo menemukan pola crop circle, mirip seperti di Sleman. Namun bentuknya lebih kecil.

Pantauan detikcom di lokasi, Minggu (30/1/2011) miri[p seperti di Sleman, ada padi yang rebah dan juga terbentuk 5 lubang. Paling besar adalah lubang di tengah yang besarnya 2,5 meter, sedang lubang lain yang mengapitnya berdiameter 1,5 meter.

Lokasi crop circle itu persis berada di depan pesantren Hidayatul Muhtadiin, hanya berjarak 100 meter. Lokasi crop circle itu ditemukan sekitar pukul 07.00 WIB oleh Muhaimin seorang santri ponpes.

"Saat itu saya mau ke sawah ke ladang padi, terus ada seperti ini," jelasnya di lokasi.

Muhaimin pun segera memberitahu teman-teman di pondok. Sontak kabar itu pun segera menyebar dari mulut ke mulut. Tidak heran, sejak pagi ratusan warga mendatangi lokasi itu.

Mereka memenuhi pematang sawah di sekitar crop circle. Untuk melihat pemandangan itu, warga tidak perlu menaiki sebuah pohon atau bukit, mereka bisa melihat melalui tanggul sawah yang lain. Kebetulan lokasi crop circle itu lebih rendah dari sawah lainnya.

Sementara itu petugas kepolisian juga sudah memasang garis polisi di sepanjang crop circle. Warga pun diminta untuk tidak mendekat.
Read More

Tuesday, January 25, 2011

Catatan Mikrotik

Moving a Simple Queue to position 0 via a script

/ip firewall mangle move [ /ip firewall mangle find chain="forward" dynamic=yes] 0

or

/queue simple move [/queue simple find name="Limit p2p"] 0

Sumber
Read More

Sunday, January 23, 2011

Linux Iptables allow SQUID proxy incoming client request

SQUID is a high‐performance proxy caching server for web clients, supporting FTP, gopher, and HTTP data objects etc. By default it listen on TCP 3128 port. Following

iptables rules allows SQUID incoming client request (open TCP port 3128) for server IP address 202.54.1.20:

iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d 202.54.1.20 --dport 3128 -m state --state NEW,ESTABLISHED -j ACCEPT

iptables -A OUTPUT -p tcp -s 202.54.1.20 --sport 3128 -d 0/0 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
Read More

Squid Proxy Server Limit the number of simultaneous Web connections from a client with maxconn ACL

So how do you limit the number of simultaneous web connections from a client browser system using the open source Squid proxy server?

You need to use squid ACCESS CONTROLS feature called maxconn. It puts a limit on the maximum number of connections from a single client IP address. It is an ACL that will be true if the user has more than maxconn connections open. It is used in http_access to allow/deny the request just like all the other acl types.

Step # 1: Edit squid conf file

Open /etc/squid/squid.conf file:
# vi /etc/squid/squid.conf

Step # 2: Setup maxconn ACL

Locate your ACL section and append config directive as follows:
acl ACCOUNTSDEPT 192.168.5.0/24
acl limitusercon maxconn 3
http_access deny ACCOUNTSDEPT limitusercon

Where,
  1. acl ACCOUNTSDEPT 192.168.3.0/24 : Our accounts department IP range
  2. acl limitusercon maxconn 3 : Set 3 simultaneous web access from the same client IP
  3. http_access deny ACCOUNTSDEPT limitusercon : Apply ACL

Save and close the file.


Restart squid

Restart the squid server, enter:
# /etc/init.d/squid restart
Read More

Saturday, January 22, 2011

Configure squid for LDAP authentication using squid_ldap_auth helper

My last post was about Squid proxy authentication using ncsa_auth helper. This time I will show you how to configure squid for LDAP authentication.

The Lightweight Directory Access Protocol, (LDAP) is a networking protocol for querying and modifying directory services running over TCP/IP.

LDAP server (such as OpenLDAP or others) uses the Lightweight Directory Access Protocol. In order to use Squid LDAP authentication you need to tell which program to use with the auth_param option in squid.conf. You specify the name of the program, plus command line options.

Squid comes with squid_ldap_auth helper. This helper allows Squid to connect to a LDAP directory to validate the user name and password of Basic HTTP authentication. This helper is located at /usr/local/squid/libexec/ or /usr/lib/squid or /usr/lib64/squid/ directory.

Step # 1: Make sure squid can talk to LDAP server

Before configuring makes sure that the squid is working with LDAP auth. Type the following command:
# /usr/lib/squid/squid_ldap_auth -b "dc=nixcraft,dc=com" -f "uid=%s" ldap.nixcraft.com

Once you hit enter key you need to provide UID and password using following format:
USERID blankspace PASSWORD

If it was able to connect to LDAP server you will see "ok".

Step # 2: Configuration

Open your squid.conf file:
# vi /etc/squid/squid.conf

Next you need to add following code which specifies the base DN under where your users are located and the LDAP server name.
auth_param basic program /usr/lib/squid/squid_ldap_auth -b "dc=nixcraft,dc=com" -f "uid=%s" -h ldap.nixcraft.com
acl ldapauth proxy_auth REQUIRED
http_access allow ldapauth
http_access deny all

Save and close the file. Restart Squid to take effect.
# /etc/init.d/squid restart

Zimbra LDAP With Squid

You need to use it as follows
/usr/lib/squid/squid_ldap_auth -v 3 -b dc=zimbra,dc=example,dc=com -f "(&(uid=%s)(objectClass=zimbraAccount))" -h zimbra.example.com

Squid authentication against Microsoft's Active Directory

I have not used group_ldap_auth helper against Microsoft's Active Directory. But someone (user) pointed out the following solution. Add following configuration directive to squid.conf:

ldap_auth_program /usr/lib/squid/group_ldap_auth -b dc=my-domain,dc=de -h \
server.my-domain.de -p 636 -g distinguishedName -d CN=lookup,OU=Services,\
OU=Users,DC=my-domain,DC=de -w lookup -u cn -m member -o group -S -l \
/var/log/squid/ldaplog

acl ldap_backoffice ldap_auth static 'CN=BackOffice,OU=Groups,dc=my-domain,dc=de'
acl ldap_management ldap_auth static 'CN=Management,OU=Groups,dc=my-domain,dc=de'
acl ldap_it-service ldap_auth static 'CN=IT-Service,OU=Groups,dc=my-domain,dc=de'
acl ldap_development ldap_auth static 'CN=DEVELOPMENT,OU=Groups,dc=my-domain,dc=de'

http_access allow ldap_development
http_access allow ldap_backoffice
http_access allow ldap_management
http_access allow ldap_it-service
http_access deny all

Further readings
  • man squid_ldap_auth
  • man group_ldap_auth

Featured Articles:
  1. Howto: Squid proxy authentication using ncsa_auth helper 
Read More

Howto: Squid proxy authentication using ncsa_auth helper

For fine control you may need to use Squid proxy server authentication. This will only allow authorized users to use proxy server.

You need to use proxy_auth ACLs to configure ncsa_auth module. Browsers send the user's authentication in the Authorization request header. If Squid gets a request and the http_access rule list gets to a proxy_auth ACL, Squid looks for the Authorization header. If the header is present, Squid decodes it and extracts a username and password.

However squid is not equipped with password authentication. You need to take help of authentication helpers. Following are included by default in most squid and most Linux distros:
=> NCSA: Uses an NCSA-style username and password file.
=> LDAP: Uses the Lightweight Directory Access Protocol
=> MSNT: Uses a Windows NT authentication domain.
=> PAM: Uses the Linux Pluggable Authentication Modules scheme.
=> SMB: Uses a SMB server like Windows NT or Samba.
=> getpwam: Uses the old-fashioned Unix password file.
=> SASL: Uses SALS libraries.
=> NTLM, Negotiate and Digest authentication

Configure an NCSA-style username and password authentication

I am going to assume that squid is installed and working fine.

Tip: Before going further, test basic Squid functionality. Make sure squid is functioning without requiring authorization :)

Step # 1: Create a username/password

First create a NCSA password file using htpasswd command. htpasswd is used to create and update the flat-files used to store usernames and password for basic authentication of squid users.
# htpasswd /etc/squid/passwd user1

Output:

New password:
Re-type new password:
Adding password for user user1

Make sure squid can read passwd file:
# chmod o+r /etc/squid/passwd

Step # 2: Locate nsca_auth authentication helper

Usually nsca_auth is located at /usr/lib/squid/ncsa_auth. You can find out location using rpm (Redhat,CentOS,Fedora) or dpkg (Debian and Ubuntu) command:
# dpkg -L squid | grep ncsa_auth

Output:

/usr/lib/squid/ncsa_auth

If you are using RHEL/CentOS/Fedora Core or RPM based distro try:
# rpm -ql squid | grep ncsa_auth

Output:

/usr/lib/squid/ncsa_auth

Step # 3: Configure nsca_auth for squid proxy authentication
Now open /etc/squid/squid.conf file
# vi /etc/squid/squid.conf

Append (or modify) following configration directive:
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
auth_param basic children 5auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off

Also find out your ACL section and append/modify
acl ncsa_users proxy_auth REQUIRED
http_access allow ncsa_users

Save and close the file.

Where,
  • auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd : Specify squid password file and helper program location
  • auth_param basic children 5 : The number of authenticator processes to spawn.
  • auth_param basic realm Squid proxy-caching web server : Part of the text the user will see when prompted their username and password
  • auth_param basic credentialsttl 2 hours : Specifies how long squid assumes an externally validated username:password pair is valid for - in other words how often the helper program is called for that user with password prompt. It is set to 2 hours.
  • auth_param basic casesensitive off : Specifies if usernames are case sensitive. It can be on or off only
  • acl ncsa_users proxy_auth REQUIRED : The REQURIED term means that any authenticated user will match the ACL named ncsa_users
  • http_access allow ncsa_users : Allow proxy access only if user is successfully authenticated.

Restart squid:
# /etc/init.d/squid restart

Now user is prompted for username and password.

Featured Articles:
xxxx
  • xxxx 
Read More

Saturday, January 15, 2011

Tips Monitoring Squid Proxy

squidclient -h host -p 80 mgr:info
squidclient -h host -p 80 mgr:counters
squidclient -h host -p 80 mgr:utilization
squidclient -h host -p 80 mgr:5min
squidclient -h host -p 80 mgr:60min
squidclient -h host -p 80 mgr:mem

untuk proxy di localhost, perintahnya diganti dengan

misal:

squidclient mgr:info

Untuk melihat option mgr: yang lain ketik
squidclient mgr:
Read More