How can I secure user data in my Laravel CRUD app without admin access?

0
2
Asked By CodingNinja88 On

I'm currently using a master key stored in my .env file to encrypt user data in my Laravel app. The encryption process happens during each call, which means I could potentially read the user data myself. I'm looking for a method that completely prevents admin access or any possibility of a bad actor getting to the secured entries. It's important that any solution I consider is not too cumbersome for the end users. Any advice would be greatly appreciated!

4 Answers

Answered By DevGuru23 On

A good approach I’ve found is to encrypt user data with keys tied to their passwords, ensuring that only they can decrypt their information—admins won’t have access. Laravel doesn’t handle this right out of the box, so it would need to be implemented in the frontend, or you could go with user-generated keys. It does require some extra setup, but it maintains strong data privacy without too much hassle for users.

Answered By SecuritySeeker77 On

You might want to set specific columns as hidden in your models. That way, they aren’t easily accessible to anyone, including admins. Ideally, this doesn't have to be a big lift for your app but would help in keeping sensitive data more secure.

Answered By SysAdminSam On

Utilizing Linux permissions, users, and groups could also be a solution. I’m managing things as a non-root user, but I also appreciate the idea of having a complete zero-access protocol that can’t be bypassed, even by root access. However, it sounds like you're wary of making users handle complex key management like PGP, which is a valid concern!

Answered By TechWanderer45 On

One option to ensure you can't access user data is to have it encrypted using a key that the user holds personally. However, this might require substantial changes to your application since the server won’t be able to see the actual data, putting more work on the client side. Plus, if a user loses their key, there's no way for them to recover their data. It's definitely a trade-off to consider!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.