Open louis030195 opened 1 month ago
/attempt #466
with your implementation plan/claim #466
in the PR body to claim the bountyThank you for contributing to mediar-ai/screenpipe!
@louis030195 After reviewing the Screenpipe repository and considering security requirements, here is a detailed breakdown of the proposed milestones and subtasks for encrypting data in my mind
RustCrypto
and PII removal.For a $300 bounty, implementing all six milestones might be too ambitious as each milestone could involve significant research, coding and testing . Maybe we can tackle other milestones in follow-up issues if considered.
After reviewing the effort involved, I propose focusing on two tasks that are feasible within the bounty scope. Here's the breakdown of tasks I am thinking to do if it aligns well
Task 1: Encrypt Data in HTTP Requests
This is as outlined above
Task 2: Investigate Rust for Encryption & PII Removal
Here are 50 potential solutions to enhance screenpipe's security while maintaining API, file, and database access:
remember, the key is to implement these solutions in a way that balances security with usability and performance. some of these may require careful consideration and testing to ensure they don't negatively impact the user experience or system performance.
A possible first step would be to encrypt the database. There are a few alternatives, like Turso, SQLCypher, or whatever we are less resistant to implementing on our codebase. We can use this keyring implementation. It's compliant with Linux, Mac, Windows, and more.
From what I see since launchbadge/sqlx#2014 we may be able to get encryption on sqlx out of the box.
My implementation plan:
Handling media (file encryption) and using HTTPS on the API will each require its own issue. Doing everything at once, given its uncertainty, is a too-broad scope, and it is bug-prone. Because of that, I recommend keeping separate PRs for each of these things.
If you agree with the implementation plan, the first step will be to write some integration tests, ensure the API is accessing the database, interact with the API, check the values on the database, and so on. In this way, we can change the core implementation with confidence it'll not break (and if it breaks, we'll see it quickly on the PRs). But that's not on the scope of the 200$ bounty, so let me know what you think @louis030195.
A possible first step would be to encrypt the database. There are a few alternatives, like Turso, SQLCypher, or whatever we are less resistant to implementing on our codebase. We can use this keyring implementation. It's compliant with Linux, Mac, Windows, and more.
From what I see since launchbadge/sqlx#2014 we may be able to get encryption on sqlx out of the box.
My implementation plan:
- on the first initialization of the app without the key (to support this on who was using screenpipe before without deleting any data), generate a safe key and use native keyrings/vaults to hold the key
- use the keyring lib to fetch the key
- use the to encrypt/decrypt the db (when opening/closing the connection or something)
Handling media (file encryption) and using HTTPS on the API will each require its own issue. Doing everything at once, given its uncertainty, is a too-broad scope, and it is bug-prone. Because of that, I recommend keeping separate PRs for each of these things.
If you agree with the implementation plan, the first step will be to write some integration tests, ensure the API is accessing the database, interact with the API, check the values on the database, and so on. In this way, we can change the core implementation with confidence it'll not break (and if it breaks, we'll see it quickly on the PRs). But that's not on the scope of the 200$ bounty, so let me know what you think @louis030195.
nice, yeah, that sounds good plan, can you take notes on overhead it adds in terms of resource usage also?
please do not start working on this task until we have some clarity on the specific subtasks to be done
can you suggest different "milestones"?
random things i think of:
any other feature that increase security (better PII removal ...)
also if anyone know how hard it would be to implement this in rust: https://github.com/mediar-ai/screenpipe/tree/main/examples/python/local-llm-pii-removal
then we can write down subtasks accordingly and start the bounty!
/bounty 200