Skip to content

Instantly share code, notes, and snippets.

@kyontan
Created March 8, 2019 17:33
Show Gist options
  • Save kyontan/d96a6afbaae615b1b156844a1be261a1 to your computer and use it in GitHub Desktop.
Save kyontan/d96a6afbaae615b1b156844a1be261a1 to your computer and use it in GitHub Desktop.
ICTSC2018 それはアクセスできないようにしたはずなのに…… 問題環境
version: '2'
services:
db:
container_name: database
image: mariadb:10.2.22
ports:
- "3306:3306"
volumes:
- ./db:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
image: wordpress:5.0.3-php7.1-apache
container_name: wordpress
depends_on:
- db
ports:
- "80:80"
links:
- db
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_PASSWORD: wordpress
phpmyadmin:
image: phpmyadmin/phpmyadmin:4.8
container_name: phpmyadmin
depends_on:
- db
restart: always
ports:
- "8080:80"
environment:
- PMA_HOST=db
# /etc/iptables/rules.v4
*filter
:INPUT ACCEPT [0:0]
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -s 127.0.0.1/32 -p tcp -m tcp --dport 8080 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 8080 -j DROP
-A INPUT -s 10.0.0.0/8 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -s 172.16.0.0/12 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -s 192.168.0.0/16 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j DROP
COMMIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment