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

[8.x] Introducing Job Encryption #35527

Merged
merged 4 commits into from Dec 11, 2020
Merged

Conversation

themsaid
Copy link
Member

@themsaid themsaid commented Dec 7, 2020

This PR adds a UsesEncryption interface. When the interface is used, laravel will encrypt the command inside the payload and decrypt it while running CallQueuedHandler.

Encrypting the command payload hides the job class properties which may hold sensitive information (API keys, passwords, personal information, etc...).

@crnkovic
Copy link
Contributor

crnkovic commented Dec 8, 2020

Is there any downside to using this all the time?

@themsaid
Copy link
Member Author

themsaid commented Dec 8, 2020

@crnkovic The overhead of encryption/decryption plus the extra payload size might not be necessary for most jobs.

@crnkovic
Copy link
Contributor

crnkovic commented Dec 8, 2020

@themsaid With the implementation of AES operations directly into most modern CPUs' instruction set, OpenSSL encryption/decryption (which Laravel uses) runs very, very fast. There is no overhead. 2 MB of data gets encrypted and decrypted in 0.050s with OpenSSL using AES-256-CBC as cipher. But I (relatively) agree with the payload size though, especially when using in-memory store like redis (or SQS which has the payload limit) since the payload size will double when encrypted.

@taylorotwell
Copy link
Member

@themsaid can we put an integration test on this?

@themsaid
Copy link
Member Author

@taylorotwell done

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.

None yet

3 participants