Is it possible to use Chattr in unprivileged container

,

Hello,
I want to use chattr command inside an unprivileged container. Can anyone help me? im using LXD (with lxdui).
Here is the result from containers:

capsh --print

Current: =ep

Bounding set =cap_chown,cap_dac_override,cap_dac_read_search,cap_fowner,cap_fsetid,cap_kill,cap_setgid,cap_setuid,cap_se

tpcap,cap_linux_immutable,cap_net_bind_service,cap_net_broadcast,cap_net_admin,cap_net_raw,cap_ipc_lock,cap_ipc_owner,ca

p_sys_module,cap_sys_rawio,cap_sys_chroot,cap_sys_ptrace,cap_sys_pacct,cap_sys_admin,cap_sys_boot,cap_sys_nice,cap_sys_r

esource,cap_sys_time,cap_sys_tty_config,cap_mknod,cap_lease,cap_audit_write,cap_audit_control,cap_setfcap,cap_mac_overri

de,cap_mac_admin,cap_syslog,cap_wake_alarm,cap_block_suspend

Ambient set =

Current IAB:

Securebits: 00/0x0/1’b0 (no-new-privs=0)

secure-noroot: no (unlocked)

secure-no-suid-fixup: no (unlocked)

secure-keep-caps: no (unlocked)

secure-no-ambient-raise: no (unlocked)

uid=0(root) euid=0(root)

gid=0(root)

groups=0(root),990(mysyslog)

Guessed mode: UNCERTAIN (0)

I can use chattr in privileged mode. my host os is centos 7 and container os is almalinux 8.9. Is it possible to add cap_linux_immutable capability to the container.

Another question: if i change a container ‘security.privileged: “true” will i loss any data or any problem will occurs ?

Thanks in advance.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.