memcached_selinux(8)

πŸ“¦
version 20250627+git412.dbf877ab7 Β· 7 versions
, in opensuse-leap 16.0

πŸ’… memcached_selinux β€” the SELinux policy page for your memcached processes

okay so bestie, welcome to memcached_selinux(8), which is a whole manual page about the Security Enhanced Linux policy that wraps around the memcached processes. yes it's a lot of words. no you're not allowed to skip it. let's go 🫢


✨ NAME ✨

memcached_selinux β€” the Security Enhanced Linux Policy for the memcached processes. that's it. that's the name. iconic behaviour honestly πŸ‘‘


🌸 DESCRIPTION 🌸

Security-Enhanced Linux secures the memcached processes via flexible mandatory access control. like, it's not out here asking politely β€” it's mandatory. it's controlling. it's MAC and it ate πŸ’…

The memcached processes execute with the memcached_t SELinux type. and no, you can't just assume that β€” you gotta check. run the ps command with the -Z qualifier and see for yourself:

ps -eZ | grep memcached_t

that's the vibe check, fr fr. if memcached_t shows up in the output, your processes are living that SELinux life ✨


πŸšͺ ENTRYPOINTS πŸšͺ

so how do you even get into the memcached_t SELinux type? through the memcached_exec_t file type, bestie. that's the door πŸšͺ

The default entrypoint paths for the memcached_t domain are literally just:

/usr/bin/memcached

one path. one single path. she's lowkey exclusive and honestly? respect πŸ’…


πŸ‘‘ PROCESS TYPES πŸ‘‘

SELinux defines process types (aka domains) for each process running on the system. every process gets a little label, it's giving name tag energy at a party πŸŽ€

You can see the context of a process using the -Z option to ps. yes, -Z again. get used to her, she's the main character of this whole page.

Policy governs the access confined processes have to files. the SELinux memcached policy is very flexible, allowing users to setup their memcached processes in as secure a method as possible. flexible and secure? we love a multitasker 🌈

The following process types are defined for memcached:

  • memcached_t
Note: semanage permissive -a memcached_t can be used to make the process type memcached_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so like... she won't block you, but she will be watching and taking notes πŸ˜­πŸ™ˆ

πŸ”₯ BOOLEANS πŸ”₯

SELinux policy is customizable based on least access required. the memcached policy is extremely flexible and has several booleans that allow you to manipulate the policy and run memcached with the tightest access possible. customise your girl's boundaries, basically πŸ’…


If you want to dontaudit all daemons scheduling requests (setsched, sys_nice), you must turn on the daemons_dontaudit_scheduling boolean. Enabled by default.

setsebool -P daemons_dontaudit_scheduling 1

If you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. Enabled by default.

setsebool -P fips_mode 1

If you want to allow system to run with NIS, you must turn on the nis_enabled boolean. Disabled by default.

setsebool -P nis_enabled 1

πŸ¦‹ PORT TYPES πŸ¦‹

SELinux defines port types to represent TCP and UDP ports. yes, even the ports have labels. everyone's got a label. it's giving ✨organized✨

You can see the types associated with a port by using the following command:

semanage port -l

Policy governs the access confined processes have to these ports. SELinux memcached policy is very flexible allowing users to setup their memcached processes in as secure a method as possible. (she says this a lot but honestly? consistency queen πŸŽ€)

The following port types are defined for memcached:

  • memcache_port_t

Default Defined Ports:

tcp 11211
udp 11211

11211 twice, once for tcp and once for udp. she contains multitudes 🌸


πŸ—‚οΈ MANAGED FILES πŸ—‚οΈ

The SELinux process type memcached_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. Note: the processes UID still need to have DAC permissions. like, SELinux isn't out here doing DAC's job, she has her own lane, okurrr πŸ’€

cluster_conf_t

/etc/cluster(/.*)?

cluster_var_lib_t

/var/lib/pcsd(/.*)?
/var/lib/cluster(/.*)?
/var/lib/openais(/.*)?
/var/lib/pengine(/.*)?
/var/lib/corosync(/.*)?
/usr/lib/heartbeat(/.*)?
/var/lib/heartbeat(/.*)?
/var/lib/pacemaker(/.*)?

