security

How Do You Secure database.yml?

拈花ヽ惹草 提交于 2020-01-30 13:59:04
问题 Within Ruby on Rails applications database.yml is a plain text file that stores database credentials. When I deploy my Rails applications I have an after deploy callback in my Capistrano recipe that creates a symbolic link within the application's /config directory to the database.yml file. The file itself is stored in a separate directory that's outside the standard Capistrano /releases directory structure. I chmod 400 the file so it's only readable by the user who created it. Is this

How do you detect if firefox DevTools is open? [duplicate]

跟風遠走 提交于 2020-01-30 13:31:38
问题 This question already has answers here : How to detect if browser console / inspector is *open*? (3 answers) Closed 8 months ago . I've been searching high and low but all I could find are ways to detect chrome Dev Tools and FireBUG Dev Tools. Is there a way to detect, on Firefox , that the Inspect Element/console/Dev Tool is open? 回答1: It is impossible to actually hide your client side source code without actually removing said code from being accessed client side. The simple reason for this

How do you detect if firefox DevTools is open? [duplicate]

[亡魂溺海] 提交于 2020-01-30 13:30:32
问题 This question already has answers here : How to detect if browser console / inspector is *open*? (3 answers) Closed 8 months ago . I've been searching high and low but all I could find are ways to detect chrome Dev Tools and FireBUG Dev Tools. Is there a way to detect, on Firefox , that the Inspect Element/console/Dev Tool is open? 回答1: It is impossible to actually hide your client side source code without actually removing said code from being accessed client side. The simple reason for this

how can I clean and sanitize a url submitted by a user for redisplay in java?

让人想犯罪 __ 提交于 2020-01-30 06:30:49
问题 I want a user to be able to submit a url, and then display that url to other users as a link. If I naively redisplay what the user submitted, I leave myself open to urls like http://somesite.com' ><script>[any javacscript in here]</script> that when I redisplay it to other users will do something nasty, or at least something that makes me look unprofessional for not preventing it. Is there a library, preferably in java, that will clean a url so that it retains all valid urls but weeds out any

How could one design a secure and “self-destructing” email?

回眸只為那壹抹淺笑 提交于 2020-01-29 17:52:22
问题 As most of you know, email is very insecure. Even with a SSL-secured connection between the client and the server that sends an email, the message itself will be in plaintext while it hops around nodes across the Internet, leaving it vulnerable to eavesdropping. Another consideration is the sender might not want the message to be readable - even by the intended recipient - after some time or after it's been read once. There are a number of reasons for this; for example, the message might

Best way to protect integrity of ajax request

五迷三道 提交于 2020-01-29 13:10:10
问题 I am building a Drupal website with a lot of user-specific information that will be posted using jQuery/ajax. The information it self is not very sensitive, it is just important to verify that the form-data has not been tampered with tools like Firebug, as well as ensuring the information is really requested from the specified user. In other words, I am trying to figure out the best way to protect the integrity and authenticity of the data when posting with ajax. Ideally I would like to use

Do the access levels and modifiers (private, sealed, etc) serve a security purpose in C#?

旧时模样 提交于 2020-01-29 10:42:27
问题 I've seen that you can manipulate private and internal members using reflection. I've also seen it said that a 'sealed' class is more secure that one that isn't. Are the modifiers "public, protected, internal, private, abstract, sealed, readonly" anything more than a gentleman's agreement about design and API use, that can be broken as long as you have access to reflection? And if a hacker is already is running code that calls your API, the game is already lost, right? Is the following

Do the access levels and modifiers (private, sealed, etc) serve a security purpose in C#?

回眸只為那壹抹淺笑 提交于 2020-01-29 10:42:13
问题 I've seen that you can manipulate private and internal members using reflection. I've also seen it said that a 'sealed' class is more secure that one that isn't. Are the modifiers "public, protected, internal, private, abstract, sealed, readonly" anything more than a gentleman's agreement about design and API use, that can be broken as long as you have access to reflection? And if a hacker is already is running code that calls your API, the game is already lost, right? Is the following

MySQL - How to store AES_Encrypted data?

只谈情不闲聊 提交于 2020-01-29 04:27:07
问题 So I have been browsing the internet, and came across the MySQL built-in function AES_ENCRYPT. It doesn't seem too hard to use, but some sources tell me to store the encrypted data as a VARCHAR, and some say to store it as a BLOB. What should I store the encrypted data as? 回答1: Many encryption and compression functions return strings for which the result might contain arbitrary byte values. If you want to store these results, use a column with a VARBINARY or BLOB binary string data type. This

Sandbox JVM to secure server from untrusted sources

血红的双手。 提交于 2020-01-29 03:57:07
问题 How can protecting my server from malicious activity when accepting and executing uploaded, untrusted code? The users should be able to implement my interface and given data, perform some calculations and return data. No I/O operations are required and certainly no thread/process manipulation or other tomfoolery. Using the java.policy file it is possible to deny everything (by granting nothing). $ cat test.policy grant { }; Using this policy file, operations not granted will cause a security