Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add audit log with tamper detection #81

Closed
wants to merge 1 commit into from

Conversation

Entity069
Copy link
Contributor

@Entity069 Entity069 commented Dec 16, 2024

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

@Entity069 Entity069 closed this by deleting the head repository Dec 17, 2024
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