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

[proposal] Introduce Network Layer Analyzer #16

Closed
KujouRinka opened this issue Jan 23, 2024 · 5 comments
Closed

[proposal] Introduce Network Layer Analyzer #16

KujouRinka opened this issue Jan 23, 2024 · 5 comments

Comments

@KujouRinka
Copy link
Contributor

KujouRinka commented Jan 23, 2024

I read some source code and found analyzer based on network layer has yet to be implemented. Is there consideration for making it happen?

@tobyxdd
Copy link
Collaborator

tobyxdd commented Jan 23, 2024

You mean analyzers that work at the IP layer? Is there any real use for that (e.g. any protocol that needs it?)

@KujouRinka
Copy link
Contributor Author

KujouRinka commented Jan 23, 2024

Yes. Some applications connect to fixed IP addresses for communication instead of domain (e.g. telegram, QQ, etc.). Supporting this may make block these ones easily. Furthermore, there's also possibility that pass IP address to upper analyzers, combining them together for more precise traffic marking (e.g A request with non-mainland IP but followed with such as baidu.com http/https header could be suspected to be obfuscated traffic).

@tobyxdd
Copy link
Collaborator

tobyxdd commented Jan 23, 2024

Analyzers only provide props for rules, they don't make verdict themselves. Also, there are already built-in props that pass information like ip/port to expressions: https://github.com/apernet/OpenGFW/blob/master/ruleset/expr.go#L145

@tobyxdd
Copy link
Collaborator

tobyxdd commented Jan 23, 2024

Basically you can have rules like geoip(ip.dst) != "cn" && tls != nil && tls.req.sni == "baidu.com"

Although geoip function doesn't exist at the moment. Definitely something we should offer in the future.

@KujouRinka
Copy link
Contributor Author

Thanks for your answer. I apologize for not reading the source code carefully.

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