Compare commits

...

21 Commits

Author SHA1 Message Date
am
afdd827df3 ajout du proxy inverse 2021-02-01 09:40:04 +01:00
290e2866fe ajout permitrootlogin 2021-02-01 09:35:18 +01:00
am
dc276e2c68 ajout de config.php 2021-01-28 17:54:55 +01:00
6c090e61f8 ajout schema dmz 2021-01-28 17:46:09 +01:00
1c036df5c4 modif routes ipsec.conf x509 2021-01-28 17:08:58 +01:00
a9b757dafa Merge branch 'master' of https://gitea.lyc-lecastel.fr/gadmin/gsb2021 2021-01-28 15:37:16 +01:00
bb5521f0dc ajout variable fog 2021-01-28 15:37:13 +01:00
bb
6201569f8a Merge branch 'master' of https://gitea.lyc-lecastel.fr/gadmin/gsb2021 2021-01-28 15:32:29 +01:00
bb
b14c35a7aa Ajout d'un fichier goss pour s-agence 2021-01-28 15:31:29 +01:00
3be4dd14d4 Merge branch 'master' of https://gitea.lyc-lecastel.fr/gadmin/gsb2021 2021-01-28 15:15:18 +01:00
7245538622 ajout variable fog 2021-01-28 15:14:59 +01:00
bb
c448fb3457 Ajout du role goss pour s-agence 2021-01-28 15:04:03 +01:00
tl
0c0b58399f correction s-lb-web3 2021-01-28 14:26:42 +01:00
e1f0910ec7 Ajout des machines s-mess et s-lb 2021-01-27 11:55:29 +01:00
01b41a6dd7 Ajout des machines s-mess et s-lb 2021-01-27 11:51:17 +01:00
am
e36173b079 modif docker compose ajout proxy 2021-01-27 11:18:18 +01:00
tl
575eaea422 ajout s-lb-web3 2021-01-27 09:13:04 +01:00
bb
8ea91004f8 Merge branch 'master' of https://gitea.lyc-lecastel.fr/gadmin/gsb2021 2021-01-27 08:51:11 +01:00
bb
6844d05974 chemin absolu + interface dhcp agence 2021-01-27 08:50:13 +01:00
tl
d8371a0973 attribution des permissions www-data sur /home/wordpress 2021-01-27 08:25:54 +01:00
4621000ce1 backup script 2021-01-26 16:46:04 +01:00
23 changed files with 288 additions and 19 deletions

BIN
doc/pics/e4-dmz-tl.dia Normal file

Binary file not shown.

BIN
doc/pics/e4-dmz-tl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

39
goss/s-agence.yaml Normal file
View File

@ -0,0 +1,39 @@
command:
ip r:
exit-status: 0
stdout:
- default via 172.16.128.254 dev enp0s8
- 172.16.128.0/24
- 192.168.99.0/24
stderr: []
timeout: 10000
ping -c 2 172.16.0.1:
exit-status: 0
stdout:
- 0% packet loss
stderr: []
timeout: 10000
ping -c 2 172.16.128.254:
exit-status: 0
stdout:
- 0% packet loss
stderr: []
timeout: 10000
ping -c 2 192.168.1.1:
exit-status: 0
stdout:
- 0% packet loss
stderr: []
timeout: 10000
ping -c 2 192.168.1.2:
exit-status: 0
stdout:
- 0% packet loss
stderr: []
timeout: 10000
ping -c 2 192.168.200.254:
exit-status: 0
stdout:
- 0% packet loss
stderr: []
timeout: 10000

View File

@ -13,6 +13,7 @@
- goss
- dhcp-ag
- dns-agence
- ssh-root-access
- snmp-agent
- vpn-stg-l
# - x509-l

View File

@ -0,0 +1,47 @@
<?php
$CONFIG = array (
'htaccess.RewriteBase' => '/',
'memcache.local' => '\\OC\\Memcache\\APCu',
'apps_paths' =>
array (
0 =>
array (
'path' => '/var/www/html/apps',
'url' => '/apps',
'writable' => false,
),
1 =>
array (
'path' => '/var/www/html/custom_apps',
'url' => '/custom_apps',
'writable' => true,
),
),
'instanceid' => 'ocvc4q2htemf',
'passwordsalt' => 'stdJZMx4C5hz85Kqt8XdZIzx8kVOHI',
'secret' => 'II1BBgzlx70WUYCapAt/m/Bt1ZEk/n11n0DVq3zynyU8F/bU',
'trusted_domains' =>
array (
0 => '172.16.0.7:5678',
1 => '172.16.0.7:8080',
2 => 's-mess',
3 => 's-mess.gsb.lan',
4 => 'localhost:8080',
),
'trusted_proxies' => ['172.16.0.7'],
'overwriteprotocol' => 'http',
'overwritehost' => '172.16.0.7:8080',
'proxy' => '172.16.0.7:8080',
'datadirectory' => '/var/www/html/data',
'dbtype' => 'mysql',
'version' => '20.0.6.1',
'overwrite.cli.url' => 'http://172.16.0.7:5678',
'dbname' => 'nextcloud',
'dbhost' => 'db',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextcloud',
'dbpassword' => 'root',
'installed' => true,
);

View File

@ -16,18 +16,20 @@ services:
- MYSQL_PASSWORD=root
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
TZ: Europe/Paris
app:
image: nextcloud
restart: always
ports:
- 8080:80
- 5678:80
links:
- db
volumes:
- nextcloud:/var/www/html
- ./nextcloud:/var/www/html
environment:
- MYSQL_PASSWORD=root
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
TZ: Europe/Paris

View File

@ -0,0 +1,100 @@
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
# Default server configuration
#
server {
listen 8080 default_server;
listen [::]:8080 default_server;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://localhost:5678;
proxy_connect_timeout 900;
proxy_send_timeout 900;
proxy_read_timeout 900;
}
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
# root /var/www/html;
# Add index.php to the list if you are using PHP
# index index.html index.htm index.nginx-debian.html;
# server_name _;
# location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
# }
# pass PHP scripts to FastCGI server
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
# fastcgi_pass unix:/run/php/php7.3-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
# listen 80;
# listen [::]:80;
#
# server_name example.com;
#
# root /var/www/example.com;
# index index.html;
#
# location / {
# try_files $uri $uri/ =404;
# }
#}

View File

@ -29,3 +29,33 @@
shell: docker-compose up -d
args:
chdir: /root/nextcloud
- name: Installation de Nginx
package:
name: nginx
state: present
- name: Copie de /etc/nginx/site-availables/proxy
copy:
src: /root/tools/ansible/gsb2021/roles/docker-nextcloud/files/proxy
dest: /etc/nginx/sites-available
- name: Supression de /etc/nginx/sites-enabled/default
file:
path: /etc/nginx/sites-enabled/default
state: absent
- name: Creation de lien symbolique avec /etc/nginx/sites-available/proxy dans /etc/nginx/sites-enabled/proxy
shell: ln -s /etc/nginx/sites-availables/proxy proxy
args:
chdir: /etc/nginx/sites-enabled
- name: Redemmarage de Nginx
service:
name: nginx
state: restarted
- name: Copie de config.php dans /root/nextcloud/nextcloud/config
copy:
src: /root/tools/ansible/gsb2021/roles/docker-nextcloud/files/config.php
dest: /root/nextcloud/nextcloud/config

View File

@ -0,0 +1,2 @@
depl_url: "http://s-adm.gsb.adm/gsbstore"
depl_fog: "fogproject-1.5.9.tar.gz"

View File

@ -6,10 +6,10 @@
- name: recuperation du fichier d'installation de fog
get_url:
url: http://depl/gsbstore/fogproject-1.5.7.tar.gz
url: "{{ depl_url }}/{{ depl_fog }}"
dest: /root/fog
- name: decompression du fichier d'installation de fog
unarchive:
src: /root/fog/fogproject-1.5.7.tar.gz
src: "/root/fog/{{ depl_fog }}"
dest: /root/fog

View File

