{"id":13641753,"url":"https://github.com/lsds/LibSEAL","last_synced_at":"2025-04-20T11:32:05.629Z","repository":{"id":68536499,"uuid":"130025942","full_name":"lsds/LibSEAL","owner":"lsds","description":"Secure auditing of Internet services with Intel SGX","archived":false,"fork":false,"pushed_at":"2021-04-30T05:07:50.000Z","size":2216,"stargazers_count":22,"open_issues_count":1,"forks_count":6,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-08-03T01:24:35.677Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lsds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-04-18T08:00:04.000Z","updated_at":"2024-01-13T23:58:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"e4d016b4-a244-4f1f-84d2-23973652d7f2","html_url":"https://github.com/lsds/LibSEAL","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsds%2FLibSEAL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsds%2FLibSEAL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsds%2FLibSEAL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsds%2FLibSEAL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lsds","download_url":"https://codeload.github.com/lsds/LibSEAL/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223827630,"owners_count":17209818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:01:23.975Z","updated_at":"2025-04-20T11:32:05.613Z","avatar_url":"https://github.com/lsds.png","language":"C","funding_links":[],"categories":["Encrypted Databases and Key-value Stores"],"sub_categories":["Library OSes and SDKs"],"readme":"# LibSEAL\n\nLibSEAL is a SEcure Auditing Library for internet services. It allows to\ndetect integrity violations of internet services without the need to\ntrust the service operator. To do so, LibSEAL: (i) constructs a secure\nlog of requests and responses exchanged between clients and the internet\nservice; and (ii) periodically checks the log for integrity violations.\nTechnically, LibSEAL combines [TaLoS](https://github.com/lsds/TaLoS), a\nsecure TLS communication library, with [SQLite](https://www.sqlite.org)\nin order to create and check logs. Further details about the operation\nof LibSEAL are described in the corresponding [EuroSys'18\npublication](https://lsds.doc.ic.ac.uk/content/libseal-revealing-service-integrity-violations-using-trusted-execution).\n\nThis repository contains the source code of LibSEAL. It ships as a set\nof patches on top of TaLoS. In particular, the repository ships with\nauditing modules for the Dropbox, Git and ownCloud services.\n\n## Compilation and installation\n\nLibSEAL builds on top of the TaLoS library. You thus need to clone both\nthe TaLoS and the LibSEAL repositories:\n```bash\n$ git clone https://github.com/lsds/TaLoS\n$ git clone https://github.com/lsds/LibSEAL\n```\n\nWe assume that you have cloned TaLoS into the `${TALOS_ROOT}` directory\n(e.g. `/home/\u003cusername\u003e/talos/`) and that you have cloned LibSEAL into\nthe `${LIBSEAL_ROOT}` directory (eg `/home/\u003cusername\u003e/libseal/`).\n\nYou first need to copy the LibSEAL patches into the TaLoS source directory:\n```bash\n$ cd ${TALOS_ROOT}/src\n$ cp -r ${LIBSEAL_ROOT}/src/libseal .\n$ cd talos \u0026\u0026 ./patch_libressl.sh \u0026\u0026 cd ..\n$ cd libseal \u0026\u0026 ./patch_talos.sh \u0026\u0026 cd ..\n```\n\nAfter that, please follow the instructions in the [TaLoS readme\nfile](https://github.com/lsds/TaLoS/blob/master/README.md). Since you applied the\nLiBSEAL patches above, this will indeed compile LibSEAL.\n\nBy default, LibSEAL uses the Git auditing module. To use LiBSEAL with\nmodules (ownCloud or Dropbox), you need to change the\n`enclave.signed.so` symlink and the `auditing.so` symlink to point to\nthe appropriate auditing module in directory\n`${TALOS_ROOT}/src/libressl-2.4.1/crypto`.\n\n## Auditing modules\n\nLibSEAL ships with three auditing modules, for Dropbox, Git and ownCloud.\nThese are located in directory\n`${TALOS_ROOT}/src/libressl-2.4.1/crypto/auditing`.\n\nEach module defines:\n- Code to process the service's HTTP requests/responses, extracting\ninformation to create the logs that will be checked for integrity\nviolations;\n- SQL queries to check for integrity violations. These queries return an empty set only if no violations have been detected. The definition\nof an integrity violation depends on the service. For example, for\nDropbox, LibSEAL detects whether the list of files provided by Dropbox\ncorresponds to the list of files that the client has uploaded;\n- SQL queries to trim the log, i.e., to remove entries that are no\nlonger needed to check the log. Trimming queries are used to reduce the\nlog size.\n\n## Monotonic counter service\n\nLibSEAL can use a distributed monotonic counter service to prevent\nrollback attacks. The implementation (files `mcservice.c` and\n`mcservice.h` in directory\n`${LIBSEAL_ROOT}/src/monotoniccounterservice`) is similar to the service\ndescribed in the [ROTE](https://www.usenix.org/system/files/conference/usenixsecurity17/sec17-matetic.pdf) paper.\n\nTo use this service, you first need to define the\n`USE_MONOTONIC_COUNTER_SERVICE` macro in `enclaveshim_config.h`. Then,\nyou need to create a `monotonic_counter_service.txt` file that has to be\naccessible by your application (see the `mcservice_initialize()`\nfunction in `mcservice.c`). This file must contain the IP address of\nevery machine that will be used for the monotonic counter service. These\nmachines must start the server present in the\n`${LIBSEAL_ROOT}/src/monotoniccounterservice` directory. Two scripts, to\nstart and stop a server, are provided in this directory.\n\nUpon startup, LibSEAL will connect to these servers. It will then\nexchange (encrypted) messages for each database insert in order to\nincrement the monotonic counter.\n\n## Controlling LibSEAL behaviour\n\nLibSEAL adds several new macros in the `enclaveshim_config.h` file:\n- `DO_LOGGING`: define this macro if you want to use the logging module;\n- `LOG_FOR_SQUID`: define this macro if you are using Squid. This is to\navoid logging both the messages transmitted between the client and the\nproxy and the messages transmitted between the proxy and the server;\n- `USE_MONOTONIC_COUNTER_SERVICE`: define this macro to use the distributed\nmonotonic counter service. See the previous section for more details;\n- `SQLITE_DB_NAME`: this macro defines the path and name of the SQLite\ndatabase that contains the log  or `:memory:` for an in-memory database;\n- `SQLITE_DO_INSERT`: define this macro to execute the database\ninsertions. This macro was used in our experimental evaluation to\nmeasure the cost of the processing of HTTP messages without any database\noperation;\n- `SQLITE_ASYNC_MODE`: define this macro to write the database\nasynchronously to disk;\n- `SQLITE_ADD_HASH`: define this macro to add a hash to every database\nentry, for integrity;\n- `SQLITE_DO_SIGN`: define this macro to add a signature to every\ndatabase entry, for integrity;\n- `SQLITE_DO_CHECK`: define this macro to periodically check for\ninvariant violations;\n- `SQLITE_CHECKAFTER`: this macro controls the period, in terms of\nnumber of entries inserted into the database, at which the SQL queries\nfor revealing invariant violations are executed;\n- `SQLITE_DO_TRIMMING`: define this macro to execute the trimming query,\nin order to remove from the log entries that are no longer necessary.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsds%2FLibSEAL","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flsds%2FLibSEAL","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsds%2FLibSEAL/lists"}