Quantcast
Channel: Blog Virtualizacion
Viewing all 681 articles
Browse latest View live

Configurar SSL en apache Moodle

$
0
0

Configurar SSL en apache Moodle

Os enseño el procedimiento para configurar SSL en vuestro servidor web linux, en este caso lo haremos sobre Centos 7 y Moodle, pero realmente puede serviros para cualquier servidor linux apache.

Lo primero que haremos es instalar el módulo ssl necesario:

yum install mod_ssl

Tendréis que bajar vuestro certificado desde vuestro proveedor de servicios si lo habéis comprado. Os dejo como convertirlo si sólo os dan un certificado CER:

CONVERTIR CER A CRT (Certificado intermedio)

openssl x509 -in DER -in ssl_certificate.cer -out ssl_certificate.crt

openssl x509 -in PEM -in ssl_certificate.cer -out ssl_certificate.crt
Podéis usar Filezilla para subir los ficheros al servidor web de Moodle:

configurar-ssl-en-apache-moodle-1 configurar-ssl-en-apache-moodle-2

Primero podemos validar los certificados SSL dentro de /etc/httpd:

[root@moodle ~]# grep -i -r "SSLCertificateFile" /etc/httpd/
/etc/httpd/conf.d/ssl.conf:# Point SSLCertificateFile at a PEM encoded certificate. If
/etc/httpd/conf.d/ssl.conf:SSLCertificateFile /etc/pki/tls/certs/localhost.crt
/etc/httpd/conf.d/ssl.conf:# the referenced file can be the same as SSLCertificateFile

Para configurar el virtual host de apache, nos colocaremos en el siguiente directorio:

[root@moodle conf.d]# cd /etc/httpd/conf.d

Si existe un fichero moodle.conf realizamos una copia:

[root@moodle conf.d]# cp moodle.conf moodle.conf.old

Personalmente, voy a colocar el certificado público, la key privada y el certificado intermedio en los siguientes directorios:

CERTIFICADO PUBLICO: /usr/local/ssl/crt/publico.crt
KEY: /usr/local/ssl/private/privado.key
CERTIFICADO INTERMEDIO: /usr/local/ssl/crt/intermedio.crt

Como imaginaréis no importa como les llaméis. Lo importante es que se referencie a ellos en el fichero conf correctamente:

[root@moodle conf.d]# cat moodle.conf

# General setup for the virtual host, inherited from global configuration
DocumentRoot "/var/www/html/moodle"
ServerName moodle.maquinasvirtuales.eu:443

SSLEngine on

SSLCertificateFile /usr/local/ssl/crt/publico.crt
SSLCertificateKeyFile /usr/local/ssl/private/privado.key
SSLCertificateChainFile /usr/local/ssl/crt/intermedio.crt

ServerAlias maquinasvirtuales.eu

Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all

ErrorLog /var/log/httpd/moodle.maquinasvirtuales.eu-error_log
CustomLog /var/log/httpd/moodle.maquinasvirtuales.eu-access_log common

Testeamos que no hemos cometido errores y el servicio no arranque:

[root@moodle conf.d]# apachectl configtest
Syntax OK

Por último, añadiremos al fichero de configuración de moodle https a la url original:

//=========================================================================
// 2. WEB SITE LOCATION
//=========================================================================
// Now you need to tell Moodle where it is located. Specify the full
// web address to where moodle has been installed. If your web site
// is accessible via multiple URLs then choose the most natural one
// that your students would use. Do not include a trailing slash
//
// If you need both intranet and Internet access please read
// http://docs.moodle.org/en/masquerading

$CFG->wwwroot = 'https://moodle.maquinasvirtuales.eu';

Reiniciamos apache:

[root@moodle conf.d]# systemctl restart httpd

Con esto ya sólo hay que validar que el candado del navegador nos muestra un certificado válido:

configurar-ssl-en-apache-moodle-0

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

 

La entrada Configurar SSL en apache Moodle se publicó primero en Blog VMware y Citrix.


Deshabilitar Firewall Windows vía Powershell

$
0
0

Deshabilitar Firewall Windows vía Powershell

Entrada rápida, os enseño como podéis deshabilitar vuestro firewall Windows vía Powershell.

Si necesitáis algo más de información de como manejaros con vuestro Firewall Windows vía comando, lo podéis ver en la siguiente entrada anterior:

Firewall Windows vía Powershell

Así que os dejo los comandos, como siempre hay varias opciones:

netsh advfirewall set allprofiles state off

O podéis usar:

Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False

Si queréis comprobar el estado:

netsh advfirewall show allprofiles state

deshabilitar-firewall-windows-via-powershell-1

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Deshabilitar Firewall Windows vía Powershell se publicó primero en Blog VMware y Citrix.

Testear una infraestructura Citrix

$
0
0

Testear una infraestructura Citrix

Hoy voy a enseñaros cómo deberíamos realizar una auditoría de una infraestructura Citrix si lo que buscamos son problemas comunes como logons lentos, caída de dashboard, probar HA de la infraestructura,…

Partimos de una infraestructura base, con Netscaler, Storefront, Delivery Controller, Servidor de licencias y SQL, cada role en varios nodos.

testear-una-infraestructura-citrix-2

Vamos a ello:

– Test logon usuario Citrix:

o Habilitamos la auditoría vía GPO para que se generen eventos en las VDAs
o Medimos el tiempo de arranque de la sesión (podéis usar el visor de eventos como ya hemos explicado en otras entradas, ejecutar control up o su script gratuito,…)
o Revisamos la generación del perfil móvil (es interesante que genere log para saber si existen problemas dependiendo de si usáis UPM, Folder Redirection, FSLogix,…)
o Guardamos datos, cerramos sesión y comprobamos que se guardan sin problema
o Revisar transferencia de ficheros grandes y muchos pequeños, ambos un foco grande de problemas en según que tecnologías de perfilado
o Repetimos el procedimiento con el mayor número de perfiles (diferentes tamaños si es posible)
o Revisaremos que intervienen los diferentes controladores de dominio en el proceso de logon. El visor de eventos nos da donde se ha logueado el usuario en la sesión, sino podemos abrir un CMD y hacer un «gpresult /r» y extraer el dato. Un controlador de dominio con problemas puede ser una de las primeras fuentes de logons lentos.
o Revisar las GPOs que se le aplican a los usuarios. Puede haber problemas de GPOs que están fuera de nuestro control, sobre todo en organizaciones grandes
o Revisar el tamaño del perfil generado y su crecimiento en cada logon
o Revisar con Citrix Director en el tiempo la degradación de los logons. De tal forma que puedas asociar horas, usuarios, VDAs,…y puedas sacar un patrón.

– Test Netscaler:

o Apagamos uno de los appliance
o Revisamos que el dashboard sigue funcional
o Realizamos logueo de usuarios
o Y repetimos el procedimiento con el otro appliance

– Test Storefront:

o Apagamos uno de los nodos
o Revisamos que el dashboard sigue funcional
o Realizamos logueo de usuarios
o Y repetimos el procedimiento con el otro nodo

– Test Delivery Controllers:

o Apagamos uno de los nodos
o Realizamos un logon de usuarios aleatorio para validar
o Y repetimos el procedimiento con el otro nodo

– Test SQL:

o Si existe alta disponibilidad deberemos comprobar periódicamente que no existe ningún error en ninguno de los nodos
o Apagamos uno de los nodos
o Realizamos un logon para verificar que las bases de datos están dando servicio

– Test Servidor de licencias:

o Si existe alta disponibilidad deberemos comprobar periódicamente que no existe ningún error en ninguno de los nodos
o Apagamos uno de los nodos
o Realizamos un logon para verificar que las bases de datos están dando servicio
o Comprobar el número de licencias a través de la consola de gestión del servidor de licencias o desde Citrix Studio

– Test Hosting:

o Si disponemos de una infraestructura Citrix, por ejemplo, enlazada a VMware o Hyper-V, podemos verificar la conexión a través de Citrix Studio. Si perdemos el enlace, es posible que las VDAs no se ejecuten

Y repetimos el procedimiento con los diferentes nodos de la infraestructura.

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Testear una infraestructura Citrix se publicó primero en Blog VMware y Citrix.

Crear Teaming en Centos 7

$
0
0

Crear Teaming en Centos 7

Os voy a enseñar a configurar teaming en Centos/RedHat 7. Un teaming es un agregado de tarjetas de red dentro de nuestro sistema operativo. Ya os explicamos como hacerlo en Windows Server con Hyper-V, hoy lo haremos con un Centos 7 y dos interfaces de red a 1Gb.

En los kernel actuales ya existe el controlador que nos permite generarlo. Podéis validarlo de la siguiente forma:

[root@centos ~]# rpm -qa | grep teamd
teamd-1.27-5.el7.x86_64

Incluso aunque no exista podéis instalarlo:

[root@centos ~]# modprobe team
[root@centos ~]# yum -y install teamd
Complementos cargados:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 30 kB 00:00
* base: mirror.gadix.com
* epel: mirror.bytemark.co.uk
* extras: repo.nixval.com
* updates: repo.nixval.com
base | 3.6 kB 00:00
docker-ce-stable | 3.5 kB 00:00
epel | 5.3 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
(1/2): epel/x86_64/primary_db | 6.7 MB 00:00
(2/2): epel/x86_64/updateinfo | 975 kB 00:01
El paquete teamd-1.27-5.el7.x86_64 ya se encuentra instalado con su versión más reciente
Nada para hacer

Os voy a enseñar como se configura a través de ifcfg (se podría hacer vía json). Hacemos un pequeño listado de las interfaces que tenemos disponible, en mi caso usaré eno2 y ens1f1. Son dos tarjetas independientes:

