Skip to content

Conversation

@Entity069
Copy link
Contributor

Related Issue

Closes #39

Type of Change

  • New Feature
  • Bug Fix
  • Code Refactor
  • Documentation Update
  • Other (please specify):

Description of Change

Implemented a feature for audit logs and tamper detection with the logs

Implementation Details

  • Implemented a ActionLogger class which creates a .txt log files and stores all action of the user
  • Used sha256 hashes for integrity from hashlib library
  • It maintains integrity in the following way: the first entry of the log GENESIS_ENTRY , has a sha256 hash of the text GENESIS_ENTRY; the hashes of the next following lines are generated by taking the hash of the current log entry (date and small description of the task) + hash of the last entry
  • Added a custom exception called IntegrityError which checks for tampering with the log files. If a tampering is detected then IntegrityError is raised and the script exits
  • The main.py file now checks for the tampering at the beginning before adding/extracting any data
  • Added an option to print log in main.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add audit log with tamper detection

1 participant