The lab-docs help service serves pages from /srv/docs. The files are there with ordinary permissions, yet over the network the service answers with a refusal. Run a request and look at the directory's permissions.
Make a request to lab-docs
Request the index.html page from lab-docs, look at the permissions of /srv/docs and check the kernel log for apparmor denials.
First, predict
The permissions on /srv/docs/index.html are ordinary (644, readable by all). What will the service answer to the page request?
Now start the exercise, run the command and compare your prediction with the output.
The permissions on /srv/docs/index.html are ordinary (644), yet the service got Permission denied. What do you know for sure?
-
The file exists:
ls -l /srv/docs/index.htmlshows it as 644. The answer was “Permission denied”, not “no such file”. -
The service answers — the request reached it and returned a refusal text.
systemctl is-active lab-docsshows active. -
The file is readable by everyone (644), whatever user the service runs as. AppArmor refused it — the
apparmor="DENIED"line injournalctl -k.
The file permissions are fine, so the refusal came from the AppArmor profile, not from file access.