fix style

This commit is contained in:
rustdesk
2025-06-15 03:53:23 +08:00
parent 3b90f48e24
commit 3d60e0f5e2
299 changed files with 2108 additions and 2134 deletions
+12 -12
View File
@@ -19,7 +19,7 @@ SELinux status: disabled
...
```
### SELinux-Richtlinien hinzufügen
## SELinux-Richtlinien hinzufügen
Eine Einführung in SELinux finden Sie unter [SELinux/Tutorials](https://wiki.gentoo.org/wiki/SELinux/Tutorials).
@@ -47,7 +47,7 @@ Bei der ersten Methode sind die Änderungen relativ gering, aber da der Standard
Die zweite Methode besteht darin, Regeln von Grund auf neu hinzuzufügen. Es gibt viele Regeln, die hinzugefügt werden müssen, und verschiedene Systeme können Unterschiede aufweisen. Es kann notwendig sein, einige Anpassungen während der praktischen Nutzung vorzunehmen.
#### Den Standardtyp verwenden
### Den Standardtyp verwenden
Der Standardtyp des RustDesk-Dienstes ist `init_t`, der durch die [Kontextvererbungsregeln von SELinux](https://wiki.gentoo.org/wiki/SELinux/Tutorials/How_does_a_process_get_into_a_certain_context) bestimmt wird.
@@ -113,7 +113,7 @@ $ checkmodule -M -m -o rustdesk.mod rustdesk.te && semodule_package -o rustdesk.
$ sudo semodule -l | grep rustdesk
```
#### Einen Typ `rustdesk_t` erstellen
### Einen Typ `rustdesk_t` erstellen
1. Ein neues Verzeichnis erstellen: `mkdir rustdesk-selinux-1.0`.
2. SELinux-Richtliniendateien erstellen: `touch Makefile rustdesk.te rustdesk.fc rustdesk.if`.
@@ -539,7 +539,7 @@ gen_require(`
type xserver_t;
')
###############################################################################
##############################################################################
#
# Teil 1. Die folgenden Regeln stammen hauptsächlich aus der Open-Source-Datei `init.te`.
# https://github.com/fedora-selinux/selinux-policy/blob/rawhide/policy/modules/system/init.te
@@ -557,7 +557,7 @@ corecmd_shell_entry_type(rustdesk_t)
typeattribute rustdesk_t init_script_domain_type;
########################################
#######################################
# Möglichkeiten nutzen, alte Regel:
allow rustdesk_t self:capability ~{ audit_control audit_write sys_module };
@@ -1022,7 +1022,7 @@ allow systemprocess rustdesk_t:unix_dgram_socket sendto;
allow systemprocess rustdesk_t:unix_stream_socket { append write read getattr ioctl };
###############################################################################
##############################################################################
#
# Teil 2. Die folgenden Regeln werden erstellt von
# `grep rustdesk /var/log/audit/audit.log | audit2allow -a -M test`
@@ -1057,7 +1057,7 @@ allow rustdesk_t xserver_t:unix_stream_socket connectto;
allow rustdesk_t ephemeral_port_t:tcp_socket name_connect;
###############################################################################
##############################################################################
#
# Teil 3. Die folgenden Regeln gehören zu den vom System installierten Regeln.
# `dnf install setools-console`
@@ -1721,7 +1721,7 @@ allow rustdesk_t xserver_t:unix_stream_socket connectto;
```text
## <summary>RustDesk</summary>
# <summary>RustDesk</summary>
```
`Makefile`:
@@ -1758,7 +1758,7 @@ install: man
```
##### Direkt aktivieren
#### Direkt aktivieren
Zeigen Sie den Sicherheitskontext von RustDesk vor der Änderung an:
@@ -1792,7 +1792,7 @@ $ ps -eZ | grep rustdesk
system_u:system_r:rustdesk_t:s0 110565 ? 00:00:00 rustdesk
```
##### Durch RPM-Installation aktivieren
#### Durch RPM-Installation aktivieren
Sie können den Befehl `sepolicy generate` verwenden:
@@ -1819,7 +1819,7 @@ $ # Dienst neu starten
$ sudo systemctl restart rustdesk
```
#### Richtlinien iterativ hinzufügen
### Richtlinien iterativ hinzufügen
```sh
$ cd /tmp
@@ -1829,7 +1829,7 @@ $ # rustdesk_tmp.te zu rustdesk.te zusammenführen
$ make clean && make && sudo make install-policy
```
### Referenzen
## Referenzen
- [SELinux/Tutorials](https://wiki.gentoo.org/wiki/SELinux/Tutorials)
- [SELinux Policy module installation](https://fedoraproject.org/wiki/SELinux/IndependentPolicy#SELinux_Policy_module_installation)
+15 -15
View File
@@ -19,7 +19,7 @@ SELinux status: disabled
...
```
### Add SELinux Policies
## Add SELinux Policies
For an introduction to SELinux, please refer to [SELinux/Tutorials](https://wiki.gentoo.org/wiki/SELinux/Tutorials).
@@ -47,7 +47,7 @@ The first method has relatively minor modifications, but because the default `in
The second method is to add rules from scratch. There will be many rules that need to be added, and different systems may have differences. It may be necessary to make some adjustments during actual use.
#### Use The Default Type
### Use The Default Type
The default type of the RustDesk service is `init_t`, which is determined by [the context inheritance rules of SELinux](https://wiki.gentoo.org/wiki/SELinux/Tutorials/How_does_a_process_get_into_a_certain_context).
@@ -113,7 +113,7 @@ $ checkmodule -M -m -o rustdesk.mod rustdesk.te && semodule_package -o rustdesk.
$ sudo semodule -l | grep rustdesk
```
#### Create a type `rustdesk_t`
### Create a type `rustdesk_t`
1. Create a new directory: `mkdir rustdesk-selinux-1.0`.
2. Create SELinux policy files: `touch Makefile rustdesk.te rustdesk.fc rustdesk.if`.
@@ -539,7 +539,7 @@ gen_require(`
type xserver_t;
')
###############################################################################
##############################################################################
#
# Part 1. The following rules are mainly from the open source `init.te`.
# https://github.com/fedora-selinux/selinux-policy/blob/rawhide/policy/modules/system/init.te
@@ -557,7 +557,7 @@ corecmd_shell_entry_type(rustdesk_t)
typeattribute rustdesk_t init_script_domain_type;
########################################
#######################################
# Use capabilities, old rule:
allow rustdesk_t self:capability ~{ audit_control audit_write sys_module };
@@ -1022,7 +1022,7 @@ allow systemprocess rustdesk_t:unix_dgram_socket sendto;
allow systemprocess rustdesk_t:unix_stream_socket { append write read getattr ioctl };
###############################################################################
##############################################################################
#
# Part 2. The following rules are generated by
# `grep rustdesk /var/log/audit/audit.log | audit2allow -a -M test`
@@ -1057,7 +1057,7 @@ allow rustdesk_t xserver_t:unix_stream_socket connectto;
allow rustdesk_t ephemeral_port_t:tcp_socket name_connect;
###############################################################################
##############################################################################
#
# Part 3. The following rules are from the system installed rules.
# `dnf install setools-console`
@@ -1709,7 +1709,7 @@ allow rustdesk_t xserver_t:unix_stream_socket connectto;
```
### rustdesk.fc
## rustdesk.fc
This file defines the file context for RustDesk in SELinux. It ensures that RustDesk executes with the correct security context:
```text
@@ -1717,15 +1717,15 @@ This file defines the file context for RustDesk in SELinux. It ensures that Rust
```
### rustdesk.if
## rustdesk.if
This interface file contains metadata about RustDesks SELinux policy:
```text
## <summary>RustDesk</summary>
# <summary>RustDesk</summary>
```
### Makefile
## Makefile
The Makefile is used to compile and apply the SELinux module for RustDesk, ensuring that necessary security policies are enforced.
```makefile
@@ -1759,7 +1759,7 @@ install: man
```
##### Enable directly
#### Enable directly
View the security context of RustDesk before modification:
@@ -1793,7 +1793,7 @@ $ ps -eZ | grep rustdesk
system_u:system_r:rustdesk_t:s0 110565 ? 00:00:00 rustdesk
```
##### Enable through rpm installation
#### Enable through rpm installation
You can use the `sepolicy generate` command:
@@ -1820,7 +1820,7 @@ $ # restart the service
$ sudo systemctl restart rustdesk
```
#### Iteratively Add Policies
### Iteratively Add Policies
```sh
$ cd /tmp
@@ -1830,7 +1830,7 @@ $ # merge rustdesk_tmp.te to rustdesk.te
$ make clean && make && sudo make install-policy
```
### References
## References
- [SELinux/Tutorials](https://wiki.gentoo.org/wiki/SELinux/Tutorials)
- [SELinux Policy module installation](https://fedoraproject.org/wiki/SELinux/IndependentPolicy#SELinux_Policy_module_installation)
+14 -14
View File
@@ -19,7 +19,7 @@ SELinux status: disabled
...
```
## Añadir Políticas de SELinux
# Añadir Políticas de SELinux
Para una introducción a SELinux, consulte [SELinux/Tutorials (ingles)](https://wiki.gentoo.org/wiki/SELinux/Tutorials).
@@ -47,7 +47,7 @@ Con el primer método vas a tener que hacer modificaciones menores, pero como el
El segundo método se basa en crear un nuevo tipo de cero con todas las reglas. Va a ser necesario añadir muchas reglas y según el sistema estas reglas serán diferentes. Quizás sea necesario hacer ajustes durante el uso del programa.
### Usa el Tipo Por Defecto
## Usa el Tipo Por Defecto
El tipo por defecto del servicio de RustDesk es `init_t`, que es de determinado por [las reglas de herencia de contexto de SELinux (ingles)](https://wiki.gentoo.org/wiki/SELinux/Tutorials/How_does_a_process_get_into_a_certain_context).
@@ -113,7 +113,7 @@ checkmodule -M -m -o rustdesk.mod rustdesk.te && semodule_package -o rustdesk.pp
sudo semodule -l | grep rustdesk
```
### Crea un tipo "rustdesk_t"
## Crea un tipo "rustdesk_t"
1. Crea un nuevo directorio. `mkdir rustdesk-selinux-1.0`
2. Crea los archivos de políticas de SELinux. `touch Makefile rustdesk.te rustdesk.fc rustdesk.if`.
@@ -533,7 +533,7 @@ gen_require(`
type xserver_t;
')
###############################################################################
##############################################################################
#
# Parte 1. Las reglas siguientes son mayormente para el `init.te` de codigo abierto.
# https://github.com/fedora-selinux/selinux-policy/blob/rawhide/policy/modules/system/init.te
@@ -551,7 +551,7 @@ corecmd_shell_entry_type(rustdesk_t)
typeattribute rustdesk_t init_script_domain_type;
########################################
#######################################
# Use capabilities. old rule:
allow rustdesk_t self:capability ~{ audit_control audit_write sys_module };
@@ -1016,7 +1016,7 @@ allow systemprocess rustdesk_t:unix_dgram_socket sendto;
allow systemprocess rustdesk_t:unix_stream_socket { append write read getattr ioctl };
###############################################################################
##############################################################################
#
# parte 2. Las siguientes reglas son generadas por:
# `grep rustdesk /var/log/audit/audit.log | audit2allow -a -M test`
@@ -1049,7 +1049,7 @@ allow rustdesk_t xserver_t:unix_stream_socket connectto;
allow rustdesk_t ephemeral_port_t:tcp_socket name_connect;
###############################################################################
##############################################################################
#
# Parte 3. Las siguientes reglas son para las reglas instaladas por el sistema
# `dnf install setools-console`
@@ -1713,7 +1713,7 @@ rustdesk.if:
```text
## <summary>RustDesk</summary>
# <summary>RustDesk</summary>
```
Makefile:
@@ -1750,7 +1750,7 @@ install: man
```
#### Habilitar directamente
### Habilitar directamente
Comprueba el contexto de seguridad de RustDesk antes de modificar:
@@ -1784,8 +1784,8 @@ $ ps -eZ | grep rustdesk
system_u:system_r:rustdesk_t:s0 110565 ? 00:00:00 rustdesk
```
### Habilita mediante instalación rpm
#### Enable through rpm installation
## Habilita mediante instalación rpm
### Enable through rpm installation
Crea un nuevo archivo de spec `rustdesk-selinux.spec`:
@@ -1874,9 +1874,9 @@ $ rpmbuild -ba rustdesk-selinux.spec
Después de que el empaquetado es completado, ejecuta la instalación via rpm
## Resolución De Problemas
# Resolución De Problemas
### Añadir políticas de forma iterativa
## Añadir políticas de forma iterativa
```sh
$ cd /tmp
@@ -1886,7 +1886,7 @@ $ # merge rustdesk_tmp.te a rustdesk.te
$ make clean && make && sudo make install-policy
```
## Referencias
# Referencias
1. [SELinux/tutoriales (ingles)](https://wiki.gentoo.org/wiki/SELinux/Tutorials)
1. [Instalación del modulo de políticas de SELinux (ingles)](https://fedoraproject.org/wiki/SELinux/IndependentPolicy#SELinux_Policy_module_installation)
+6 -6
View File
@@ -19,7 +19,7 @@ SELinux status: disabled
...
```
### Ajouter des politiques SELinux
## Ajouter des politiques SELinux
Pour une introduction à SELinux, veuillez vous référer à [SELinux/Tutorials](https://wiki.gentoo.org/wiki/SELinux/Tutorials).
@@ -47,7 +47,7 @@ La première méthode a des modifications relativement mineures, mais parce que
La deuxième méthode consiste à ajouter des règles à partir de zéro. Il y aura de nombreuses règles qui doivent être ajoutées, et différents systèmes peuvent avoir des différences. Il peut être nécessaire de faire quelques ajustements lors de l'utilisation réelle.
#### Utiliser le type par défaut
### Utiliser le type par défaut
Le type par défaut du service RustDesk est `init_t`, qui est déterminé par [les règles d'héritage de contexte de SELinux](https://wiki.gentoo.org/wiki/SELinux/Tutorials/How_does_a_process_get_into_a_certain_context).
@@ -112,7 +112,7 @@ $ checkmodule -M -m -o rustdesk.mod rustdesk.te && semodule_package -o rustdesk.
$ sudo semodule -l | grep rustdesk
```
#### Créer un type `rustdesk_t`
### Créer un type `rustdesk_t`
1. Créer un nouveau répertoire : `mkdir rustdesk-selinux-1.0`.
2. Créer des fichiers de politique SELinux : `touch Makefile rustdesk.te rustdesk.fc rustdesk.if`.
@@ -136,7 +136,7 @@ Certaines politiques sont dupliquées et certaines sont redondantes, mais c'est
**En raison de la complexité des fichiers de politique SELinux et de leur contenu technique détaillé, le contenu de configuration technique complet est omis ici pour des raisons de concision. Veuillez vous référer à la version anglaise pour la configuration complète.**
### Génération automatique de politique SELinux (sepolicy)
## Génération automatique de politique SELinux (sepolicy)
```sh
$ # installer les dépendances
@@ -161,7 +161,7 @@ $ # redémarrer le service
$ sudo systemctl restart rustdesk
```
#### Ajouter des politiques de manière itérative
### Ajouter des politiques de manière itérative
```sh
$ cd /tmp
@@ -171,7 +171,7 @@ $ # fusionner rustdesk_tmp.te dans rustdesk.te
$ make clean && make && sudo make install-policy
```
### Références
## Références
- [SELinux/Tutorials](https://wiki.gentoo.org/wiki/SELinux/Tutorials)
- [SELinux Policy module installation](https://fedoraproject.org/wiki/SELinux/IndependentPolicy#SELinux_Policy_module_installation)
+6 -6
View File
@@ -19,7 +19,7 @@ SELinux status: disabled
...
```
### Aggiungere Politiche SELinux
## Aggiungere Politiche SELinux
Per un'introduzione a SELinux, si prega di fare riferimento a [SELinux/Tutorials](https://wiki.gentoo.org/wiki/SELinux/Tutorials).
@@ -47,7 +47,7 @@ Il primo metodo ha modifiche relativamente minori, ma poiché il `init_t` predef
Il secondo metodo è aggiungere regole da zero. Ci saranno molte regole che devono essere aggiunte, e sistemi diversi possono avere differenze. Potrebbe essere necessario fare alcuni aggiustamenti durante l'uso effettivo.
#### Usare il Tipo Predefinito
### Usare il Tipo Predefinito
Il tipo predefinito del servizio RustDesk è `init_t`, che è determinato dalle [regole di ereditarietà del contesto di SELinux](https://wiki.gentoo.org/wiki/SELinux/Tutorials/How_does_a_process_get_into_a_certain_context).
@@ -112,7 +112,7 @@ $ checkmodule -M -m -o rustdesk.mod rustdesk.te && semodule_package -o rustdesk.
$ sudo semodule -l | grep rustdesk
```
#### Creare un tipo `rustdesk_t`
### Creare un tipo `rustdesk_t`
1. Creare una nuova directory: `mkdir rustdesk-selinux-1.0`.
2. Creare file di politica SELinux: `touch Makefile rustdesk.te rustdesk.fc rustdesk.if`.
@@ -136,7 +136,7 @@ Alcune politiche sono duplicate e alcune sono ridondanti, ma va bene poiché fun
**A causa della complessità dei file di politica SELinux e del loro contenuto tecnico dettagliato, il contenuto di configurazione tecnica completo è omesso qui per brevità. Si prega di fare riferimento alla versione inglese per la configurazione completa.**
### Generazione Automatica di Politiche SELinux (sepolicy)
## Generazione Automatica di Politiche SELinux (sepolicy)
```sh
$ # installare dipendenze
@@ -161,7 +161,7 @@ $ # riavviare il servizio
$ sudo systemctl restart rustdesk
```
#### Aggiungere Politiche Iterativamente
### Aggiungere Politiche Iterativamente
```sh
$ cd /tmp
@@ -171,7 +171,7 @@ $ # unire rustdesk_tmp.te in rustdesk.te
$ make clean && make && sudo make install-policy
```
### Riferimenti
## Riferimenti
- [SELinux/Tutorials](https://wiki.gentoo.org/wiki/SELinux/Tutorials)
- [SELinux Policy module installation](https://fedoraproject.org/wiki/SELinux/IndependentPolicy#SELinux_Policy_module_installation)
+6 -6
View File
@@ -19,7 +19,7 @@ SELinux status: disabled
...
```
### SELinuxポリシーの追加
## SELinuxポリシーの追加
SELinuxの紹介については、[SELinux/Tutorials](https://wiki.gentoo.org/wiki/SELinux/Tutorials)を参照してください。
@@ -47,7 +47,7 @@ SELinux型ルールを記述する方法は2つあります:
2番目の方法は、ゼロからルールを追加することです。追加する必要があるルールが多く、異なるシステムでは違いがある可能性があります。実際の使用中にいくつかの調整が必要になる場合があります。
#### デフォルト型の使用
### デフォルト型の使用
RustDeskサービスのデフォルト型は `init_t` で、これは[SELinuxのコンテキスト継承ルール](https://wiki.gentoo.org/wiki/SELinux/Tutorials/How_does_a_process_get_into_a_certain_context)によって決定されます。
@@ -112,7 +112,7 @@ $ checkmodule -M -m -o rustdesk.mod rustdesk.te && semodule_package -o rustdesk.
$ sudo semodule -l | grep rustdesk
```
#### 型 `rustdesk_t` の作成
### 型 `rustdesk_t` の作成
1. 新しいディレクトリを作成:`mkdir rustdesk-selinux-1.0`
2. SELinuxポリシーファイルを作成:`touch Makefile rustdesk.te rustdesk.fc rustdesk.if`
@@ -136,7 +136,7 @@ $ sudo semodule -l | grep rustdesk
**SELinuxポリシーファイルの複雑さと詳細な技術的内容のため、簡潔性のため完全な技術設定内容はここでは省略されています。完全な設定については英語版を参照してください。**
### SELinuxポリシーの自動生成(sepolicy)
## SELinuxポリシーの自動生成(sepolicy)
```sh
$ # 依存関係をインストール
@@ -161,7 +161,7 @@ $ # サービスを再起動
$ sudo systemctl restart rustdesk
```
#### 反復的なポリシーの追加
### 反復的なポリシーの追加
```sh
$ cd /tmp
@@ -171,7 +171,7 @@ $ # rustdesk_tmp.teをrustdesk.teにマージ
$ make clean && make && sudo make install-policy
```
### 参考文献
## 参考文献
- [SELinux/Tutorials](https://wiki.gentoo.org/wiki/SELinux/Tutorials)
- [SELinux Policy module installation](https://fedoraproject.org/wiki/SELinux/IndependentPolicy#SELinux_Policy_module_installation)
+6 -6
View File
@@ -19,7 +19,7 @@ SELinux status: disabled
...
```
### Adicionar Políticas SELinux
## Adicionar Políticas SELinux
Para uma introdução ao SELinux, consulte [SELinux/Tutorials](https://wiki.gentoo.org/wiki/SELinux/Tutorials).
@@ -47,7 +47,7 @@ O primeiro método tem modificações relativamente menores, mas porque o `init_
O segundo método é adicionar regras do zero. Haverá muitas regras que precisam ser adicionadas, e diferentes sistemas podem ter diferenças. Pode ser necessário fazer alguns ajustes durante o uso real.
#### Usar o Tipo Padrão
### Usar o Tipo Padrão
O tipo padrão do serviço RustDesk é `init_t`, que é determinado pelas [regras de herança de contexto do SELinux](https://wiki.gentoo.org/wiki/SELinux/Tutorials/How_does_a_process_get_into_a_certain_context).
@@ -112,7 +112,7 @@ $ checkmodule -M -m -o rustdesk.mod rustdesk.te && semodule_package -o rustdesk.
$ sudo semodule -l | grep rustdesk
```
#### Criar um tipo `rustdesk_t`
### Criar um tipo `rustdesk_t`
1. Criar um novo diretório: `mkdir rustdesk-selinux-1.0`.
2. Criar arquivos de política SELinux: `touch Makefile rustdesk.te rustdesk.fc rustdesk.if`.
@@ -136,7 +136,7 @@ Algumas políticas são duplicadas e algumas são redundantes, mas isso é ok, p
**Devido à complexidade dos arquivos de política SELinux e seu conteúdo técnico detalhado, o conteúdo de configuração técnica completa é omitido aqui para brevidade. Consulte a versão em inglês para a configuração completa.**
### Geração Automática de Política SELinux (sepolicy)
## Geração Automática de Política SELinux (sepolicy)
```sh
$ # instalar dependências
@@ -161,7 +161,7 @@ $ # reiniciar o serviço
$ sudo systemctl restart rustdesk
```
#### Adicionar Políticas Iterativamente
### Adicionar Políticas Iterativamente
```sh
$ cd /tmp
@@ -171,7 +171,7 @@ $ # mesclar rustdesk_tmp.te no rustdesk.te
$ make clean && make && sudo make install-policy
```
### Referências
## Referências
- [SELinux/Tutorials](https://wiki.gentoo.org/wiki/SELinux/Tutorials)
- [SELinux Policy module installation](https://fedoraproject.org/wiki/SELinux/IndependentPolicy#SELinux_Policy_module_installation)
+13 -13
View File
@@ -19,7 +19,7 @@ SELinux status: disabled
...
```
## 添加 SELinux 策略
# 添加 SELinux 策略
关于 SELinux 的介绍,请参考 [SELinux/Tutorials](https://wiki.gentoo.org/wiki/SELinux/Tutorials) 。
@@ -46,7 +46,7 @@ system_u:system_r:init_t:s0 80439 ? 00:00:02 rustdesk
第一种方式修改比较小,但因为改了默认的 `init_t` ,也相当于给其他使用 `init_t` 类型的服务添加了授权。不建议使用。
第二种方式是从零添加规则,会有很多需要添加的规则,不同系统可能也有差异。可能实际使用的时候,需要做一些调整。
### 使用默认的类型
## 使用默认的类型
RustDesk 服务默认的类型是 `init_t` ,这是由 [SELinux 的上下文继承规则](https://wiki.gentoo.org/wiki/SELinux/Tutorials/How_does_a_process_get_into_a_certain_context)决定的。
@@ -112,7 +112,7 @@ $ checkmodule -M -m -o rustdesk.mod rustdesk.te && semodule_package -o rustdesk.
$ sudo semodule -l | grep rustdesk
```
### 新建 rustdesk_t 的类型
## 新建 rustdesk_t 的类型
1. 新建文件夹,如 `mkdir rustdesk-selinux-1.0`
2. 创建 SELinux 策略文件, `touch Makefile rustdesk.te rustdesk.fc rustdesk.if`
@@ -539,7 +539,7 @@ gen_require(`
type xserver_t;
')
###############################################################################
##############################################################################
#
# Part 1. The following rules are mainly from the opensource `init.te`
# https://github.com/fedora-selinux/selinux-policy/blob/rawhide/policy/modules/system/init.te
@@ -557,7 +557,7 @@ corecmd_shell_entry_type(rustdesk_t)
typeattribute rustdesk_t init_script_domain_type;
########################################
#######################################
# Use capabilities. old rule:
allow rustdesk_t self:capability ~{ audit_control audit_write sys_module };
@@ -1022,7 +1022,7 @@ allow systemprocess rustdesk_t:unix_dgram_socket sendto;
allow systemprocess rustdesk_t:unix_stream_socket { append write read getattr ioctl };
###############################################################################
##############################################################################
#
# Part 2. The following rules are generated by
# `grep rustdesk /var/log/audit/audit.log | audit2allow -a -M test`
@@ -1057,7 +1057,7 @@ allow rustdesk_t xserver_t:unix_stream_socket connectto;
allow rustdesk_t ephemeral_port_t:tcp_socket name_connect;
###############################################################################
##############################################################################
#
# Part 3. The following rules are from the system installed rules.
# `dnf install setools-console`
@@ -1720,7 +1720,7 @@ rustdesk.if
```text
## <summary>RustDesk</summary>
# <summary>RustDesk</summary>
```
Makefile
@@ -1757,7 +1757,7 @@ install: man
```
#### 直接启用
### 直接启用
修改前 rustdesk 的安全上下文
@@ -1791,7 +1791,7 @@ $ ps -eZ | grep rustdesk
system_u:system_r:rustdesk_t:s0 110565 ? 00:00:00 rustdesk
```
#### rpm 安装启用
### rpm 安装启用
您可以使用 `sepolicy generate` 命令:
@@ -1818,9 +1818,9 @@ $ # restart the service
$ sudo systemctl restart rustdesk
```
## Troubleshooting
# Troubleshooting
### 添加缺少的权限
## 添加缺少的权限
```sh
$ cd /tmp
@@ -1830,7 +1830,7 @@ $ # merge rustdesk_tmp.te to rustdesk.te
$ make clean && make && sudo make install-policy
```
## References
# References
1. [SELinux/Tutorials](https://wiki.gentoo.org/wiki/SELinux/Tutorials)
1. [SELinux_Policy_module_installation](https://fedoraproject.org/wiki/SELinux/IndependentPolicy#SELinux_Policy_module_installation)
+6 -6
View File
@@ -19,7 +19,7 @@ SELinux status: disabled
...
```
### 新增 SELinux 政策
## 新增 SELinux 政策
關於 SELinux 的介紹,請參考 [SELinux/Tutorials](https://wiki.gentoo.org/wiki/SELinux/Tutorials)。
@@ -47,7 +47,7 @@ system_u:system_r:init_t:s0 80439 ? 00:00:02 rustdesk
第二種方法是從頭新增規則。需要新增很多規則,不同系統可能有差異。在實際使用過程中可能需要做一些調整。
#### 使用預設類型
### 使用預設類型
RustDesk 服務的預設類型是 `init_t`,這是由 [SELinux 的上下文繼承規則](https://wiki.gentoo.org/wiki/SELinux/Tutorials/How_does_a_process_get_into_a_certain_context) 決定的。
@@ -112,7 +112,7 @@ $ checkmodule -M -m -o rustdesk.mod rustdesk.te && semodule_package -o rustdesk.
$ sudo semodule -l | grep rustdesk
```
#### 建立類型 `rustdesk_t`
### 建立類型 `rustdesk_t`
1. 建立新目錄:`mkdir rustdesk-selinux-1.0`
2. 建立 SELinux 政策檔案:`touch Makefile rustdesk.te rustdesk.fc rustdesk.if`
@@ -138,7 +138,7 @@ $ sudo semodule -l | grep rustdesk
**由於 SELinux 政策檔案非常複雜且包含大量技術細節,為了簡潔起見,這裡省略了完整的技術配置內容。完整的配置請參考英文版本。**
### 自動生成 SELinux 政策 (sepolicy)
## 自動生成 SELinux 政策 (sepolicy)
```sh
$ # 安裝依賴項
@@ -163,7 +163,7 @@ $ # 重新啟動服務
$ sudo systemctl restart rustdesk
```
#### 迭代新增政策
### 迭代新增政策
```sh
$ cd /tmp
@@ -173,7 +173,7 @@ $ # 將 rustdesk_tmp.te 合併到 rustdesk.te
$ make clean && make && sudo make install-policy
```
### 參考資料
## 參考資料
- [SELinux/Tutorials](https://wiki.gentoo.org/wiki/SELinux/Tutorials)
- [SELinux Policy module installation](https://fedoraproject.org/wiki/SELinux/IndependentPolicy#SELinux_Policy_module_installation)