6 nov 2015

Install/Config AutoMysqlBackup

Install/Config AutoMysqlBackup #Backup #Ubuntu
  • Download script de backup from: http://bit.ly/uM0aGw
  • Subir archivo descargado al equipo TARGET
    • scp automysqlbackup-v3.0_rc5.tar.gz root01@x.x.x.x:/tmp
  • Descomprimir automysqlbackup-v3.0_rc5.tar.gz en /tmp
    • ssh root01@x.x.x.x
    • mkdir /tmp/AutoMysqlBackup/
    • tar xzvf automysqlbackup-v3.0_rc5.tar.gz -C /tmp/AutoMysqlBackup
  • Verificar/Instalar camandos para Netbios
    • Verificar si esta instalado mount.cifs :sudo dpkg -l | grep smbfs
    • Instalar Samba file system utilities sino esta: sudo apt-get install smbfs
  • Ejecutar install.sh
    • cd /tmp/AutoMysqlBackup
    • chmod +x install.sh
    • sudo su && ./install.sh
  • Configurar Script myserver.conf
    • sudo vi /etc/automysqlbackup/myserver.conf
    • Cambiar linea 18 a: CONFIG_mysql_dump_username='backupDB'
    • Cambiar linea 21 a: CONFIG_mysql_dump_password='algo'
    • Cambiar linea 31 a: CONFIG_backup_dir='/var/backups/db/[hostname]/db'
    • sudo mkdir -p /var/backups/db/
    • Cambiar linea 85 a: CONFIG_do_weekly="7"
      Which day do you want weekly backups? (1 to 7 where 1 is Lunes)
    • Descomentar linea 167
    • Cambiar linea 176 a: CONFIG_mysql_dump_create_database='yes'
    • mount.cifs //x.x.x./backup$ /var/backups/db/ -o domain=domain,user=backupusr,password=xxxxx
    • mkdir -p /var/backups/db/ubuntu-db01/db
    • Crear tarea programada para ejecutarlo
      • 1. Create a script as below called runmysqlbackup using the lines below:

      • #~~~~ Copy From Below Here ~~~~
      • #!/bin/sh
      • export PATH=$PATH:/usr/bin:/usr/local/bin:/bin
      • # Donde se va a guardar el backup. Este es un site remoto mount.cifs
      • to="/var/backups/db"
      • if [ -f ${to}/testigo.txt ]
      • then
      • /usr/local/bin/automysqlbackup /etc/automysqlbackup/myserver.conf
      • chown root.root /var/backup/db* -R
      • find /var/backup/db* -type f -exec chmod 400 {} \;
      • find /var/backup/db* -type d -exec chmod 700 {} \;
      • else
      • umount ${to}
      • mount.cifs //x.x.x.x/backup$ ${to} -o domain=domain,user=backupusr,password=xxxxxx
      • echo "DISPOSITIVO SIN FUNCIONAR ... SE INTENTARA DESMONTAR y MONTAR !!!!"
      • date
      • if [ -f ${to}/testigo.txt ]
      • then
      • /usr/local/bin/automysqlbackup /etc/automysqlbackup/myserver.conf
      • chown root.root /var/backup/db* -R
      • find /var/backup/db* -type f -exec chmod 400 {} \;
      • find /var/backup/db* -type d -exec chmod 700 {} \;
      • echo "REALIZANDO EXITOSAMENTE LA SINCRONIZACION !!!"
      • else
      • echo "NO SE PUEDE INGRESAR AL RECURSO ....."
      • date
      • fi
      • fi
      • #~~~~~ Copy To Above Here ~~~~

      • 2. Save it to a suitable location or copy it to your /etc/cron.daily folder.

      • 3. Make it executable, i.e. chmod +x /etc/cron.daily/runmysqlbackup.
  • Crear usuario de base de datos con super-privilegios
    • #>mysql -u root -p
    • mysql> create user 'backupDB'@'localhost' IDENTIFIED BY 'algo';
    • mysql> grant all privileges on *.* to 'backupDB'@'localhost' ;
    • mysql> flush privileges;
    • mysql>\q
  • Auto montar el recurso NetBios cuando inicia el equipo
    • sudo vi /etc/rc.local
      Agregar linea: /sbin/mount.cifs //x.x.x.x/backup$ /var/backups/db/ -o domain=domain,user=backupusr,password=xxxx

20 oct 2015

PKI - Normas y RFC.


Debido a lo entramado de las normas/estándares que rigen el mundo de la PKI y en consecuencia los servicio basados en esta, me veo en la obligación de acomodarme un poco las ideas y tomar algunas referencias.

Estándares tecnológicos según la Jefatura de Gabinete de Ministros de la República Argentina

RFC 5280: Perfil de Certificado y lista de certificados revocados (CRL)
RFC 3739: Perfil de Certificado emitido a personas físicas
RFC 2560: OCSP
RSA, ECDSA, DSAM: Algoritmos para la generación del par de clave publica-privada
FIPS: Requisitos de seguridad para módulos de seguridad (Gobierno de USA)

Lo anterior, muy escueto comparado con el listado de Normas Técnicas del ministerio de economía de Chile.  Puntualmente lo que me interesa,  un indicio de las normativas que se aplican a TimeStamping.

e) Sellado de Tiempo/Time stamping:

ETSI TS 102 023, v.1.2.1 y v.1.2.2.
Electronic Signatures and Infrastructures (ESI);
Policy requirements for time-stamping authorities.

ETSI TS 101 861 V1.3.1 Time-stamping profile.

  • ISO/IEC 18014-1:2008 Information technology – Security techniques
- Time-stamping services – Part 1: Framework.
  • ISO / IEC 18014-2:2009 Information technology – Security techniques 
– Time-stamping services – Part 2: Mechanism producing independent tokens.
  • ISO / IEC 18014-3:2009 Information technology – Security techniques 
– Time-stamping services – Part 3: Mechanisms producing linked tokens.

RFC 3161 Internet X.509 Public Key Infrastructure Time – Stamp Protocol (TSP) (2001),
describes the format of a request sent to a Time Stamping Authority (TSA) 
and of the response that is returned

RFC 5816 (update), ANSI ASC X 9.95.
This document updates RFC 3161.  It allows the use of ESSCertIDv2, as
defined in RFC 5035, to specify the hash of a signer certificate when
the hash is calculated with a function other than the Secure Hash
Algorithm (SHA-1).

RFC 3628 Requirements for Times Stamping Authorities.
Este documento define los requisitos para una politica base de sellado de tiempo, para una autoridad de Sellado de tiempo, emitiendo tokens de sello de tiempo, soportado por certificados de clave publica, con una presicion de un segundo o mejor.
NIST Special publication 800-102, Sept.2009.


La siguiente la halle googleando, y lo interesante de esta en el  "Anexo A"

ETSI ETSI TS 102 176-1 V2.0.0 (2007-11)
Electronic Signature and Infraestructure (ESI) 
Algorithms and Parameters for Secure Electronic Signatures; 
Part 1:Hash function and asymmetric algorithms
Mil veces me he preguntado:

¿Cuales son el grupo de  RFCs y normas sostiene el estándar x509 y la PKI ?
¿ Que puedo tomar como referencia si necesito escribir documentos relacionados a certificados x509 o servicios relacionados a la PKI ?

La respuesta a mi entender comienza por aquí, con el conglomerado de normas que circunscriben a la PKI: http://www.oasis-pki.org/resources/techstandards/