security

Each user and their role in every database on the server

女生的网名这么多〃 提交于 2019-12-23 23:36:44
问题 How do I get each user and their role in every database on the server? I figure I'd start with this: SELECT * FROM sys.database_role_members drm INNER JOIN sys.database_principals rp ON drm.role_principal_id = rp.principal_id INNER JOIN sys.database_principals mp ON drm.member_principal_id = mp.principal_id 回答1: I think I figured it out: DECLARE @table TABLE ( SERVER VARCHAR(100), db_name VARCHAR(100), db_role VARCHAR(100), db_user VARCHAR(100) ) INSERT INTO @table EXEC sp_msforeachdb ' USE [

How could I read a JSF session bean from a filter?

大憨熊 提交于 2019-12-23 23:22:13
问题 I'm searching but I can't find the answer, I need secure resources based on permissions, I can't use a filter because FacesContext is not initialized before and I need load the permissions in my session bean. Some solution avoiding use a filter? PhaseListener, ViewHandler and ResourceHandler can't capture an URL resource request, for example I need denied this direct access: http://127.0.0.1:8080/test/resources/images/image.jpg Thx in advance... 回答1: JSF stores session scoped managed beans as

Simple way to hash password client side right before submitting form

[亡魂溺海] 提交于 2019-12-23 23:12:23
问题 Without any common JS libraries, how can I hash a password before sending it? <form> <input type="password" id="pwd" name="password" /> <input onclick=" var val = document.getElementById('pwd').value; document.getElementById('pwd').value(sha512(val));" type="submit"> </form> That would somehow be my naive way to do it (with sha512 being a function defined somewhere to create the sha512 value) Though it obviously does not seem to work. Why? How do I do this right and simple? 回答1: Lots of

What is the laravel way of storing API keys?

江枫思渺然 提交于 2019-12-23 23:08:16
问题 Is there a specific file or directory that is recommended for storing API keys? I'd like to take my keys out of my codebase but I'm not sure where to put them. 回答1: You can make your API keys environment variables and then access them that way. Read more about protecting sensitive configuration from the docs. You simply create a .env.php file in the root of your project that returns an array of environment variables. <?php return array( 'SECRET_API_KEY' => 'PUT YOUR API KEY HERE' ); Then you

ExtJS Store SYNC with Spring Security ON

丶灬走出姿态 提交于 2019-12-23 23:06:18
问题 I am new to Spring Security and I have added it to my project. Everything seems to work perfectly Login/Logout and even navigating across screens. Only when I tried to have an ExtJS grid and added a record in the store and then called the sync() method of the store, I got - Invalid CSRF Token 'null' was found on the request parameter '_csrf' or header 'X-CSRF-TOKEN'. I know that I need to pass _csrf with the request but I would like to know from all of you about the best way to get this done.

Firefox OS CSP restrictions on privileged apps

风流意气都作罢 提交于 2019-12-23 22:54:57
问题 To test Firefox OS capabilities, I’m writing a privileged app that can have access to various APIs on the device, but I got stuck in the development. I hope you can help me, I cannot find any useful documentation... I’d like to have access to Google Maps APIs from my app, but this requires a script to be loaded outside of app package ( Something like <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?....."></script> ). Because of CSP restrictions in privileged apps,

Comparing input password to stored hashed password in a web app

喜夏-厌秋 提交于 2019-12-23 22:17:07
问题 After reading this beautiful question: Why is char[] preferred over String for passwords?, I'm curious as to how this applies to servlet based web applications. Say your UI has some input field for the password, the password will be retrievable with request.getParameter("passwordFieldName") which returns a String . Even if you then convert it to a char[] , you have to wait for GC to clear the String object. Also, many of the Encryption/Hashing libraries I'm looking into using for password

How to set copy all environment variables from root user to another specific user

≯℡__Kan透↙ 提交于 2019-12-23 22:11:21
问题 In my docker container I am running a command as a specific user like this from entrypoint.sh : sudo -u appuser "$@" This works fine, however, it doesn't set any of the environment variables that get created by using the --link option while running the container. Question Is it possible to set all environment variables that exist for a root user to some other specific user (in this example appuser ) Note: related question to this discussion. This is the reason I can't just use the USER

How to disable SSLv3 protocol in Apache ActiveMQ?

淺唱寂寞╮ 提交于 2019-12-23 21:23:50
问题 I want to disable SSLv3 protocol in Apache ActiveMQ. Can not find relevant information here: http://activemq.apache.org/ssl-transport-reference.html The link above only shows how to configure CipherSuites 回答1: There is an enabledProtocols option you can use on the transport connector. You can't exclude, but you can choose valid protocols. transport.enabledProtocols=<comma separated list of SSL/TLS protocols> So, a TLS only "default" transport connector should look like this:

FormsAuthenticationTicket cannot be invalidated server side. Causing cookie reply attacks

烂漫一生 提交于 2019-12-23 21:08:03
问题 I have an ASP.NET web application using forms membership authentication. We have recently been penetration tested and an issue that was flagged was the ability to steal a users account. If the .ASPXAUTH cookie value was copied from a user before logging out a user could log in as a different user, edit their cookie to match the copied value and get all of their privileged. On logging out I have tried: Removing the cookie. I could successfully do this but it doesn't invalidate the