I would like to have a way in which a set of folders do not allow write access for a particular process. For example, I would love to have a way in which YUM/RPM is not allowed to write into /usr/bin
mkdir /foo mount --bind / /foo mount --rbind /dev /foo/dev mount --bind /proc /foo/proc mount --bind /run /foo/run mount -t tmpfs tmpfs /foo/tmp mount --bind /sys /foo/sys mount --bind /usr/bin /foo/usr/bin mount -o remount,ro /foo/usr/bin chroot /foo rpm …
Note that hostile processes running as root can escape a chroot, so this is not a secure confinement, only a way to ensure that a non-malicious process isn't writing where it isn't supposed to.
An alternative approach would be to set up SELinux rules. These constrain even processes running as root, so if set up correctly (which is nontrivial, and requires more than file access blocking) it can be a secure confinement.
If the process isn't running as root, just make sure that the permissions on the directory don't allow the user to write there. You can use an ACL that excludes a specific user, e.g.
setfacl -m user:alice:0 /some/dir
/some/dir inaccessible to the user
setfacl -R -m user:alice:rX /some/dir
to make it and files under it readable but not writable.