Sunday 29 April 2012

Canon 5D mk ii compared to 5D mk iii

Canon 5D mk iii comparison with 5D mk ii 

I have been a long term Canon user, investing thousands in lenses, and as a non-manual reader, am sure some of these functions can be changed, but for the time being, I haven't figured it out! 
This is on the 1.1.2 firmware 

1. Custom profiles 

They don't save the image profile. e.g. in C1 mode, you tell it to save to RAW, and save to CF, then swap to SD when full. Register that as C1. 
change to C2 mode, tell it to save to L JPG, and save to CF and SD at the same time. Register that profile as C2 S
swap back to C1 mode and check your image settings.
It's still L JPG - strange huh?

2. Focusing whilst recording video.

on my 5d mk ii, i can press the AF button for it to focus. On the mk iii I can't - it's probably an option, but I haven't figure out where yet!








1.1.2 firmware

Setting up OpenVPN on ubuntu / Mac os x pt2

Hardening OpenVPN on ubuntu / Mac os x

One of the often-repeated maxims of network security is that one should never place so much trust in a single security component that its failure causes a catastrophic security breach. OpenVPN provides several mechanisms to add additional security layers to hedge against such an outcome.

tls-auth

The tls-auth directive adds an additional HMAC signature to all SSL/TLS handshake packets for integrity verification. Any UDP packet not bearing the correct HMAC signature can be dropped without further processing. The tls-auth HMAC signature provides an additional level of security above and beyond that provided by SSL/TLS. It can protect against:
  • DoS attacks or port flooding on the OpenVPN UDP port.
  • Port scanning to determine which server UDP ports are in a listening state.
  • Buffer overflow vulnerabilities in the SSL/TLS implementation.
  • SSL/TLS handshake initiations from unauthorized machines (while such handshakes would ultimately fail to authenticate, tls-auth can cut them off at a much earlier point).
Using tls-auth requires that you generate a shared-secret key that is used in addition to the standard RSA certificate/key:
openvpn --genkey --secret ta.key
This command will generate an OpenVPN static key and write it to the file ta.key. This key should be copied over a pre-existing secure channel to the server and all client machines. It can be placed in the same directory as the RSA .key and .crt files.
In the server configuration, add:
tls-auth ta.key 0
In the client configuration, add:
tls-auth ta.key 1

proto udp

While OpenVPN allows either the TCP or UDP protocol to be used as the VPN carrier connection, the UDP protocol will provide better protection against DoS attacks and port scanning than TCP:
proto udp

user/group (non-Windows only)

OpenVPN has been very carefully designed to allow root privileges to be dropped after initialization, and this feature should always be used on Linux/BSD/Solaris. Without root privileges, a running OpenVPN server daemon provides a far less enticing target to an attacker.
user nobody
group nobody

Unprivileged mode (Linux only)

On Linux OpenVPN can be run completely unprivileged. This configuration is a little more complex, but provides best security.
In order to work with this configuration, OpenVPN must be configured to use iproute interface, this is done by specifying --enable-iproute2 to configure script. sudo package should also be available on your system.
This configuration uses the Linux ability to change the permission of a tun device, so that unprivileged user may access it. It also uses sudo in order to execute iproute so that interface properties and routing table may be modified.
OpenVPN configuration:
  • Write the following script and place it at: /usr/local/sbin/unpriv-ip:
  • #!/bin/sh
    sudo /sbin/ip $*
  • Execute visudo, and add the followings to allow user 'user1' to execute /sbin/ip:
  • user1 ALL=(ALL)  NOPASSWD: /sbin/ip
    You can also enable a group of users with the following command:
    %users ALL=(ALL)  NOPASSWD: /sbin/ip
  • Add the following to your OpenVPN configuration:
  • dev tunX/tapX
    iproute /usr/local/sbin/unpriv-ip
    Please note that you must select constant X and specify tun or tap not both.
  • As root add persistant interface, and permit user and/or group to manage it, the following create tunX (replace with your own) and allow user1 and group users to access it.
  • openvpn --mktun --dev tunX --type tun --user user1 --group users
  • Run OpenVPN in the context of the unprivileged user.
