I’m working on a cyber security project and need support to help me understand better.
Pleasecreate a security layer which keeps a backup copy of a file in case itis written incorrectly. This is a common technique for things likefirmware images where a system may not be able to recover if the file iswritten incorrectly. For this assignment, a valid file must start withthe character ‘S’ and end with the character ‘E’. If any othercharacters (including lowercase ‘s’, ‘e’, etc.) are the first or lastcharacters, then the file is considered invalid.
Applications useABopenfile() to create or open a file. Files are created by settingcreate=True when calling ABopenfile(), the reference monitor will createa valid backup file called filename.a and an empty file we will writeto called filename.b. When close() is called on the file, if bothfilename.a and filename.b are valid, the original file’s data isreplaced with the data of filename.b. If filename.b is not valid, nochanges are made.
Write test applications to ensure your referencemonitor behaves properly in different cases and to test attacks againstyour monitor.
The Reference Monitor Must:
- Not modify or disable any functionality of any RepyV2 API calls, such as:
- Creating new files
- Opening an existing file
- Reading valid backup using readat()
- Writingto file using writeat(). This includes invalid writes, because ‘S’ and’E’ may later be written to the begining and end of the filerespectively.
- Check if file contents starts with ‘S’ and ends with ‘E’, only when close() is called.
- Update the original file with the new data IF the new data is valid on close().
- Not produce any errors
- Normal operations should not be blocked or produce any output
- Invalid operations should not produce any output to the user
The Reference Monitor Should:
- Create two copies of the same file (filename.a and filename.b)
- One is a valid backup to read from, and the other is written to
- When an app calls ABopenfile(), the method opens the A/B files, which you should name filename.a and filename.b.
- When the app calls readat(), all reads must be performed on the valid backup.
- When the app calls writeat(), all writes must be performed on the written to file.
Three design paradigms are at work in this assignment: accuracy, efficiency, and security.
- Accuracy:The security layer should only stop certain actions from being blocked.All other actions should be allowed. For example, if an app tries toread data from the backup file, this must succeed as per normal and mustnot be blocked. All situations that are not described above must match that of the underlying API.
- Efficiency:The security layer should use a minimum number of resources, soperformance is not compromised. For example, keeping a complete copy ofevery file on disk in memory would be forbidden.
- Security: Theattacker should not be able to circumvent the security layer. Forexample, if the attacker can cause an invalid file to be saved, read the”write to” file, or can write to the backup file we read from, then thesecurity is compromised.
Getting Python and RepyV2
Please refer to the Build Instructions for details.
Onceyou have built RepyV2 into a directory of your choice, change into thatdirectory. Use the command below in order to run your RepyV2applications:
python3 repy.py encasementlib.r2py [security_layer].r2py [application].r2py
(Replace'[security_layer].r2py’ and ‘[application].r2py’ by the names of thesecurity layers and application that you want to run.)
In order totest whether or not these steps worked, please copy and paste the codefound below for the sample security layer and sample attack.
"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you A results."