@ -15,13 +15,13 @@ define hostgroup {
define hostgroup {
hostgroup_name debian-servers
alias Serveurs distant
members s-infra, s-proxy, r-int, r-ext, s-adm, s-itil
members s-infra, s-proxy, r-int, r-ext, s-adm, s-itil, s-mess
}
define hostgroup { 
hostgroup_name ssh-servers
alias acces SSH
members s-adm, s-infra, s-proxy, r-int, r-ext, localhost, gwsio2, s-itil
members s-adm, s-infra, s-proxy, r-int, r-ext, localhost, gwsio2, s-itil, s-mess, s-lb
}
define hostgroup { 
@ -39,7 +39,7 @@ define hostgroup { 
define hostgroup {
hostgroup_name http-servers
alias serveurs-web
members localhost, s-itil
members localhost, s-itil, s-adm
}
#define hostgroup {
@ -69,6 +69,7 @@ define hostgroup{
define hostgroup{
hostgroup_name uptimegrp
alias uptimegrp
members s-infra, s-proxy, r-int, r-ext, s-adm, s-itil
members s-infra, s-proxy, r-int, r-ext, s-adm, s-itil, s-mess, s-lb
}

View File

@ -0,0 +1,14 @@
# A simple configuration file for monitoring the local host
# This can serve as an example for configuring other servers;
# Custom services specific to this host are added here, but services
# defined in nagios2-common_services.cfg may also apply.
#
define host{
use generic-host ; Name of host template$
host_name s-lb
alias debian-servers
address 192.168.100.10
parents r-int
}

View File

@ -0,0 +1,14 @@
# A simple configuration file for monitoring the local host
# This can serve as an example for configuring other servers;
# Custom services specific to this host are added here, but services
# defined in nagios2-common_services.cfg may also apply.
#
define host{
use generic-host ; Name of host template$
host_name s-mess
alias nextcloud
address 172.16.0.7
parents r-int
}

View File

@ -21,9 +21,9 @@ allow-hotplug enp0s9
iface enp0s9 inet static
address 192.168.1.2
netmask 255.255.255.0
post-up ip route add 172.16.128.0/24 via 192.168.1.2
post-up ip route add 172.16.0.0/24 via 192.168.1.1
post-up ip route add 192.168.200.0/24 via 192.168.1.1
post-up /usr/sbin/ip route add 172.16.128.0/24 via 192.168.1.2
post-up /usr/sbin/ip route add 172.16.0.0/24 via 192.168.1.1
post-up /usr/sbin/ip route add 192.168.200.0/24 via 192.168.1.1
# up route add -net 172.16.128.0/24 gw 192.168.0.52
# up route add default gw 192.168.1.1

View File

@ -21,8 +21,8 @@ allow-hotplug enp0s9
iface enp0s9 inet static
address 192.168.0.52
netmask 255.255.255.0
post-up ip route add 192.168.1.0/24 via 172.16.128.254/24
post-up ip route add 172.16.0.0/24 via 172.16.128.254/24
post-up /usr/sbin/ip route add 192.168.1.0/24 via 172.16.128.254/24
post-up /usr/sbin/ip route add 172.16.0.0/24 via 172.16.128.254/24
# up route add -net 192.168.1.0/24 gw 192.168.0.52
# post-up /bin/bash /root/iptables-vpn

View File

@ -9,3 +9,6 @@ iface lo inet loopback
allow-hotplug enp0s3
iface enp0s3 inet dhcp
allow-hotplug enp0s8
iface enp0s8 inet dhcp

View File

@ -44,7 +44,7 @@ backend fermeweb
#option httpchk HEAD / HTTP/1.0
server s-lb-web1 192.168.101.1:80 check
server s-lb-web2 192.168.101.2:80 check
# server s-lb-web3 192.168.101.3:80 check
listen stats
bind *:8080

View File

@ -4,7 +4,7 @@ apt-get update && apt-get upgrade -y
# Install MySQL Server in a Non-Interactive mode. Default root password will be "root"
echo "mysql-server mysql-server/root_password password root" | debconf-set-selections
echo "mysql-server mysql-server/root_password_again password root" | debconf-set-selections
apt-get -y install mariadb-server
apt-get -y install mysql-server
# Run the MySQL Secure Installation wizard

View File

@ -25,6 +25,14 @@
- {'regexp': "define\\('DB_USER', '(.)+'\\);", 'line': "define('DB_USER', '{{wp_mysql_user}}');"}
- {'regexp': "define\\('DB_PASSWORD', '(.)+'\\);", 'line': "define('DB_PASSWORD', '{{wp_mysql_password}}');"}
- name: Attributions des permissions
file:
path: /home/wordpress
recurse: yes
owner: 33
group: 33
# - name: Fix permissions
# shell: chown -R www-data /var/www/wordpress/*
#

View File

@ -0,0 +1,7 @@
- name: Activation acces ssh root pour vp-1 (certificat)
lineinfile:
dest: /etc/ssh/sshd_config
regexp: "^PermitRootLogin"
line: "PermitRootLogin yes"
state: present

View File

@ -7,7 +7,7 @@ conn tunnel #
left=192.168.0.52
leftsubnet=172.16.128.0/24
right=192.168.0.51
rightsubnet=192.168.0.0/16, 172.16.0.0/24
rightsubnet=192.168.1.0/24, 192.168.200.0/24, 172.16.0.0/24
ike=aes256-sha2_256-modp1024!
esp=aes256-sha2_256!
keyingtries=0
@ -22,4 +22,4 @@ conn tunnel #
type=tunnel
leftcert=r-vp2Cert.pem
leftid="C=CH, O=GSB, CN=r-vp2"
rightid="C=CH, O=GSB, CN=r-vp1"
rightid="C=CH, O=GSB, CN=r-vp1"

View File

@ -5,7 +5,7 @@ config setup
conn %default
conn tunnel #
left=192.168.0.51
leftsubnet=192.168.0.0/16, 172.16.0.0/24
leftsubnet=192.168.1.0/24, 192.168.200.0/24, 172.16.0.0/24
right=192.168.0.52
rightsubnet=172.16.128.0/24
ike=aes256-sha2_256-modp1024!
@ -22,4 +22,4 @@ conn tunnel #
type=tunnel
leftcert=r-vp1Cert.pem
leftid="C=CH, O=GSB, CN=r-vp1"
rightid="C=CH, O=GSB, CN=r-vp2"
rightid="C=CH, O=GSB, CN=r-vp2"

View File

@ -7,3 +7,4 @@
- ssh-cli
- syslog-cli
- post
- goss