Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] IPV6 6to4已经测试OK,有个防御规则使用的问题 #77

Open
1 task done
13653216371 opened this issue Dec 2, 2024 · 5 comments
Open
1 task done
Assignees

Comments

@13653216371
Copy link

产品版本

v1.3.8-beta.18

版本类型

  • 社区版

⭐️ 需求描述

如何实现nginx这样的,只允许访问图片的链接,其他一律拒绝

       location ~* \.(png|jpg)$ {
       # .png .jpg 请求转发到后端
       proxy_pass http://10.10.100.36:3000;
       }
       location ~ {
       deny all;
       return 403;
       }

补充信息

No response

Copy link

welcome bot commented Dec 2, 2024

Thanks for opening your first issue here! Be sure to follow the issue template!

@13653216371
Copy link
Author

自己摸索到了,可以直接在白名单URL做设置

@samwafgo
Copy link
Owner

samwafgo commented Dec 3, 2024

规则使用编码方式,可以尝试一下:

rule Re4c9fdf3a57f4feb96562efb60bc3324 "仅允许访问图片" salience 10 {
          when
              MF.URL.HasSuffix(".png")==false && MF.URL.HasSuffix(".jpg")==false
          then
              
      		Retract("Re4c9fdf3a57f4feb96562efb60bc3324");
      } 

@13653216371
Copy link
Author

规则使用编码方式,可以尝试一下:

rule Re4c9fdf3a57f4feb96562efb60bc3324 "仅允许访问图片" salience 10 {
          when
              MF.URL.HasSuffix(".png")==false && MF.URL.HasSuffix(".jpg")==false
          then
              
      		Retract("Re4c9fdf3a57f4feb96562efb60bc3324");
      } 

我的URL比较奇怪,是这样的https://xx.cn:598/api/907b-1d12153f099e.jpg?box=true&token=eyJhbGc

不知道该怎么改一下?

@samwafgo
Copy link
Owner

samwafgo commented Dec 4, 2024

rule Re4c9fdf3a57f4feb96562efb60bc3324 "仅允许访问图片" salience 10 {
          when
              MF.URL.Contains(".png")==false && MF.URL.Contains(".jpg")==false
          then
              
      		Retract("Re4c9fdf3a57f4feb96562efb60bc3324");
      } 

那尝试一下 这样的处理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants