labctl
войти регистрация

Tighten file permissions

имя
file-perms
образ
python:3.12-slim
таймаут
30с
проверка…

Задание

Tighten file permissions

A secrets file has been deployed at /app/secret.txt but with world-readable
permissions — anyone on the host can read it. Tighten the permissions so that
only the file's owner can read or write it.

Current state

$ ls -l /app/secret.txt
-rw-r--r-- 1 root root 10 /app/secret.txt

Required state

The mode bits must be exactly 0600 (-rw-------). Group and other must have
no permissions at all.

Why

This lab practices reading and changing Unix permission bits. Most production
deployments leak secrets because some intermediate file kept overly broad
permissions.

Подсказки

Hints: tighten file permissions

  • The current permissions are 0644. You need 0600.
  • One command does it: chmod 600 /app/secret.txt.
  • Numeric modes are owner|group|other, three bits each: r=4, w=2, x=1.
    So 600 = rw-|---|--- = only owner can read/write.
  • Verify with ls -l /app/secret.txt or stat -c '%a' /app/secret.txt.

Последние попытки

  • Загрузка…

Разовый запуск (smoke-тест)

Атомарный цикл up → check → down. Полезно для CI; без предварительной подготовки состояния проверка завершится с ошибкой.