minio 做为比较热门的开源s3 服务,受到好多团队的青睐,使用率还是比较高的,如果我们的服务是部署在内网的还好
一般不用太担忧安全问题(但是也得做好内网的安全防护),但是如果直接将s3 服务暴露到公网问题就比较多了,解决
方法很多,比如使用waf,自己配置一些安全策略,以下是基于nginx limit_except 搞一个minio 快速的安全防护
参考玩法
核心是利用了limit_except 只允许,get,head, 以及options 请求,对于delete 以及put,post 等操作都禁用,好处比较明显
我们只会暴露我们需要提供给用户资源(主要是get),一般就不能利用我们的put 以及delete 操作了
参考玩法
version: '3'
services:
minio:
image: minio/minio
ports:
- "9000:9000"
- "19001:19001"
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
command: server --console-address :19001 --quiet /data
nginx:
image: openresty/openresty:alpine-fat
volumes:
- ./nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf
ports:
- 80:80
nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
real_ip_header X-Forwarded-For;
resolver 127.0.0.11;
real_ip_recursive on;
server {
listen 80;
server_name localhost;
charset utf-8;
# 基于nginx 暴露最小的请求路径,同时限制只能使用get head 以及options 请求
location /apps/ {
limit_except GET HEAD OPTIONS{
deny all;
}
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_connect_timeout 300;
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
proxy_http_version 1.1;
proxy_set_header Connection "";
chunked_transfer_encoding off;
proxy_pass http://minio:9000;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
说明
以上是一个简单的玩法,实际上我们基于nginx (openresty) 可以做不少关于minio 的安全防护,减少minio 因为安全问题,造成的数据泄漏以及被人利用
参考资料
https://nginx.org/en/docs/http/ngx_http_core_module.html#satisfy
https://github.com/rongfengliang/using_limit_except_protect_minio
python 远程给另一台发送移动鼠标的命令 python远程cmd
Python 远程执行 cmd 命令,并实时获取结果# 远程执行 CMD 命令, 并实时显示脚本执行情况
def ssh_Run_Cmd(host, username, password, cmd):
:param host: 主机 Ip
:param username: 用户名 root
:param password: 密码 Troila12
java去掉前后的双引号 js去掉前后双引号
方法一: //数据格式是这样的: var data = '[{"id":30348079,"name":"表1","score":"1","pid":"0"},{"id":30348079,"name":"表1","score":"1","pid":"0"}]';
var jsonData = JSON.stringify(data).replac
python例程 python程序100例
Python3算法基础练习:编程100例(6 ~ 10)6.斐波那契数列7.列表复制8.乘法口诀表9.暂停输出10.格式化时间 6.斐波那契数列 题目:给你一个数,输出这个数的斐波那契数列分析:根据公式,递归实现代码:def fib(n):
if n==1 or n==2:
return 1
return fib(n-1)+fib(n-2)
print (fib