Skip to content
Skillv1.0.0

cis-ubuntu1204-v110-13-13

Check User Home Directory Ownership

by CyberStrikeus(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from CyberStrikeus/CyberStrike (.cyberstrike/skill/CIS_benchmarks/Operating_Systems/Ubuntu/cis-ubuntu-12-04-lts-server-benchmark/cis-ubuntu1204-v110-13-13/SKILL.md). Install upstream with npx skills add CyberStrikeus/CyberStrike --skill cis-ubuntu1204-v110-13-13. Copyright stays with the author.

13.13 Check User Home Directory Ownership (Scored)

Profile Applicability

  • Level 1

Description

The user home directory is space defined for the particular user to set local environment variables and to store personal files.

Rationale

Since the user is accountable for files stored in the user home directory, the user must be the owner of the directory.

Audit Procedure

Using Command Line

This script checks to make sure users own the home directory they are assigned to in the /etc/passwd file.

#!/bin/bash
cat /etc/passwd | awk -F: '{ print $1 " " $3 " " $6 }' | while read user uid dir; do
if [ $uid -ge 500 -a -d "$dir" -a $user != "nfsnobody" ]; then
  owner=$(stat -L -c "%U" "$dir")
  if [ "$owner" != "$user" ]; then
    echo "The home directory ($dir) of user $user is owned by $owner."
  fi
fi
done

Expected Result

No output should be returned. Any output indicates home directories not owned by the assigned user.

Remediation

Using Command Line

Change the ownership of any home directories that are not owned by the defined user to the correct user.

Default Value

Home directories are owned by the user when created with useradd -m or adduser.

References

  • CIS Ubuntu 12.04 LTS Server Benchmark v1.1.0

Profile

Level 1 - Scored

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/cyberstrikeus-cyberstrike-cis-ubuntu1204-v110-13-13/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

cyberstrikeus-cyberstrike-cis-ubuntu1204-v110-13-13.ocm.jsonjson
{
  "ocm": "1",
  "id": "cyberstrikeus-cyberstrike-cis-ubuntu1204-v110-13-13",
  "kind": "skill",
  "name": "cis-ubuntu1204-v110-13-13",
  "description": "Check User Home Directory Ownership",
  "publisher": "CyberStrikeus",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "cis",
      "ubuntu",
      "12-04",
      "linux",
      "user-management",
      "home-directory",
      "ownership",
      "file-permissions",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Check User Home Directory Ownership"
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/CyberStrikeus/CyberStrike",
      "path": ".cyberstrike/skill/CIS_benchmarks/Operating_Systems/Ubuntu/cis-ubuntu-12-04-lts-server-benchmark/cis-ubuntu1204-v110-13-13/SKILL.md",
      "ref": "df28ccd3dc6d6c02391169121ee2dcdf4a6a132b",
      "url": "https://github.com/CyberStrikeus/CyberStrike/blob/df28ccd3dc6d6c02391169121ee2dcdf4a6a132b/.cyberstrike/skill/CIS_benchmarks/Operating_Systems/Ubuntu/cis-ubuntu-12-04-lts-server-benchmark/cis-ubuntu1204-v110-13-13/SKILL.md",
      "key": "CyberStrikeus/CyberStrike/.cyberstrike/skill/CIS_benchmarks/Operating_Systems/Ubuntu/cis-ubuntu-12-04-lts-server-benchmark/cis-ubuntu1204-v110-13-13/SKILL.md"
    }
  },
  "instructions": "# 13.13 Check User Home Directory Ownership (Scored)\n\n## Profile Applicability\n\n- Level 1\n\n## Description\n\nThe user home directory is space defined for the particular user to set local environment variables and to store personal files.\n\n## Rationale\n\nSince the user is accountable for files stored in the user home directory, the user must be the owner of the directory.\n\n## Audit Procedure\n\n### Using Command Line\n\nThis script checks to make sure users own the home directory they are assigned to in the `/etc/passwd` file.\n\n```bash\n#!/bin/bash\ncat /etc/passwd | awk -F: '{ print $1 \" \" $3 \" \" $6 }'",
  "cost": {
    "context_tokens": 328
  }
}

Fetch it by URL: GET /api/v1/registry/cyberstrikeus-cyberstrike-cis-ubuntu1204-v110-13-13/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.