Further security constraints may be added by examining the parameters at the /usr/local/sbin/unpriv-ip script.

chroot (non-Windows only)

The chroot directive allows you to lock the OpenVPN daemon into a so-called chroot jail, where the daemon would not be able to access any part of the host system's filesystem except for the specific directory given as a parameter to the directive. For example,
chroot jail
would cause the OpenVPN daemon to cd into the jail subdirectory on initialization, and would then reorient its root filesystem to this directory so that it would be impossible thereafter for the daemon to access any files outside of jail and its subdirectory tree. This is important from a security perspective, because even if an attacker were able to compromise the server with a code insertion exploit, the exploit would be locked out of most of the server's filesystem.
Caveats: because chroot reorients the filesystem (from the perspective of the daemon only), it is necessary to place any files which OpenVPN might need after initialization in the jail directory, such as:
  • the crl-verify file, or
  • the client-config-dir directory.

More info here:
http://openvpn.net/index.php/open-source/documentation/howto.html#security 

Monday 16 April 2012

USB serial on mac os x

Generally you'll be using the same chipset all over - the PL2303
TO get this wokring, you'll need to download the driver from here:

http://sourceforge.net/projects/osx-pl2303/

Then you need the hyperterminal equivalent on Mac OS X, and you can actually run this in screen

If the driver is installed correctly you should have it displayed in dev

ls /dev/tty.*

and get something like this::
$ ls -al tty.*
crw-rw-rw- 1 root wheel 18, 4 Jan 25 07:32 tty.Bluetooth-Modem
crw-rw-rw- 1 root wheel 18, 8 Jan 25 07:32 tty.Bluetooth-PDA-Sync
crw-rw-rw- 1 root wheel 18, 10 Jan 25 09:20 tty.PL2303-0000103D
crw-rw-rw- 1 root wheel 18, 0 Jan 25 07:32 tty.SerialPort-1


then to set the speed you connect:

screen /dev/tty.PL2303-0000103D 9600

Easy Peasy!

Ctrl+A then control , to quit screen

 

Wednesday 11 April 2012

Getting Mac OS X to use google apps as a mail proxy

First of all, I have a macbook air which mails me everytime it wakes up, it's status and it's current IP.

I had this originally use my firewall at home as a mail proxy, but obviously, when am *not* at home, this doesn't work.

So what I configured is how to use google's mail server to act as my SMTP server over SSL - great huh?

I would suggest you setup a sub domain e.g. sub.domain.com so that it was it's own set of credentials and security, and doesn't use your main account (which will have admi rights for the entire domain) e.g. I own bobcats.org, and the address phil@bobcats.org, so I'll setup root@sub.bobcats.org as the subdomain and email address for my mac's admin account.

So what do you need to do?

*/ Setup postfix
*/ setup google
*/ setup DNS
*/ setup site verification (web)
*/ setup site verification (mail)
*/ Profit

Setup postfix

You'll need to setup a Simple Authentication and Security Layer (SASL)

vi /etc/postfix/sasl_passwd

with the following:
smtp.gmail.com:587 your.name@gmail.com:your.password

Create a postfix lookup table for SASL:
postmap /etc/postfix/sasl_passwd

Configure postfix with:

vi /etc/postfix/main.cf

with the following:
# Minimum Postfix-specific configurations.
mydomain_fallback = localhost
mail_owner = _postfix
setgid_group = _postdrop
relayhost=smtp.gmail.com:587
# Enable SASL authentication in the Postfix SMTP client.
smtp_sasl_auth_enable=yes
smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options=

# Enable Transport Layer Security (TLS), i.e. SSL.
smtp_use_tls=yes
smtp_tls_security_level=encrypt
tls_random_source=dev:/dev/urandom

Setup google


This will involve going into your dashboard - just google "google apps"
add your (sub) domain into the domain tab of settings.

Setup DNS

Point DNS to a webserver that you own 

Setup site verification (web)

This will involve placing a specially crafted text file (supplied by google) onto that site


Setup site verification (mail)

This will involve adding a TXT record for the above (sub)domain

Profit