[root@centos ~]# ip addr
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno1: mtu 1500 qdisc mq state UP group default qlen 1000
link/ether a0:1d:48:c7:79:48 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.187/24 brd 192.168.2.255 scope global noprefixroute dynamic eno1
valid_lft 68281sec preferred_lft 68281sec
inet6 fe80::1e61:a2aa:6c6b:7743/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: eno2: mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether a0:1d:48:c7:79:49 brd ff:ff:ff:ff:ff:ff
4: ens1f0: mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 6c:b3:11:1b:47:66 brd ff:ff:ff:ff:ff:ff
5: ens1f1: mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 6c:b3:11:1b:47:67 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.159/24 brd 192.168.2.255 scope global noprefixroute dynamic ens1f1
valid_lft 78sec preferred_lft 78sec
inet6 fe80::3b59:14aa:41d3:e86/64 scope link noprefixroute
valid_lft forever preferred_lft forever
6: privatebr0: mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:60:b9:0a brd ff:ff:ff:ff:ff:ff
7: privatebr0-nic: mtu 1500 qdisc pfifo_fast master privatebr0 state DOWN group default qlen 1000
link/ether 52:54:00:60:b9:0a brd ff:ff:ff:ff:ff:ff
8: virbr0: mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:20:fb:f2 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
9: virbr0-nic: mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:20:fb:f2 brd ff:ff:ff:ff:ff:ff
10: docker0: mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:d4:51:2a:95 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever

Generaremos un fichero en la ruta /etc/sysconfig/network-scripts:

[root@centos ~]# cd /etc/sysconfig/network-scripts

Creamos el fichero:

[root@centos network-scripts]# vi ifcfg-team0

Con el siguiente contenido (cambiar IP, Dhcp,…):

DEVICE=team0
DEVICETYPE=Team
ONBOOT=yes
BOOTPROTO=none
NM_CONTROLLED=no
IPADDR=192.168.2.188
PREFIX=24
TEAM_CONFIG='{"runner": {"name": "activebackup"}, "link_watch": {"name": "ethtool"}}'

Hacemos un backup de la configuración de las dos tarjetas:

[root@centos network-scripts]# cp ifcfg-eno2 ifcfg-eno2.bak
[root@centos network-scripts]# cp ifcfg-ens1f1 ifcfg-ens1f1.bak

Ahora editamos los dos ficheros y los modificamos de esta forma.

Modificación eno2:

TYPE=Ethernet
NM_CONTROLLER=no
NAME=eno2
UUID=ea563bb4-d5b0-4ee2-80c3-97f69fd3bae1
DEVICE=eno2
ONBOOT=yes
DEVICETYPE=TeamPort
TEAM_MASTER=team0
TEAM_PORT_CONFIG='{"prio": 100}'

Modificación ens1f1:

TYPE=Ethernet
NM_CONTROLLER=no
NAME=ens1f1
UUID=12ee81a8-f534-4d49-85ed-dc6e220f333e
DEVICE=ens1f1
ONBOOT=yes
TYPE=Ethernet
DEVICETYPE=TeamPort
TEAM_MASTER=team0
TEAM_PORT_CONFIG='{"prio": 100}'

Tenemos que tirar los interfaces porque sino no podemos crear el teaming:

[root@centos network-scripts]# ip link set eno2 down
[root@centos network-scripts]# ip link set ens1f1 down

Ahora levantamos el teaming:

[root@centos network-scripts]# ifup team0

Verificamos que todo está OK:

[root@centos network-scripts]# nmcli device status
DEVICE TYPE STATE CONNECTION
eno2 ethernet unmanaged --
ens1f1 ethernet unmanaged --
team0 team unmanaged --

O con el siguiente comando:

[root@centos network-scripts]# teamdctl team0 state

Si por lo que sea, necesitáis eliminar vuestro teaming en linux Centos 7, simplemente podéis usar el comando:

[root@centos network-scripts]# teamd -t team0 -k

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Crear Teaming en Centos 7 se publicó primero en Blog VMware y Citrix.

Docker container: Backup y Recovery

$
0
0

Docker container: Backup y Recovery

Hoy voy a enseñaros como manejar copias de seguridad de Contenedores en Docker. La idea es hacer copias de seguridad de vuestras imágenes de contenedores.

Presuponemos que el contenedor está generado por una imagen preconfigurada. En nuestro ejemplo, usaremos el contenedor de grafana-xxl, que en un principio ya está en ejecución en el sistema operativo.

Crear copia de seguridad de Docker Container

Lo primero que haremos es listar los contenedores que están corriendo en el sistema:

[raulunzue@centos ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cc76fe063875 monitoringartist/grafana-xxl:latest "/run.sh" 4 days ago Up 4 days 0.0.0.0:3000->3000/tcp grafana-xxl

Lo que buscamos es hacer una instantánea de ese contenedor en ejecución, ya que probablemente es el que nos interesa:

[raulunzue@centos ~]$ docker commit -p cc76fe063875 backupgrafanaxxl01
sha256:0e5190bbfceede116beff34a307ce22d6930b5ebdda75e60aea7d5860ab8709f

Si investigáis un poco en el contenedor podéis saber todos los datos del mismo:

[raulunzue@centos ~]$ docker inspect backupgrafanaxxl01
[
{
"Id": "sha256:0e5190bbfceede116beff34a307ce22d6930b5ebdda75e60aea7d5860ab8709f",
"RepoTags": [
"backupgrafanaxxl01:latest"
],
"RepoDigests": [],
"Parent": "sha256:a9c1e4fc80a6b512c9f327ed5ae728d37716ad49201e53a16fd9efdda1b78b0b",
"Comment": "",
"Created": "2019-06-25T11:03:20.811088811Z",
"Container": "cc76fe06387535f8c0984238d5979b86ba9591ea2db0f39fc0fc05897291a6cf",
"ContainerConfig": {
"Hostname": "cc76fe063875",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3000/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GRAFANA_ARCHITECTURE=amd64",
"GRAFANA_VERSION=6.2.1",
"GRAFANA_DEB_URL=https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_6.2.1_amd64.deb",
"GOSU_BIN_URL=https://github.com/tianon/gosu/releases/download/1.10/gosu-amd64",
"GF_PLUGIN_DIR=/grafana-plugins",
"GF_PATHS_LOGS=/var/log/grafana",
"GF_PATHS_DATA=/var/lib/grafana",
"GF_PATHS_CONFIG=/etc/grafana/grafana.ini",
"GF_PATHS_HOME=/usr/share/grafana",
"UPGRADEALL=true"
],
"Cmd": null,
"ArgsEscaped": true,
"Image": "monitoringartist/grafana-xxl:latest",
"Volumes": {
"/etc/grafana": {},
"/var/lib/grafana": {},
"/var/log/grafana": {}
},
"WorkingDir": "",
"Entrypoint": [
"/run.sh"
],
"OnBuild": null,
"Labels": {}
},
"DockerVersion": "18.09.6",
"Author": "",
"Config": {
"Hostname": "cc76fe063875",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3000/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GRAFANA_ARCHITECTURE=amd64",
"GRAFANA_VERSION=6.2.1",
"GRAFANA_DEB_URL=https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_6.2.1_amd64.deb",
"GOSU_BIN_URL=https://github.com/tianon/gosu/releases/download/1.10/gosu-amd64",
"GF_PLUGIN_DIR=/grafana-plugins",
"GF_PATHS_LOGS=/var/log/grafana",
"GF_PATHS_DATA=/var/lib/grafana",
"GF_PATHS_CONFIG=/etc/grafana/grafana.ini",
"GF_PATHS_HOME=/usr/share/grafana",
"UPGRADEALL=true"
],
"Cmd": null,
"ArgsEscaped": true,
"Image": "monitoringartist/grafana-xxl:latest",
"Volumes": {
"/etc/grafana": {},
"/var/lib/grafana": {},
"/var/log/grafana": {}
},
"WorkingDir": "",
"Entrypoint": [
"/run.sh"
],
"OnBuild": null,
"Labels": {}
},
"Architecture": "amd64",
"Os": "linux",
"Size": 790024499,
"VirtualSize": 790024499,
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/14202c8bf378d452347f07d69a4d17d01e7d781f5b2ad9fea3a002b1ae3a7dbb/diff:/var/lib/docker/overlay2/0955b0413fabec8 cb011f85495e99ad715b14ef61f39ff14006a8dc663f0480e/diff:/var/lib/docker/overlay2/5235c4068fc2e7913c29cfda1bc4ef36ed6413e4536b2f0b2c05fe28371f379a/diff",
"MergedDir": "/var/lib/docker/overlay2/3c0d6a2918b4c7f7aaa6de57a062e193237eb7297d97064feaba7a951d593cbb/merged",
"UpperDir": "/var/lib/docker/overlay2/3c0d6a2918b4c7f7aaa6de57a062e193237eb7297d97064feaba7a951d593cbb/diff",
"WorkDir": "/var/lib/docker/overlay2/3c0d6a2918b4c7f7aaa6de57a062e193237eb7297d97064feaba7a951d593cbb/work"
},
"Name": "overlay2"
},
"RootFS": {
"Type": "layers",
"Layers": [
"sha256:f94641f1fe1f5c42c325652bf55f0513c881c86b620b912b15460e0bca07cc12",
"sha256:fc3434cd97f444ecbbbf69c152653dea7897de2b4a3f061e1ade8ccc98ba84b6",
"sha256:38b2eaf8ddcd97ecfd98e581606e13f47512267a974fc83bd2e3385227801cba",
"sha256:d686a6c01b25d5820c7d13499d1c9a18367ad27b7d5d43e794c5affc926bdd95"
] },
"Metadata": {
"LastTagTime": "2019-06-25T13:03:20.814415369+02:00"
}
}
]

