starsys-tech / projector-server

Server-side library for running Swing applications remotely
https://youtrack.jetbrains.com/issues/PRJ
Other
0 stars 0 forks source link

禁止代码文件的外部访问及由IDE发起的读取操作 #2

Open gudaoxuri opened 2 years ago

gudaoxuri commented 2 years ago

Projector中启用剪贴板加解密后,对代码的保护还需要考虑如下场景:

  1. 在Terminal中安装类似Nginx等服务遍历访问(下载)代码文件
  2. 在IDE写代码访问代码文件(打包、启动Web服务遍历等)
  3. 限制terminal的操作,禁止把文件转移到工程目录外(copy、zip to等)
gudaoxuri commented 2 years ago

可尝试的方法一:

使用 linux audit 功能, https://linux.die.net/man/8/auditctl https://www.shuzhiduo.com/A/l1dyQ3ZAde/

应该可以实现针对 指定代码目录的非指定程序路径或进程id的访问 的日志审计,然后根据审计日志终止对应进程的执行。

gudaoxuri commented 2 years ago

潜在的实现: https://linux-audit.com/monitor-file-access-by-linux-processes/

gudaoxuri commented 2 years ago

可尝试的方法二:

使用 inotify 或是其包装的工具,E.g. https://github.com/notify-rs/notify

gudaoxuri commented 2 years ago

https://unix.stackexchange.com/questions/12247/linux-file-access-monitoring

gudaoxuri commented 2 years ago

inotifywait -mre open /xx/ 可以监控文件的打开(E.g. Cat),但不能跟踪操作的进程或是命令

loggedfs -f /opt/ 不能监控文件的打开

https://crates.io/crates/inotify 可以监控文件的打开(E.g. Cat),但不能跟踪操作的进程或是命令

https://github.com/notify-rs/notify 不能监控文件的打开