cluster_var_run_t

/run/crm(/.*)?
/run/cman_.*
/run/rsctmp(/.*)?
/run/aisexec.*
/run/heartbeat(/.*)?
/run/pcsd-ruby.socket
/run/corosync-qnetd(/.*)?
/run/corosync-qdevice(/.*)?
/run/pcsd.socket
/run/corosync.pid
/run/cpglockd.pid
/run/rgmanager.pid
/run/cluster/rgmanager.sk

krb5_host_rcache_t

/var/tmp/krb5_0.rcache2
/var/cache/krb5rcache(/.*)?
/var/tmp/nfs_0
/var/tmp/DNS_25
/var/tmp/host_0
/var/tmp/imap_0
/var/tmp/HTTP_23
/var/tmp/HTTP_48
/var/tmp/ldap_55
/var/tmp/ldap_487
/var/tmp/ldapmap1_0

memcached_var_run_t

/run/memcached(/.*)?
/run/ipa_memcached(/.*)?

root_t

/sysroot/.aleph-version.json
/sysroot/ostree/deploy/.*-atomic/deploy(/.*)?
/
/initrd
/var/lib/ntp

πŸŽ€ FILE CONTEXTS πŸŽ€

SELinux requires files to have an extended attribute to define the file type. it's like a little sticker on every file that says "hi, this is what I am" 🏷️✨

You can see the context of a file using the -Z option to ls. yes, -Z yet again. she really is that girl.

Policy governs the access confined processes have to these files. SELinux memcached policy is very flexible allowing users to setup their memcached processes in as secure a method as possible.

STANDARD FILE CONTEXT

SELinux defines the file context types for the memcached. if you wanted to store files with these types in different paths, you need to execute the semanage command to specify alternate labeling and then use restorecon to put the labels on disk. two steps, no skipping πŸ’…

semanage fcontext -a -t memcached_exec_t '/srv/memcached/content(/.*)?'
restorecon -R -v /srv/mymemcached_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. regex jumpscare but make it useful 🧚

The following file types are defined for memcached:

memcached_exec_t

  • Set files with the memcached_exec_t type, if you want to transition an executable to the memcached_t domain.

memcached_initrc_exec_t

  • Set files with the memcached_initrc_exec_t type, if you want to transition an executable to the memcached_initrc_t domain.

memcached_var_run_t

  • Set files with the memcached_var_run_t type, if you want to store the memcached files under the /run or /var/run directory.

Paths:

/run/memcached(/.*)?, /run/ipa_memcached(/.*)?
Note: file context can be temporarily modified with the chcon command. If you want to permanently change the file context you need to use the semanage fcontext command. This will modify the SELinux labeling database. You will need to use restorecon to apply the labels. so chcon is the cute temporary tattoo and semanage fcontext is the real full-send permanent ink, and restorecon is the artist applying it 🎨✨

⚑ COMMANDS ⚑

okay so here's your toolbox, bestie. these all play nice with the memcached policy:

  • semanage fcontext can also be used to manipulate default file context mappings.
  • semanage permissive can also be used to manipulate whether or not a process type is permissive.
  • semanage module can also be used to enable/disable/install/remove policy modules.
  • semanage port can also be used to manipulate the port definitions.
  • semanage boolean can also be used to manipulate the booleans.
  • system-config-selinux is a GUI tool available to customize SELinux policy settings. a whole GUI!! for when you want to click things instead of typing them πŸ–±οΈπŸ’–

🫢 AUTHOR 🫢

This manual page was auto-generated using sepolicy manpage. yeah, a machine wrote it. and now a teenager is rewriting the machine's work. it's giving full circle πŸ’€βœ¨


🌈 SEE ALSO 🌈


and that's the whole page, bestie πŸŽ€ this came to you from memcached, version dated 26-10-06, living under the manual name memcached_selinux(8) β€” go forth and label responsibly, ily, periodt πŸ’œπŸ¦‹

πŸ“¦ where this page comes from