Listamos las imágenes, y veremos que se ha generado una nueva:

[raulunzue@centos ~]$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
backupgrafanaxxl01 latest 0e5190bbfcee 7 minutes ago 790MB
monitoringartist/grafana-xxl latest a9c1e4fc80a6 3 weeks ago 790MB
nginx alpine dd025cdfe837 6 weeks ago 16.1MB
centos.negu.local:5000/centos latest 9f38484d220f 3 months ago 202MB
centos latest 9f38484d220f 3 months ago 202MB
hello-world latest fce289e99eb9 5 months ago 1.84kB

Ahora exportamos la imagen a un fichero TAR, que luego podremos recuperar:

[raulunzue@centos ~]$ docker save -o backupgrafanaxxl01.tar backupgrafanaxxl01

Podéis llevar ese punto TAR a un recurso externo, ejemplo NFS.

Recuperar imagen Docker Container

Ahora vamos a intentar restaurar la copia de seguridad TAR. Borramos la imagen, por ejemplo:

[raulunzue@centos ~]$ docker rmi backupgrafanaxxl01
Untagged: backupgrafanaxxl01:latest
Deleted: sha256:0e5190bbfceede116beff34a307ce22d6930b5ebdda75e60aea7d5860ab8709f
Deleted: sha256:f926b4815a7f5119102a08366fddf34b1689b9d61eaacbe8ade03e7894a8a1eb

Y cargamos la imagen:

[raulunzue@centos ~]$ docker load -i backupgrafanaxxl01.tar
d686a6c01b25: Loading layer 1.536kB/1.536kB
Loaded image: backupgrafanaxxl01:latest

Y la tendréis en el repositorio para utilizarla nuevamente:

[raulunzue@centos ~]$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
backupgrafanaxxl01 latest 0e5190bbfcee 8 hours ago 790MB
monitoringartist/grafana-xxl latest a9c1e4fc80a6 3 weeks ago 790MB
nginx alpine dd025cdfe837 6 weeks ago 16.1MB
centos.negu.local:5000/centos latest 9f38484d220f 3 months ago 202MB
centos latest 9f38484d220f 3 months ago 202MB
hello-world latest fce289e99eb9 5 months ago 1.84kB

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Docker container: Backup y Recovery se publicó primero en Blog VMware y Citrix.

Instalar Grafana a través de Docker

$
0
0

Instalar Grafana a través de Docker

Hoy voy a enseñaros lo fácil que es generar un servidor de grafana para monitorización a través de proyectos github. En este caso, hablamos de grafana-xxl, os dejo la URL:

https://github.com/monitoringartist/grafana-xxl

Lanzamos la ejecución en modo no persistente para hacer una prueba, que es muy sencillo:

[root@centos ~]# docker run -d --name=grafana-xxl -p 3000:3000 monitoringartist/grafana-xxl:latest
Unable to find image 'monitoringartist/grafana-xxl:latest' locally
latest: Pulling from monitoringartist/grafana-xxl
c5e155d5a1d1: Pull complete
636812ca4cd8: Pull complete
89336075b74f: Pull complete
Digest: sha256:0ca7441bf76ae97473350078dca504974de65d7748927361fe00ae1dcdec92c9
Status: Downloaded newer image for monitoringartist/grafana-xxl:latest
WARNING: IPv4 forwarding is disabled. Networking will not work.
cc76fe06387535f8c0984238d5979b86ba9591ea2db0f39fc0fc05897291a6cf

Revisamos si existe el contenedor arrancado:

