Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this assignment the student will write a basic BASH script. The script will be used to inspect a log file. Script Requirements The script

For this assignment the student will write a basic BASH script. The script will be used to inspect a log file.
Script Requirements
The script may be against a specific log file, or have the log file name determined by the command line. The student may determine which log file(s) or log file types to use. Note: Many log files are available in \var\sys\log.
The script will iterate through the log file and determine some useful information based on what it finds in the log file. The student may determine particular information to pull from the log file.
Examples:
How many times did user X log in between January and December?
List the time of every after hours use of the printer.
The script must allow for and use at least 2 command line arguments.
The command line arguments may either be used as a part of the determination (e.g. user or dates)
Or, to change the behavior of the script (e.g. count remote vrs. local access).
The script must include at least one function.
The script will follow the Scripting Best Practices as provided. The bash script needs to be built and tested using appropriate log files. In addition, it is recommended that the student have another student test their script to ensure it works correctly.
Submit a video report following the standard format, along with a copy of the script.
With the script completed and demonstrating its function, discuss how the script could be used by a security professional to aid in spotting, researching, or analyzing a potential security issue. When run with inappropriate arguments, scripts should print a usage message and exit. The same message could be printed with a help argument.
Validate inputs and sanity check derived values.
Return an appropriate exit code: zero for success and nonzero for failure.
Use appropriate naming conventions for variables, scripts, and routines.
User variable names that reflect the values they store.
Start every script with a comment block that tells what the script does and what parameters it takes. Include your name and the date. If the script requires non-standard tools, libraries, or modules to be installed, list those as well.
Comment at a useful level. More complexity requires more comments.
Error messages should:
Go to STDERR, not STDOUT.
Include the name of the program thats issuing the error.
State the function of operation that failed.
If a system call fails, include the perror string.
Exit with a code other than 0. give the code and the script

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions

Question

5. If yes, then why?

Answered: 1 week ago

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago