Chapter 5
- The command to apply a type to a TCP port is created with
semanage
. For instance, to apply thessh_port_t
type to TCP port10122
, execute the following command:# semanage port -a -t ssh_port_t -p tcp 10122
However, this only works as long as the port itself is not already explicitly mapped to an SELinux type. You can query whether this is the case with
sepolicy
, for example:# sepolicy network -p 10122
If the port is part of an unreserved range, then it can be altered.
- No, SECMARK is local to the system. Once a network packet is received by the Linux host, the SECMARK rules will associate a label with that network packet, but this label is only retained in memory on the system itself. Once a packet leaves the Linux system, it will not show any trace of SECMARK labeling.
- The subcommands used by
semanage
areibendport
(to apply a label or sensitivity to an InfiniBand network port) andibpkey
(to apply a label or sensitivity to a partition key). - While labeled IPsec...