[root@centos ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cc76fe063875 monitoringartist/grafana-xxl:latest "/run.sh" 3 minutes ago Up 3 minutes 0.0.0.0:3000->3000/tcp grafana-xxl

Si queremos crear un storage persistente para grafana podríamos crear un directorio:

[raulunzue@centos ~]$ sudo mkdir /var/lib/grafana
[sudo] password for raulunzue:

Generamos un contenedor para el storage con busybox:

[root@centos ~]# docker run -d -v /var/lib/grafana --name grafana-xxl-storage busybox:latest
WARNING: IPv4 forwarding is disabled. Networking will not work.
91ec442ca363ca46ff8d961e752a476d5a746e6e9a9cca78fbb73edab7477308

Y generaríamos el contenedor de la siguiente manera:

[root@centos ~]# docker run -d -p 3000:3000 --name grafana-xxl --volumes-from grafana-xxl-storage monitoringartist/grafana-xxl:latest

En mi caso, hago NAT desde el host físico, así que voy a la URL de mi host físico en el puerto 3000. Se abrirá un portal con usuario y contraseña por defecto admin / admin :

instalar-grafana-a-traves-de-docker-1

Podemos cambiar la contraseña al primer logon:

instalar-grafana-a-traves-de-docker-2

Y comenzaría el proceso de configuración de Grafana:

instalar-grafana-a-traves-de-docker-3

Crear docker MySQL persistente para Grafana

Tenemos que agregar una base de datos, así que generamos una con un contenedor de MySQL, por ejemplo:

[root@centos ~]# docker run -d -p 33060:3306 --name mysql-db -e MYSQL_ROOT_PASSWORD=grafanadbpasswd mysql
Unable to find image 'mysql:latest' locally
latest: Pulling from library/mysql
fc7181108d40: Pull complete
787a24c80112: Pull complete
a08cb039d3cd: Pull complete
4f7d35eb5394: Pull complete
5aa21f895d95: Pull complete
a742e211b7a2: Pull complete
0163805ad937: Pull complete
87f18876c3ff: Pull complete
78082f25f167: Pull complete
0a510f055c17: Pull complete
312b0999e433: Pull complete
f864cfdc0264: Pull complete
Digest: sha256:415ac63da0ae6725d5aefc9669a1c02f39a00c574fdbc478dfd08db1e97c8f1b
Status: Downloaded newer image for mysql:latest
9df7b734e0d8f26943a48a7ca541ecb71e5a6c30a522204776dafe2dcfc4f4f0

Os explico cada parámetro:

-d: Detached Mode es la forma en que indicamos que corra en background
-p : puerto, el contenedor corre en el puerto 3306 pero hacemos un bind para que lo escuchemos en Host el puerto 33061
–name : le asignamos un nombre al contenedor para no usar el hash
-e : asignamos una contraseña

Nos aseguramos que están corriendo ambos contenedores:

[root@centos ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9df7b734e0d8 mysql "docker-entrypoint.s…" 3 minutes ago Up 3 minutes 33060/tcp, 0.0.0.0:33060->3306/tcp mysql-db
cd1e967aecd7 monitoringartist/grafana-xxl:latest "/run.sh" 25 hours ago Up 25 hours 0.0.0.0:3000->3000/tcp grafana-xxl

Nos conectamos al contenedor MySQL:

[root@centos ~]# docker exec -it mysql-db mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.16 MySQL Community Server - GPL

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Generamos una base de datos:

mysql> create database grafanadb;
Query OK, 1 row affected (0.01 sec)

Comprobamos:

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| grafanadb |
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)

Al añadir el Data Source elegiremos MySQL:

instalar-grafana-a-traves-de-docker-5

Configuráis los datos con los datos de vuestra base de datos y la conexión al host físico en este caso, al puerto 33060, usuario root si no configuráis otro, contraseña la misma que al generar el contenedor y realizamos un test:

instalar-grafana-a-traves-de-docker-7

Ya podemos seguir con la configuración restante:

instalar-grafana-a-traves-de-docker-8

En pocos pasos tendremos Grafana operativo con Docker Container.

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Instalar Grafana a través de Docker se publicó primero en Blog VMware y Citrix.

Activar Windows por Powershell

$
0
0

Activar Windows por Powershell

Entrada rápida, os explico como podéis activar Windows desde una consola de comandos, ya sea CMD como PowerShell.

Es bastante sencillo, necesitaréis el número de vuestra licencia y el siguiente comando que habrá que lanzar conjuntamente:

slmgr.vbs /ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Activar Windows por Powershell se publicó primero en Blog VMware y Citrix.

Abrir ping ICMP en Firewall Windows

$
0
0

Abrir ping ICMP en Firewall Windows

Hay veces que es necesario disponer de una prueba o validación de conectividad entre equipos para diferentes pruebas. Una sencilla, que no siempre la más válida, es un PING o ICMP.

Imaginaros que configuráis un servicio o unas IPs en una máquina virtual, y tenéis que testear la conectividad entre máquinas virtuales sin que existan firewalls entre dichas máquinas salvo el de Windows.

Por defecto, el firewall de Windows tiene bloqueado el PING, así que para poder abrirlo vía gráfica tendréis que ir al «Asistente para nueva regla de entrada» y generaremos una regla «Predefinida -> Compartir archivos e impresoras«:

abrir-ping-icmp-en-firewall-windows-1

Simplemente seleccionamos «Archivos e impresoras compartidos (petición eco: ICMPv4)»

abrir-ping-icmp-en-firewall-windows-2

Con esto ya tendréis ICMP abierto.

Abrir ICMP / Ping vía Powershell

Si lo queréis hacer por comando estos son los comandos:

#IPv4
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol="icmpv4:8,any" dir=in action=allow

#IPv6
netsh advfirewall firewall add rule name="ICMP Allow incoming V6 echo request" protocol="icmpv6:8,any" dir=in action=allow

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Abrir ping ICMP en Firewall Windows se publicó primero en Blog VMware y Citrix.


Añadir o Quitar equipo del dominio Windows vía Powershell

$
0
0

Añadir o Quitar equipo del dominio Windows vía Powershell

Entrada rápida, os explico cómo quitar o añadir un equipo en un dominio Windows vía comando de Powershell o CMD.

AGREGAR O QUITAR EQUIPO DEL DOMINIO POR CMD

Si queréis eliminar la máquina del dominio vía comando CMD:

netdom remove PCELBLOGDENEGU01 /Domain:NEGU.LOCAL /UserD:administrador /PasswordD:* /Force

Si queréis agregar el equipo al dominio Windows vía comando CMD:

netdom add PCELBLOGDENEGU01 /ud:NEGU\administrador /pd:password

Si lo que queréis es agregar la máquina en una OU concreta:

netdom add /d:negu.local PCELBLOGDENEGU01 /OU:OU=LAB,OU=Workstations,DC=negu,DC=local

AGREGAR O QUITAR EQUIPO DEL DOMINIO POR POWERSHELL

Añadir un equipo al dominio de Active Directory:

Add-Computer -ComputerName "PCELBLOGDENEGU01" -DomainName "NEGU.LOCAL" -Credential NEGU\Administrador -Restart -Force

Quitar equipo del dominio de Active Directory:

Remove-Computer -ComputerName "PCELBLOGDENEGU01" -Credential NEGU\Administrador -Restart -Force

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Añadir o Quitar equipo del dominio Windows vía Powershell se publicó primero en Blog VMware y Citrix.

Ejecutar Powershell como administrador

$
0
0

Ejecutar Powershell como administrador

Hoy entrada rápida, os explicamos como ejecutar powershell con permisos de administrador vía comando, sin necesidad de lanzarlo vía gráfica.

Lo que tenéis que hacer es abrir una consola de powershell y lanzar los siguientes comandos:

Si queréis abrir Powershell ISE como Administrador:

Windows PowerShell

Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Users\runzue> Start-Process powershell_ise -Verb runAs

Si queréis abrir una de Powershell como Administrador:

Windows PowerShell

Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Users\runzue> Start-Process powershell -Verb runAs

ejecutar-powershell-como-administrador-2

Siempre os puede quedar lanzarlo vía gráfica:

ejecutar-powershell-como-administrador-1

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Ejecutar Powershell como administrador se publicó primero en Blog VMware y Citrix.

Instalar VMware Workstation 15 en Centos 7

$
0
0

Instalar VMware Workstation 15 en Centos 7

Hoy vamos a explicaros como podéis instalar el VMware Workstation PRO 15 en linux, en concreto en una distribución Centos 7. Para los que ya llevamos unos años en esto, me recuerda a VMware Server en un sus orígenes, cuando no existía ni vCenter ni ESXi… Ha cambiado todo un poquito…

Podéis instalar la versión de prueba y no hace falta cuenta de VMware para la descarga de unos 472 MB.

Os dejo el enlace de descarga:

https://www.vmware.com/es/products/workstation-pro/workstation-pro-evaluation.html

instalar-vmware-workstation-15-en-centos-7-1

Una vez disponéis del fichero .bundle lo lleváis a la máquina donde vais a proceder la instalación. Yo lo hago desde mi MacBook Pro por SCP, cambiando el puerto:

MacBook-Pro-de-Raul:~ raulunzue$ scp -P 2222 ./Downloads/VMware-Workstation-Full-15.1.0-13591040.x86_64.bundle root@192.168.2.187:/root
root@192.168.2.187's password:
VMware-Workstation-Full-15.1.0-13591040.x86_6 26% 127MB 5.8MB/s 00:59 ETA

instalar-vmware-workstation-15-en-centos-7-2

Ahora vamos con la instalación. Tiene dependencias como gcc o kernel-headers. Yo actualizaría el sistema previamente:

yum install gcc kernel-headers -y

Lanzamos vía consola como root. Y pulsamos Enter:

[root@centos ~]# sh VMware-Workstation-Full-15.1.0-13591040.x86_64.bundle
Extracting VMware Installer...done.
You must accept the VMware Workstation End User License Agreement to
continue. Press Enter to proceed.

Aceptamos la licencia con un YES:

agreements, whether written or oral, between the parties regarding the
subject matter hereof. This EULA may be amended only in writing signed
by authorized representatives of both parties.
12.11 Contact Information. Please direct legal notices or other
correspondence to VMware, Inc., 3401 Hillview Avenue, Palo Alto,
California 94304, United States of America, Attention: Legal Department.

Do you agree? [yes/no]:yes

Pulsamos Enter:

You must accept the VMware OVF Tool component for Linux End User
License Agreement to continue. Press Enter to proceed.

Volvemos a aceptar escribiendo YES y ENTER:

12.12 Contact Information. Please direct legal notices or other
correspondence to VMware, Inc., 3401 Hillview Avenue, Palo Alto, California
94304, United States of America. If You have any questions concerning this
EULA, please send an email to info@vmware.com.

Do you agree? [yes/no]: yes

Escribimos YES y ENTER:

Would you like to check for product updates on startup? [yes]:

Pulsamos ENTER:

VMware's Customer Experience Improvement Program ("CEIP") provides
VMware with information that enables VMware to improve its products
and services, to fix problems, and to advise you on how best to deploy
and use our products. As part of the CEIP, VMware collects technical
information about your organization's use of VMware products and
services on a regular basis in association with your organization's
VMware license key(s). This information does not personally identify
any individual. Additional information regarding the data collected
through CEIP and the purposes for which it is used by VMware is set
forth in the Trust & Assurance Center at
http://www.vmware.com/trustvmware/ceip.html. Join the VMware Customer
Experience Improvement Program ("CEIP")? If you prefer not to
participate in VMware's CEIP for this product, you should select "No"
below. You may join or leave VMware's CEIP for this product at any
time. [yes]:

Pulsamos Enter, será el usuario que se conectará, yo cambiaría a otro que no sea root:

Please enter the user that will initially connect to Workstation
Server. Without setting this correctly, you will not be able to share
VMs with other users. Additional users and administrators can be
configured later in Workstation by selecting "Shared VMs" and clicking
"Permissions". [root]:

Pulsamos Enter para dejar la ruta de las máquinas virtuales por defecto:

Please choose a directory for your shared virtual machines.
[/var/lib/vmware/Shared VMs]:

Pulsamos Enter si queremos mantener el puerto para HTTPS:

Please enter the port to use for https access to Workstation Server.
(HTTPS port:) [443]:

Si disponéis de licencia la podéis introducir ahora o luego:

Enter license key. (optional) You can enter this information later.:

Pulsamos Enter para la instalación:

The product is ready to be installed. Press Enter to begin
installation or Ctrl-C to cancel.

En poco tiempo la tendréis instalada:

Installing VMware Workstation 15.1.0
Configuring...
[######################################################################] 100%
Installation was successful.

Una vez instalado, podéis gestionarlo vía gráfica:

instalar-vmware-workstation-15-en-centos-7-3

Con esto ya podéis trabajar con VMware Workstation PRO 15.

Desinstalar VMware Workstation PRO 15 en Linux

Os explico como desinstalar VMware Workstation PRO 15 en Centos 7:

[root@centos ~]# vmware-installer -u vmware-workstation
All configuration information is about to be removed. Do you wish to
keep your configuration files? [yes]:

Uninstalling VMware VMX 15.1.0
Deconfiguring...
[####################################### ] 56%

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Instalar VMware Workstation 15 en Centos 7 se publicó primero en Blog VMware y Citrix.

Ver temperatura CPU en Centos 7

$
0
0

Ver temperatura CPU en Centos 7

Os vamos a explicar como saber la temperatura del procesador o CPU mediante comandos linux en la distribución Centos 7.

yum install lm_sensors

Lo primero lanzaremos la detección:

[root@centos ~]# sensors-detect
# sensors-detect revision 3.4.0-6 (2016-06-01)
# System: HP ProLiant MicroServer Gen8
# Kernel: 3.10.0-957.21.3.el7.x86_64 x86_64
# Processor: Intel(R) Celeron(R) CPU G1610T @ 2.30GHz (6/58/9)

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): YES
Silicon Integrated Systems SIS5595... No
VIA VT82C686 Integrated Sensors... No
VIA VT8231 Integrated Sensors... No
AMD K8 thermal sensors... No
AMD Family 10h thermal sensors... No
AMD Family 11h thermal sensors... No
AMD Family 12h and 14h thermal sensors... No
AMD Family 15h thermal sensors... No
AMD Family 16h thermal sensors... No
AMD Family 17h thermal sensors... No
AMD Family 15h power sensors... No
AMD Family 16h power sensors... No
Intel digital thermal sensor... Success!
(driver coretemp')
Intel AMB FB-DIMM thermal sensor... No
Intel 5500/5520/X58 thermal sensor... No
VIA C7 thermal sensor... No
VIA Nano thermal sensor... No

Some Super I/O chips contain embedded sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no): YES
Probing for Super-I/O at 0x2e/0x2f
Trying family
National Semiconductor/ITE'... Yes
Found unknown chip with ID 0x0001
Probing for Super-I/O at 0x4e/0x4f
Trying family National Semiconductor/ITE'... No
Trying family
SMSC'... No
Trying family VIA/Winbond/Nuvoton/Fintek'... No
Trying family
ITE'... No

Some systems (mainly servers) implement IPMI, a set of common interfaces
through which system health data may be retrieved, amongst other things.
We first try to get the information from SMBIOS. If we don't find it
there, we have to read from arbitrary I/O ports to probe for such
interfaces. This is normally safe. Do you want to scan for IPMI
interfaces? (YES/no): YES
Found IPMI BMC KCS' at 0xca2... Success!
(confidence 8, driver
to-be-written')

Some hardware monitoring chips are accessible through the ISA I/O ports.
We have to write to arbitrary I/O ports to probe them. This is usually
safe though. Yes, you do have ISA I/O ports even if you do not have any
ISA slots! Do you want to scan the ISA I/O ports? (YES/no): YES
Probing for National Semiconductor LM78' at 0x290... No
Probing for
National Semiconductor LM79' at 0x290... No
Probing for Winbond W83781D' at 0x290... No
Probing for
Winbond W83782D' at 0x290... No

Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): YES
Sorry, no supported PCI bus adapters found.
Module i2c-dev loaded successfully.

Next adapter: mga i2c (i2c-0)
Do you want to scan it? (yes/NO/selectively): NO

Now follows a summary of the probes I have just done.
Just press ENTER to continue:

Driver to-be-written':
* ISA bus, address 0xca2
Chip
IPMI BMC KCS' (confidence: 8)

Driver coretemp':
* Chip
Intel digital thermal sensor' (confidence: 9)

Note: there is no driver for IPMI BMC KCS yet.
Check http://www.lm-sensors.org/wiki/Devices for updates.

Do you want to overwrite /etc/sysconfig/lm_sensors? (YES/no):
Unloading i2c-dev... OK

Ahora lanzaríamos el comando y tendríamos los resultados:

ver-temperatura-cpu-en-centos-7-1

Si queréis verlo en tiempo real:

[root@centos ~]# watch sensors

Every 2,0s: sensors Thu Jul 11 23:17:53 2019

acpitz-virtual-0
Adapter: Virtual device
temp1: +8.3°C (crit = +31.3°C)

power_meter-acpi-0
Adapter: ACPI interface
power1: 0.00 W (interval = 300.00 s)

coretemp-isa-0000
Adapter: ISA adapter
Physical id 0: +36.0°C (high = +87.0°C, crit = +91.0°C)
Core 0: +34.0°C (high = +87.0°C, crit = +91.0°C)
Core 1: +36.0°C (high = +87.0°C, crit = +91.0°C)

tg3-pci-0300
Adapter: PCI adapter
temp1: +62.0°C (high = +100.0°C, crit = +110.0°C)

tg3-pci-0301
Adapter: PCI adapter
temp1: +62.0°C (high = +100.0°C, crit = +110.0°C)

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Ver temperatura CPU en Centos 7 se publicó primero en Blog VMware y Citrix.

Desinstalar KB Windows vía Powershell

$
0
0

Desinstalar KB Windows vía Powershell

Entrada rápida, os explico cómo desinstalar un KB de Windows o actualización vía comandos de Powershell.

Lo vamos a hacer sobre un Windows Server 2016, pero lo podéis hacer en un Windows 10, por ejemplo.

Si queréis un consejo, es interesante tener el control de los parcheos, para eso vía Powershell podéis usar el comando sconfig:

desinstalar-kb-windows-via-powershell-1

Lo pondríamos en Manual:

desinstalar-kb-windows-via-powershell-2

Saltará un banner:

desinstalar-kb-windows-via-powershell-3

Entonces, ¿cómo desinstalamos el KB? Lanzamos el comando para listarlos:

Get-Hotfix

desinstalar-kb-windows-via-powershell-4

Si sabéis el KB, lo podéis filtrar de la siguiente manera:

Get-Hotfix -id nombrekb

desinstalar-kb-windows-via-powershell-5

Para desinstalarlo:

wusa /unistall /KB:4499177

desinstalar-kb-windows-via-powershell-6

Comienza la desinstalación:

desinstalar-kb-windows-via-powershell-7

Si es necesario habrá un reinicio:

desinstalar-kb-windows-via-powershell-8

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Desinstalar KB Windows vía Powershell se publicó primero en Blog VMware y Citrix.

Instalar Ansible en Centos 7

$
0
0

Instalar Ansible en Centos 7

Si habéis descargado el ebook gratuito VMware por vExperts, habréis visto que existe un capítulo creado por Miquel Mariano, que habla de Ansible. Hoy quiero explicaros, aunque ya está en el libro, como instalarlo bajo Centos 7 y unas primeras pinceladas para alguien que como yo le gusta investigar y trabajar con nuevas tecnologías.

Lo primero que haremos es hacer una introducción a lo que es Ansible e intentaremos mostrar varios ejemplos que poder utilizar.

Ansible es una herramienta que nos permite el manejo de configuraciones y despliegue de aplicaciones de manera sencilla. Nos permite lanzar automatismos (configuraciones, instalaciones, monitorizaciones,…) que de otra forma supondrían más esfuerzo.

Esta plataforma de código abierto fue creada por Michael DeHaan como startup en 2013 y fue adquirida por RedHat a finales de 2015. Es una de las herramientas de orquestación más populares actualmente y está creciendo día a día.

Conceptos términos básicos de Ansible

Os dejo algunos de los términos básicos sobre Ansible:

  • Playbooks: escritos en ficheros YAML sirven para la automatización de acciones.
  • Host: máquina remota que se asigna a variables y agrupaciones de objetos por IP o nombre.
  • Task: introducción en los playbooks que generan acciones.
  • Facts: información de los clientes.
  • Group: varios hosts.
  • Roles: agrupación de tareas, plantillas y ficheros.
  • Inventory: datos de los clientes.
  • APIs: medios de transporte para conexiones clouds.
  • Modules: librerías que se copian en los clientes para controlar comandos, ficheros,…
  • Plugins: complementos adicionales para escribir código rápidamente.

Configuración Ansible en Centos 7

Lo primero que necesitaremos es acceso al repo de Epel:

yum install epel-release

Para realizar la instalación lanzamos el siguiente comando:

yum install ansible

Veréis que tiene varias dependencias cómo python:

instalar-ansible-en-centos-7-2

Una vez instalado, comprobamos la versión:

ansible --version

instalar-ansible-en-centos-7-3

Con esto ya tenemos instalado Ansible.

Probar Ansible en Centos 7

Ahora vamos a hacer una pequeña prueba. Por ejemplo, un ping a un listado de servidores o páginas web.

Primero generamos una key de ssh:

ssh-keygen

instalar-ansible-en-centos-7-6

Copiamos la clave ssh id de los hosts:

ssh-copy-id root@192.168.2.20

instalar-ansible-en-centos-7-7

Las configuraciones de Ansible están en:

/etc/ansible/ansible.cfg

Ahora editamos el fichero hosts de Ansible:

vi /etc/ansible/hosts

instalar-ansible-en-centos-7-4

Y agregamos los servidores:

instalar-ansible-en-centos-7-5

Y lanzamos una prueba mediante el siguiente comando:

ansible -m ping all

instalar-ansible-en-centos-7-8

Podéis probar a apagar una máquina y volverlo a lanzar:

instalar-ansible-en-centos-7-9

YAML en Ansible para PING

Podemos hacer un fichero YML para hacer lo mismo:

vi ping-ansible.yml

---
- hosts: all
gather_facts: false
tasks:
- ping:

Para ejecutarlo usaremos:

ansible-playbook ping-ansible.yml

instalar-ansible-en-centos-7-10

Seguiremos jugando con Ansible bajo linux.

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Instalar Ansible en Centos 7 se publicó primero en Blog VMware y Citrix.

Crear servidores de docker con Docker-Machine en VMware vSphere

$
0
0

Crear servidores de docker con Docker-Machine en VMware vSphere

Hoy vamos a utilizar docker-machine para generar servidores de docker y poder generar containers vía comando en una plataforma con VMware vSphere.

La herramienta docker-machine nos permite crear, configurar y manejar máquinas con Docker Engine. Podremos realizar tareas como parar, arrancar o reiniciar los diferentes nodos docker.

En mi caso la voy a utilizar en esta entrada para generar máquinas virtuales de forma remota en VMware vSphere, aunque se puede usar Openstack, Amazon AWS, Virtualbox…Esto lo voy a hacer mediante el driver que permite esa ejecución mediante el puerto SSH.

Así vamos a utilizar la máquina Centos 7 que tengo en mi lab con mi HP Microserver Gen 8. Procedemos con la instalación.

Instalación Docker-Machine en Centos 7

Para instalar docker-machine en Linux utilizaremos el siguiente comando:

$ base=https://github.com/docker/machine/releases/download/v0.16.0 &&
curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine &&
sudo install /tmp/docker-machine /usr/local/bin/docker-machine

crear-containers-con-docker-machine-en-vmware-vsphere-1

Comprobamos que docker-machine se ha instalado:

[root@centos ~]# docker-machine version
docker-machine version 0.16.0, build 702c267f

Podéis encontrar más información en: https://docs.docker.com/machine/install-machine/

Crear servidor contenedores con docker-machine en VMware

Para crear un servidor de contenedores a través de docker-machine necesitaremos los siguientes datos de nuestro VMware vCenter:

crear-containers-con-docker-machine-en-vmware-vsphere-3

  • Usuario con permisos y Contraseña
  • IP o nombre de vCenter
  • SSH habilitado en vCenter
  • Nombre de storage

Es importante tener claro el nombre de los Storages:

crear-containers-con-docker-machine-en-vmware-vsphere-2

Podemos usar diferentes versiones del comando, os enseño la que he usado yo:

[root@centos ~]# docker-machine create --driver vmwarevsphere --vmwarevsphere-vcenter 192.168.2.54 --vmwarevsphere-username=administrator@negu.local --vmwarevsphere-password=PASSWORD --vmwarevsphere-datastore=SYNOLOGY-LUN1 container01
Running pre-create checks...
Creating machine...
(container01) Image cache directory does not exist, creating it at /root/.docker/machine/cache...
(container01) No default Boot2Docker ISO found locally, downloading the latest release...
(container01) Latest release for github.com/boot2docker/boot2docker is v19.03.0
(container01) Downloading /root/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v19.03.0/boot2docker.iso...
(container01) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
(container01) Copying /root/.docker/machine/cache/boot2docker.iso to /root/.docker/machine/machines/container01/boot2docker.iso...
(container01) Generating SSH Keypair...
(container01) Creating VM...
(container01) Uploading Boot2docker ISO ...
(container01) adding network: VM Network
(container01) Reconfiguring VM
(container01) Waiting for VMware Tools to come online...
(container01) Provisioning certs and ssh keys...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env container01

Cuando vamos a vSphere Client veremos que se ha generado:

crear-containers-con-docker-machine-en-vmware-vsphere-4

Podéis acceder a la máquina virtual tanto vía consola como vía remota:

crear-containers-con-docker-machine-en-vmware-vsphere-5

Podemos comprobar el acceso con el siguiente comando:

[root@centos ~]# docker-machine env container01
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.2.245:2376"
export DOCKER_CERT_PATH="/root/.docker/machine/machines/container01"
export DOCKER_MACHINE_NAME="container01"
# Run this command to configure your shell:
# eval $(docker-machine env container01)

Si queréis cambiar el password del usuario docker podéis hacerlo vía consola de VMware vSphere Client ya que se arranca automáticamente la máquina virtual.

Se puede añadir al comando parámetros como la CPU, RAM, RED,…Podéis encontrar más información en: https://docs.docker.com/machine/drivers/vsphere/

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Crear servidores de docker con Docker-Machine en VMware vSphere se publicó primero en Blog VMware y Citrix.


Crear cluster Proxmox con Ceph

$
0
0

Crear cluster Proxmox con Ceph

Seguimos investigando nuevas tecnologías. En este caso he limpiado todo mi laboratorio, no sé si temporalmente, de VMware (¡¡SACRILEGIO!!) para llevarlo a Proxmox con Ceph. Proxmox en su versión 6, que da soporte diferentes funcionalidades muy interesantes y que van mejorando día a día, pudiendo ser una alternativa real y muy poderosa a empresas más contrastadas.

De Proxmox ya hemos hablado alguna vez, hypervisor opensource basado en el sistema operativo Debian + KVM virtualization + Container-based Virtualization. El cual podéis instalar gratuitamente, y que tiene como opción pagar un soporte con acceso a repositorios dedicados y otras ventajas de una suscripción de pago anual.

De lo que no habíamos hablado es de CEPH. Hemos «tocado» en varias entradas GlusterFS, S2D, Datacore,…hoy vamos a por otro tipo de Hyperconvergencia a la que da soporte Proxmox.

¿Qué es Ceph Storage?

URL PROYECTO: https://ceph.com/

Como muchos de los proyectos open, Ceph nació en una universidad, en concreto en la Universidad de California, Santa Cruz. El nombre Ceph proviene de Cephalopod, una clase de moluscos que incluye sepia, pulpo y calamar.

Después de seguir la investigación durante años, montar startups, conseguir inversiones,…les llegó el éxito cuando RedHat les adquirió por 175 millones.

Toda la magia de CEPH se basa en un algoritmo llamado CRUSH (Controlled Replication Under Scalable Hashing) proporcionando almacenamiento basado en objetos, basado en bloques y basado en archivos.

¿Qué diferencia hay entre CEPH y GLUSTERFS?

Ceph es un sistema basado en objetos. Y está especialmente indicado para un acceso rápido de datos no estructurados, que será algo a lo que puede enfrentarse la mayoría de empresas o entornos.

Gluster está pensado para grandes cantidades de datos (ejemplo, entornos de Big Data). Es mucho mejor para el acceso secuencial de datos, donde la velocidad de acceso al dato no es muy importante o fundamental (ejemplo: streaming de vídeo, backups,…)

Aunque ambas soluciones son interesantes, ya que son altamente escalables y tienen grandes posibilidades, dependerá de vuestro uso para elegir entre una u otra.

crear-cluster-proxmox-con-ceph-0

Instalar Proxmox con cluster de dos nodos y storage Ceph RBD

Partimos con la premisa que CEPHFS necesita 3 nodos para trabajar mínimo. Así que lo vamos a configurar pero no es lo ideal para un entorno productivo.

Vamos a partir de dos nodos físicos con las siguientes características:

  • Caja Shuttle
  • Procesador Intel i3
  • Ram 64GB
  • 4 Interfaces de red
  • 16 GB Intel Optanel para instalación Proxmox
  • 240GB SSD
  • 3TB WD RED NAS

Tengo un tercer nodo HP Microserver Gen8, pero no lo voy a añadir al clúster de momento, porque quiero que sean de las mismas características y aún no tengo los discos. Cuando los tenga aprovecharé para hacer una entrada con CEPHFS con 3 nodos.

Ahora os explico como generar un cluster de 2 nodos en Proxmox:

Configuración Clúster Proxmox 2 nodos

Nos conectamos a uno de los host vía HTTPS://IP-HYPERVISOR:8006 –> Iremos al Centro de datos –> Cluster. Pulsamos «Crear Cluster»:

crear-cluster-proxmox-con-ceph-1

Le damos nombre y pulsamos Crear:

crear-cluster-proxmox-con-ceph-2

Se abre un Task viewer que nos da el OK:

crear-cluster-proxmox-con-ceph-3

Ahora pulsamos «Información de la unión». Son los datos necesarios para unir equipos al clúster de Proxmox:

crear-cluster-proxmox-con-ceph-4

Pulsamos «Copiar información»:

crear-cluster-proxmox-con-ceph-5

Nos vamos a la gestión del nodo 2, o el que queremos unir. Y pulsamos «Unir cluster»:

crear-cluster-proxmox-con-ceph-6

Automáticamente se rellenan los datos que hemos copiado y pulsamos «Unión»:

crear-cluster-proxmox-con-ceph-7

Y volveremos a ver el estado de la tarea:

crear-cluster-proxmox-con-ceph-8

Ahora si accedemos a cualquiera de los hosts, en la sección «Centro de datos» veremos los nodos que componen el clúster:

crear-cluster-proxmox-con-ceph-9

Con esto ya tenemos nuestro cluster Proxmox con 2 nodos creado.

Configurar CEPH en Proxmox

Ahora vamos con el Storage. Vamos a la vista Centro de datos –> Ceph. Hay que instalar los paquetes ceph-nautilus que no vienen preinstalados:

crear-cluster-proxmox-con-ceph-10

Personalmente, es importante lanzar una actualización de sistema antes de empezar a meter paquetes nuevos. Lo hacemos desde la Shell:

apt-get update && apt-get -y dist-upgrade && apt-get remove --purge && apt-get -y autoremove --purge && apt-get clean && apt-get autoclean

crear-cluster-proxmox-con-ceph-12

Adicionalmente, si no tenéis una suscripción habría que editar el fichero «/etc/apt/sources.list» y agregar:

crear-cluster-proxmox-con-ceph-13

Una vez purgado el sistema y colocado el repo necesario. Pulsamos «Start installation»:

crear-cluster-proxmox-con-ceph-11

Pulsamos «Y» y dejamos que se instale:

crear-cluster-proxmox-con-ceph-15

Pulsamos Siguiente:

crear-cluster-proxmox-con-ceph-16

Pulsamos Finalizar. Como veréis nos da los pasos siguientes:

crear-cluster-proxmox-con-ceph-17

Crear Ceph Monitores adicionales en Proxmox

Vamos a uno de los nodos Ceph –> Monitor y pulsamos Crear y agregamos el segundo nodo:

crear-cluster-proxmox-con-ceph-18

Crear Ceph OSD adicionales en Proxmox

Ahora vamos a CEPH –> OSD –> Crear OSD:

crear-cluster-proxmox-con-ceph-19

Y vamos añadiendo los discos que vamos a usar:

crear-cluster-proxmox-con-ceph-20

Veremos en el Task viewer que se generan Volúmenes de storage para CEPH:

crear-cluster-proxmox-con-ceph-21

Tendremos que repetir los pasos por Host y discos:

crear-cluster-proxmox-con-ceph-22

Hasta que veamos algo parecido a esto:

crear-cluster-proxmox-con-ceph-23

Crear Pool en Proxmox Ceph

Ahora generaremos un pool para CEPH. Vamos a CEPH –> Pools –> Crear:

crear-cluster-proxmox-con-ceph-24

Le damos un nombre:

crear-cluster-proxmox-con-ceph-25

Veremos el pool generado:

crear-cluster-proxmox-con-ceph-26

Ahora vamos a Centro de datos –> Almacenamiento –> Agregar:

crear-cluster-proxmox-con-ceph-27

Elegiremos RBD:

crear-cluster-proxmox-con-ceph-28

En Contenido deberemos elegir el tipo de contenido que va a almacenar. En mi caso, tanto Imagen del disco como Contenedores. Le damos un nombre y elegimos el Pool. Marcamos KRBD para soportar múltiples discos y snapshots en LXC:

crear-cluster-proxmox-con-ceph-29

Veremos un nuevo almacenamiento en los hosts:

crear-cluster-proxmox-con-ceph-30

Ya podremos generar nuevos discos sobre el storage CEPH y tendremos métricas de uso:

crear-cluster-proxmox-con-ceph-31

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Crear cluster Proxmox con Ceph se publicó primero en Blog VMware y Citrix.

Configurar recurso ISCSI Synology en Proxmox

$
0
0

Configurar recurso ISCSI Synology en Proxmox

Vamos a ver en esta entrada cómo agregamos un storage iSCSI que comparte un NAS Synology a los hosts de Proxmox.

En versiones recientes del sistema operativo de Synology existe una aplicación llamada iSCSI Manager donde podemos recoger los datos necesarios para configurar el recurso iSCSI en Proxmox u otro tipo de sistema.

Así que lo abrimos desde el menú de Inicio:

configurar-recurso-iscsi-synology-en-proxmox-0

Si vamos a la sección Target podremos ver el recurso que tenemos compartido y extraer el IQN. Es el dato significativo de iSCSI que necesitaremos para configurarlo. Pulsamos «Copiar IQN»:

configurar-recurso-iscsi-synology-en-proxmox-0b

Ahora vamos a la gestión de Proxmox y nos colocamos en el Centro de datos. Pulsamos en Almacenamiento y Agregar iSCSI:

configurar-recurso-iscsi-synology-en-proxmox-01

Ahora rellenamos los datos. El ID es un nombre significativo que queramos darle para el volumen de storage, en Portal la IP con la que compartimos en la Synology, en Target hacemos Copy-Pega del dato recogido en la gestión de Synology y para terminar, por acotar, en vez de dejar «todos», seleccionamos todos los hosts en el apartado Nodos. Pulsamos «Agregar»:

configurar-recurso-iscsi-synology-en-proxmox-2

Y en cuestión de segundo, si nuestro recurso está bien configurado veremos aparecer el recurso en los hosts:

configurar-recurso-iscsi-synology-en-proxmox-02

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Configurar recurso ISCSI Synology en Proxmox se publicó primero en Blog VMware y Citrix.

Cambiar MTU interfaz Proxmox

$
0
0

Cambiar MTU interfaz Proxmox

Una de las ventajas de Proxmox sobre otros hipervisores, es que tiene Debian por debajo. Lo aclaro…

No digo que VMware ESXi u otros hipervisores sean «mancos», ya que los que llevamos tiempo en esto de la virtualización, sabemos que por ejemplo al principio ESX era un RedHat modificado. Con el tiempo y mucha evolución después, VMware ha conseguido un hipervisor muy poderoso y una distribución propia, pero porque ha evolucionado sobre manera la parte de «comandeo» que le da la fuerza a un sistema basado en Linux. Lo mismo pasa con Hyper-V, por ejemplo, su la fuerza de Powershell.

En definitiva, la ventaja de Proxmox, es que podemos ejecutar comandos Linux sin tener que estar aprendiendo una shell completa de comandos. Esto no quiere decir que no tengamos propios también.

Os pongo un ejemplo, necesito modificar la MTU de una de las tarjetas de los host para colocar Jumbo Frames. Para ello, sigo los mismo pasos que haría en Debian. Podéis acceder desde la propia consola de Proxmox.

Nos colocamos encima del host y vamos a Shell y editamos el fichero de interfaces de red:

nano /etc/network/interfaces

cambiar-mtu-interfaz-proxmox-0

Y agregamos la siguiente línea:

pre-up ip link set dev enp4s0 mtu 9000

Donde enp4s0 es el nombre de la interfaz:

cambiar-mtu-interfaz-proxmox-1

Hay que reiniciar el host para que tenga efecto.

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Cambiar MTU interfaz Proxmox se publicó primero en Blog VMware y Citrix.

Hyper-V: Virtual Machine Queues (VMQ)

$
0
0

Hyper-V: Virtual Machine Queues (VMQ)

Hoy vamos a hablar de VMQ sobre Microsoft Hyper-V.

Para que no perdáis el tiempo, Virtual Machine Queue (VMQ) está deshabilitado por defecto en interfaces de 1GB. En cambio, cuando generas un vSwith en un host hyper-v se habilita automáticamente en interfaces de red de 10GB.

¿Pero qué es VMQ?

VMQ es un mecanismo que permite mapear las colas físicas de una NIC física a una NIC virtual (vNIC) en el sistema operativo invitado, consiguiendo que el tráfico de red se maneje de una forma más eficiente. De qué forma, consiguiente que el hipervisor consuma menos CPU y tenga menores latencias de tráfico.

¿Cómo trabaja VMQ?

Lo que hace es distribuir el tráfico por igual por las vNIC de las máquinas virtuales, utilizando como máximo una CPU lógica en el host.

hyper-v-virtual-machine-queues-vmq-1

Comandos Powershell VMQ

Podemos comenzar revisando los interfaces:

Get-NetAdapterVmq

hyper-v-virtual-machine-queues-vmq-2

Como hemos comentado, sólo está habilitado en los interfaces 10GB:

Get-NetAdapter | where InterfaceDescription -like "*10 Gigabit*" | fl Name, InterfaceDescription, DriverInformation

hyper-v-virtual-machine-queues-vmq-3

Otra forma:

Get-NetAdapterVMQ | where InterfaceDescription -like "*10 Gigabit*”

hyper-v-virtual-machine-queues-vmq-4

Podemos ver el uso por máquina virtual:

get-vm | Get-VMNetworkAdapter | select VMName,VMQUsage

hyper-v-virtual-machine-queues-vmq-5

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Hyper-V: Virtual Machine Queues (VMQ) se publicó primero en Blog VMware y Citrix.

Hardening Contenedores: Docker Bench Security

$
0
0

Hardening Contenedores: Docker Bench Security

Voy a empezar una secuencia de artículos sobre Hardening de Contenedores Docker.

Un tema que parece muy complejo es todo lo relacionado con la seguridad de los contenedores y la infraestructura de la que subyacen.

Github es una inmensa fuente para que gente con talento o habilidades compartan con la comunidad proyectos interesantes. Uno de los que hoy os voy a presentar nos va a ayudar a securizar nuestros proyectos con contenedores.

Docker Bench for Security se trata de un script que realiza decenas de pruebas comprobando las buenas prácticas de seguridad para un entorno Productivo.

Es un proceso que no cuesta más de un clic, y que nos chequea tanto el host, las imágenes, los contenedores,…¿fácil no?

Luego os tendréis que poner manos a la obra para reparar vuestros agujeros (en eso espero ayudaros ;P ). Os dejo la url del proyecto:

URL PROYECTO: https://github.com/docker/docker-bench-security

Como prerrequisito instalamos «git» en Centos 7:

hardening-contenedores-docker-bench-security-1

Descargamos de Github los ficheros:

[root@centos ~]# git clone https://github.com/docker/docker-bench-security.git
Cloning into 'docker-bench-security'...
remote: Enumerating objects: 12, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 1739 (delta 4), reused 7 (delta 2), pack-reused 1727
Receiving objects: 100% (1739/1739), 2.36 MiB | 1.62 MiB/s, done.
Resolving deltas: 100% (1206/1206), done.

Nos movemos al directorio:

[root@centos ~]# cd docker-bench-security

Podéis ver el contenido:

[root@centos docker-bench-security]# ls
benchmark_log.png CONTRIBUTORS.md docker-bench-security.sh docker-bench-security.sh.log.json Dockerfile helper_lib.sh MAINTAINERS README.md
CONTRIBUTING.md distros docker-bench-security.sh.log docker-compose.yml functions_lib.sh LICENSE.md output_lib.sh tests

Para realizar el test simplemente ejecutáis el siguiente script:


[root@centos docker-bench-security]# sh docker-bench-security.sh
# ------------------------------------------------------------------------------
# Docker Bench for Security v1.3.4
#
# Docker, Inc. (c) 2015-
#
# Checks for dozens of common best-practices around deploying Docker containers in production.
# Inspired by the CIS Docker Community Edition Benchmark v1.1.0.
# ------------------------------------------------------------------------------

Initializing mar jul 30 22:35:51 CEST 2019

[INFO] 1 - Host Configuration
[WARN] 1.1 - Ensure a separate partition for containers has been created
[NOTE] 1.2 - Ensure the container host has been Hardened
[INFO] 1.3 - Ensure Docker is up to date
[INFO] * Using 18.09.7, verify is it up to date as deemed necessary
[INFO] * Your operating system vendor may provide support and security maintenance for Docker
[INFO] 1.4 - Ensure only trusted users are allowed to control Docker daemon
[INFO] * docker:x:982:raulunzue
[WARN] 1.5 - Ensure auditing is configured for the Docker daemon
[WARN] 1.6 - Ensure auditing is configured for Docker files and directories - /var/lib/docker
[WARN] 1.7 - Ensure auditing is configured for Docker files and directories - /etc/docker
[WARN] 1.8 - Ensure auditing is configured for Docker files and directories - docker.service
[WARN] 1.9 - Ensure auditing is configured for Docker files and directories - docker.socket
[INFO] 1.10 - Ensure auditing is configured for Docker files and directories - /etc/default/docker
[INFO] * File not found
[WARN] 1.11 - Ensure auditing is configured for Docker files and directories - /etc/docker/daemon.json
[INFO] 1.12 - Ensure auditing is configured for Docker files and directories - /usr/bin/docker-containerd
[INFO] * File not found
[INFO] 1.13 - Ensure auditing is configured for Docker files and directories - /usr/bin/docker-runc
[INFO] * File not found

[INFO] 2 - Docker daemon configuration
[WARN] 2.1 - Ensure network traffic is restricted between containers on the default bridge
[PASS] 2.2 - Ensure the logging level is set to 'info'
[PASS] 2.3 - Ensure Docker is allowed to make changes to iptables
[WARN] 2.4 - Ensure insecure registries are not used
[PASS] 2.5 - Ensure aufs storage driver is not used
[INFO] 2.6 - Ensure TLS authentication for Docker daemon is configured
[INFO] * Docker daemon not listening on TCP
[INFO] 2.7 - Ensure the default ulimit is configured appropriately
[INFO] * Default ulimit doesn't appear to be set
[WARN] 2.8 - Enable user namespace support
[PASS] 2.9 - Ensure the default cgroup usage has been confirmed
[PASS] 2.10 - Ensure base device size is not changed until needed
[WARN] 2.11 - Ensure that authorization for Docker client commands is enabled
[WARN] 2.12 - Ensure centralized and remote logging is configured
[INFO] 2.13 - Ensure operations on legacy registry (v1) are Disabled (Deprecated)
[WARN] 2.14 - Ensure live restore is Enabled
[WARN] 2.15 - Ensure Userland Proxy is Disabled
[PASS] 2.16 - Ensure daemon-wide custom seccomp profile is applied, if needed
[PASS] 2.17 - Ensure experimental features are avoided in production
[WARN] 2.18 - Ensure containers are restricted from acquiring new privileges

[INFO] 3 - Docker daemon configuration files
[PASS] 3.1 - Ensure that docker.service file ownership is set to root:root
[PASS] 3.2 - Ensure that docker.service file permissions are set to 644 or more restrictive
[PASS] 3.3 - Ensure that docker.socket file ownership is set to root:root
[PASS] 3.4 - Ensure that docker.socket file permissions are set to 644 or more restrictive
[PASS] 3.5 - Ensure that /etc/docker directory ownership is set to root:root
[PASS] 3.6 - Ensure that /etc/docker directory permissions are set to 755 or more restrictive
[INFO] 3.7 - Ensure that registry certificate file ownership is set to root:root
[INFO] * Directory not found
[INFO] 3.8 - Ensure that registry certificate file permissions are set to 444 or more restrictive
[INFO] * Directory not found
[INFO] 3.9 - Ensure that TLS CA certificate file ownership is set to root:root
[INFO] * No TLS CA certificate found
[INFO] 3.10 - Ensure that TLS CA certificate file permissions are set to 444 or more restrictive
[INFO] * No TLS CA certificate found
[INFO] 3.11 - Ensure that Docker server certificate file ownership is set to root:root
[INFO] * No TLS Server certificate found
[INFO] 3.12 - Ensure that Docker server certificate file permissions are set to 444 or more restrictive
[INFO] * No TLS Server certificate found
[INFO] 3.13 - Ensure that Docker server certificate key file ownership is set to root:root
[INFO] * No TLS Key found
[INFO] 3.14 - Ensure that Docker server certificate key file permissions are set to 400
[INFO] * No TLS Key found
[PASS] 3.15 - Ensure that Docker socket file ownership is set to root:docker
[PASS] 3.16 - Ensure that Docker socket file permissions are set to 660 or more restrictive
[PASS] 3.17 - Ensure that daemon.json file ownership is set to root:root
[PASS] 3.18 - Ensure that daemon.json file permissions are set to 644 or more restrictive
[INFO] 3.19 - Ensure that /etc/default/docker file ownership is set to root:root
[INFO] * File not found
[INFO] 3.20 - Ensure that /etc/default/docker file permissions are set to 644 or more restrictive
[INFO] * File not found

[INFO] 4 - Container Images and Build File
[WARN] 4.1 - Ensure a user for the container has been created
[WARN] * Running as root: grafana-xxl
[NOTE] 4.2 - Ensure that containers use trusted base images
[NOTE] 4.3 - Ensure unnecessary packages are not installed in the container
[NOTE] 4.4 - Ensure images are scanned and rebuilt to include security patches
[WARN] 4.5 - Ensure Content trust for Docker is Enabled
[WARN] 4.6 - Ensure HEALTHCHECK instructions have been added to the container image
[WARN] * No Healthcheck found: [nginx:latest] [WARN] * No Healthcheck found: [mysql:latest] [WARN] * No Healthcheck found: [monitoringartist/grafana-xxl:latest] [WARN] * No Healthcheck found: [nginx:alpine] [WARN] * No Healthcheck found: [centos.negu.local:5000/centos:latest centos:latest] [WARN] * No Healthcheck found: [centos.negu.local:5000/centos:latest centos:latest] [WARN] * No Healthcheck found: [hello-world:latest] [INFO] 4.7 - Ensure update instructions are not use alone in the Dockerfile
[INFO] * Update instruction found: [mysql:latest] [INFO] * Update instruction found: [monitoringartist/grafana-xxl:latest] [NOTE] 4.8 - Ensure setuid and setgid permissions are removed in the images
[PASS] 4.9 - Ensure COPY is used instead of ADD in Dockerfile
[NOTE] 4.10 - Ensure secrets are not stored in Dockerfiles
[NOTE] 4.11 - Ensure verified packages are only Installed

[INFO] 5 - Container Runtime
[WARN] 5.1 - Ensure AppArmor Profile is Enabled
[WARN] * No AppArmorProfile Found: grafana-xxl
[WARN] 5.2 - Ensure SELinux security options are set, if applicable
[WARN] * No SecurityOptions Found: grafana-xxl
[PASS] 5.3 - Ensure Linux Kernel Capabilities are restricted within containers
[PASS] 5.4 - Ensure privileged containers are not used
[PASS] 5.5 - Ensure sensitive host system directories are not mounted on containers
[PASS] 5.6 - Ensure ssh is not run within containers
[PASS] 5.7 - Ensure privileged ports are not mapped within containers
[NOTE] 5.8 - Ensure only needed ports are open on the container
[PASS] 5.9 - Ensure the host's network namespace is not shared
[WARN] 5.10 - Ensure memory usage for container is limited
[WARN] * Container running without memory restrictions: grafana-xxl
[WARN] 5.11 - Ensure CPU priority is set appropriately on the container
[WARN] * Container running without CPU restrictions: grafana-xxl
[WARN] 5.12 - Ensure the container's root filesystem is mounted as read only
[WARN] * Container running with root FS mounted R/W: grafana-xxl
[WARN] 5.13 - Ensure incoming container traffic is binded to a specific host interface
[WARN] * Port being bound to wildcard IP: 0.0.0.0 in grafana-xxl
[WARN] 5.14 - Ensure 'on-failure' container restart policy is set to '5'
[WARN] * MaximumRetryCount is not set to 5: grafana-xxl
[PASS] 5.15 - Ensure the host's process namespace is not shared
[PASS] 5.16 - Ensure the host's IPC namespace is not shared
[PASS] 5.17 - Ensure host devices are not directly exposed to containers
[INFO] 5.18 - Ensure the default ulimit is overwritten at runtime, only if needed
[INFO] * Container no default ulimit override: grafana-xxl
[PASS] 5.19 - Ensure mount propagation mode is not set to shared
[PASS] 5.20 - Ensure the host's UTS namespace is not shared
[PASS] 5.21 - Ensure the default seccomp profile is not Disabled
[NOTE] 5.22 - Ensure docker exec commands are not used with privileged option
[NOTE] 5.23 - Ensure docker exec commands are not used with user option
[PASS] 5.24 - Ensure cgroup usage is confirmed
[WARN] 5.25 - Ensure the container is restricted from acquiring additional privileges
[WARN] * Privileges not restricted: grafana-xxl
[WARN] 5.26 - Ensure container health is checked at runtime
[WARN] * Health check not set: grafana-xxl
[INFO] 5.27 - Ensure docker commands always get the latest version of the image
[WARN] 5.28 - Ensure PIDs cgroup limit is used
[WARN] * PIDs limit not set: grafana-xxl
[INFO] 5.29 - Ensure Docker's default bridge docker0 is not used
[INFO] * Container in docker0 network: grafana-xxl
[PASS] 5.30 - Ensure the host's user namespaces is not shared
[PASS] 5.31 - Ensure the Docker socket is not mounted inside any containers

[INFO] 6 - Docker Security Operations
[INFO] 6.1 - Avoid image sprawl
[INFO] * There are currently: 6 images
[INFO] 6.2 - Avoid container sprawl
[INFO] * There are currently a total of 3 containers, with 1 of them currently running

[INFO] 7 - Docker Swarm Configuration
[PASS] 7.1 - Ensure swarm mode is not Enabled, if not needed
[PASS] 7.2 - Ensure the minimum number of manager nodes have been created in a swarm (Swarm mode not enabled)
[PASS] 7.3 - Ensure swarm services are binded to a specific host interface (Swarm mode not enabled)
[PASS] 7.4 - Ensure data exchanged between containers are encrypted on different nodes on the overlay network
[PASS] 7.5 - Ensure Docker's secret management commands are used for managing secrets in a Swarm cluster (Swarm mode not enabled)
[PASS] 7.6 - Ensure swarm manager is run in auto-lock mode (Swarm mode not enabled)
[PASS] 7.7 - Ensure swarm manager auto-lock key is rotated periodically (Swarm mode not enabled)
[PASS] 7.8 - Ensure node certificates are rotated as appropriate (Swarm mode not enabled)
[PASS] 7.9 - Ensure CA certificates are rotated as appropriate (Swarm mode not enabled)
[PASS] 7.10 - Ensure management plane traffic has been separated from data plane traffic (Swarm mode not enabled)

[INFO] Checks: 105
[INFO] Score: 13

¿Te ha gustado la entrada SÍGUENOS EN TWITTER?

La entrada Hardening Contenedores: Docker Bench Security se publicó primero en Blog VMware y Citrix.

Viewing all 681 articles
Browse latest View live