Lesson plan: File Permissions

AP Cybersecurity · Unit 5 Securing Applications and Data · Topic 5.2 Protecting Applications and Data: Managerial Controls and Access Controls · Practice set

At a glance

Suggested time
3 class periods (45 min)
Pacing
Last of three sets for Topic 5.2. The CED gives Topic 5.2 seven class periods; this plan suggests 2 for Data States, Regulated Data, and Policies, 2 for Access Control Models and 3 for this set, with CED Scenario 5A on the third day. The CED does not divide the topic among sets; that split is this plan's. This set covers LO 5.2.D only.
Before this set
Access Control Models (subjects, objects, and least privilege). Authentication from Securing Devices, which Problem 1 🔒 sets against authorization. The Foundations lesson Web Applications, Databases, and Files shows where an application's files sit. No command-line experience is needed: every item prints its ls -l listing.
Skills
2.A Identify security controls, and explain how they mitigate risks.
2.D Implement and log mitigations with and without the support of AI.

The one idea: An ls -l permission string is three sets of rwx: the owner's, the group's, and everyone else's. Find the one set that applies to the account and read its three letters. To change it, chmod takes either three digits (4 read, 2 write, 1 execute, added up) or letters (u, g, o, a, then + or -, then r, w, x).

Day by day

Day 1 · Reading the permission string45 min

Day 2 · Showing and changing permissions45 min

Day 3 · Settings that fit, and CED Scenario 5A45 min

Differentiation

If students are struggling
Give a card with three columns, owner, group, and others, each split into r, w, and x, and have students copy the string into it before answering. Do Problem 8 🔒 and Problem 11 🔒 together, circling the set that applies to the account.
Extension
Students write a four-file ls -l listing for a club or team, with a one-line requirement for each file and one setting that reaches too far. A partner finds it and writes the fix in both forms.
Vocabulary support
authorization, authentication, owner, group, others, read, write, execute, numeric method, symbolic method, ls -l, chmod, getfacl.

From the course framework

LO 5.2.D Configure access control settings on a Linux-based system.

  • 5.2.D.1 Authorization is when an entity is granted permission to have a certain type of access to a resource. Access controls are put in place to control which users have what types of access to which data.
  • 5.2.D.2 There are three types of access to a file in Linux that can be set, and they always come in the following order: i. Read access allows a user to view the contents of a file. ii. Write access allows a user to make changes to a file. iii. Execute access allows a user to run a binary file such as a program. These are abbreviated rwx, respectively. If a user only has read and execute permissions (not write), then it would display as r-x. The - symbol indicates the absence of that permission.
  • 5.2.D.3 There are three default entities for which permissions are set and always in this order: (1) the file owner, (2) the file group, and (3) all other users. The three sets are displayed with no spaces (e.g., rwxrwxrwx).
  • 5.2.D.4 To view the current permission settings for a file, use the command ls -l, which will show the current settings for the default entities. If there is a + symbol at the end of the permissions, this means that other permissions have been set for that file and it can be viewed with the getfacl command.
  • 5.2.D.5 To modify the permission settings for a file, use the chmod command. This command can be used with the numeric method or the symbolic method.
  • 5.2.D.6 To use chmod in the numeric method the syntax is chmod ### filename. Each of the three ### represents one of the three entities mentioned above (the owner, the group, other nongroup users). The first # = the owner. The second # = the group. The third # = other nongroup users. The permission for each entity is determined by adding up the values for the types of access to be granted: 0 = no permissions, 1 = execute, 2 = write, 4 = read. Therefore 3 sets permission to write and execute, 5 sets permission to read and execute, 6 sets permission to read and write, and 7 sets permission to read, write, and execute.
  • 5.2.D.7 To use chmod in the symbolic method the syntax is chmod entity +(or -) permission filename. The entities are the user owner, the group, and other nongroup users. Each entity is represented with a single letter. u = user owner, g = group, o = others, a = all. Permission can be either added or removed to any combination of entities. + = add the permission, - = remove the permission. The permissions that can be set are read, write, and execute. r = read, w = write, x = execute. Entities and permissions can be combined in a single command. To add the read and execute permissions for the group and user owner for a file called testfile, the command would be chmod ug+rx testfile.