Golang-based Backend API for File Integrity Surveilance (FIS) Application. Creating this as a component for my Honors Project in CyberSecurity
  • Go 83.4%
  • HTML 16.6%
Find a file
2023-12-21 11:18:46 +05:30
handlers handlers - better error handling 2023-12-21 02:17:45 +05:30
models Refactoring project - Introducing handlers,models and utils- Updating previous hasher and idgen func + formatting 2023-11-28 15:17:18 +05:30
test test - Adding /upload /verify endpoint test file 2023-11-28 21:54:20 +05:30
utils Refactoring project - Introducing handlers,models and utils- Updating previous hasher and idgen func + formatting 2023-11-28 15:17:18 +05:30
.gitignore Adding .gitignore 2023-11-28 20:40:46 +05:30
go.mod Update Go version and dependencies to the latest versions 2023-12-21 02:24:30 +05:30
go.sum Update Go version and dependencies to the latest versions 2023-12-21 02:24:30 +05:30
LICENSE Adding LICENSE and README.md 2023-09-04 15:35:47 +05:30
README.md Updaing README.md - Verification complete 2023-11-28 22:21:16 +05:30
server.go server.go : declared but not used 2023-12-21 11:18:46 +05:30

Golang Backend API for FIS (File Integrity Surveillance) Application

Developing a simple Golang backend API with the Echo framework for FIS(File Integrity Surveillance) application which can be found here.
This API stores IDs and their corresponding hashes in a SQL server and provides functionality to verify if a given hash matches the stored hash for a specific ID. All the communication between the Application and API is secured using TLS encryption(HTTPS).
Thereby providing both confidentiality and integrity service that aligns with the CIA (Confidentiality, Integrity, Availability) triad for data security.

Getting Started

To get started with this project, follow these steps:

Prerequisites

  • Go installed on your machine.
  • A SQL database server(sqlite) to store IDs and hashes.

Installation

  1. Clone this repository to your local machine:
git clone https://github.com/justsaumit/go-fis-api.git
cd go-fis-api
  1. Initialize and install project dependencies using Go modules:
go mod vendor
  1. Create a configuration file (e.g., config.yaml) to specify your database settings and other configurations.

  2. Run the server:

go run server.go

Usage

Once the server is running, you can access the API endpoints to add file hashes and verify them.

  • To add a file hash, make a POST request to /upload by uploading the file using multipart form, an generated ID and hash would be returned.
  • To verify a file hash, make a POST request to /verify with previously generated ID and the file, a JSON message with Hashes matching or not will be recieved as response .

Usage

Once the server is operational, you can interact with the API endpoints to add and verify file hashes.

  • Adding a File Hash:

    • To add a file hash, send a POST request to the /upload endpoint. You'll need to upload the file using multipart/form-data. The server will generate an ID and a hash for the uploaded file, which will be returned in the response.
  • Verifying a File Hash:

    • To verify a file hash, send a POST request to the /verify endpoint. Include the previously generated ID as a form field and upload the file using multipart/form-data. The server will respond with a JSON message indicating whether the hash of the uploaded file matches the stored hash for the given ID.

To-Do-List

  • Handle Uploaded files (API)
  • Perform short ID Generation (API)
  • Perform Hashing (API)
  • Connect with DB
  • Store JSON data to DB
  • Perform verification

License

This project is licensed under the MIT License - see the LICENSE file for details.