security

How to test Keycloak authentication in Spring Boot application?

青春壹個敷衍的年華 提交于 2020-07-05 10:38:05
问题 In a Spring Boot project we enabled Spring Security and applied Keycloak authentication with bearer token like described in the following articles: https://www.keycloak.org/docs/3.2/securing_apps/topics/oidc/java/spring-security-adapter.html https://www.keycloak.org/docs/3.2/securing_apps/topics/oidc/java/spring-boot-adapter.html But i can't find any recommendations how to make automation tests so that the Keycloak config is applied. So, how to test/mock/verify the Keycloak configuration when

How to secure own backend API which serves only my frontend?

只愿长相守 提交于 2020-07-05 02:52:38
问题 I'm setting up a webapp with a frontend and a backend that communicates with the frontend soley through RESTful methods. How do I make sure that the backend endpoints are only accessed by my own frontend, and not anyone else? I cannot find much information on this. 回答1: How do I make sure that the backend endpoints are only accessed by my own frontend, and not anyone else? Let me tell you here a cruel truth... is not possible for a web app, due to the nature how the web was designed to work.

How to secure own backend API which serves only my frontend?

谁都会走 提交于 2020-07-05 02:52:10
问题 I'm setting up a webapp with a frontend and a backend that communicates with the frontend soley through RESTful methods. How do I make sure that the backend endpoints are only accessed by my own frontend, and not anyone else? I cannot find much information on this. 回答1: How do I make sure that the backend endpoints are only accessed by my own frontend, and not anyone else? Let me tell you here a cruel truth... is not possible for a web app, due to the nature how the web was designed to work.

Is it possible to predict future 2FA values given older values with timestamps?

ⅰ亾dé卋堺 提交于 2020-07-03 10:01:12
问题 Is it safe to share 2FA codes? I'm talking about TOTP like Google Authenticator or Authy . For example, if i have code and generation time, is it possible to predict new codes? What if i have more than 1 pair of code+time? I think it's possible to predict new codes based on old information (code+time). So if this is possible, how do I do it? Im looking for some algorithm. Known Time period, time, code and secret length. Example: 22:20:30 561918 22:21:00 161664 22:21:30 610130 回答1: Internally,

How do canary words allow gcc to detect buffer overflows?

那年仲夏 提交于 2020-07-03 09:45:52
问题 I could test using strncpy() with larger source string then the destination: int main() { char *ptr = malloc(12); strcpy(ptr,"hello world!"); return 0; } Compiling with the flag -fstack-protector and using the -S option I got: .file "malloc.c" .text .globl main .type main, @function main: .LFB2: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 movq %rsp, %rbp .cfi_def_cfa_register 6 subq $32, %rsp movl %edi, -20(%rbp) movq %rsi, -32(%rbp) movq %fs:40, %rax movq %rax, -8(

How do canary words allow gcc to detect buffer overflows?

喜欢而已 提交于 2020-07-03 09:45:18
问题 I could test using strncpy() with larger source string then the destination: int main() { char *ptr = malloc(12); strcpy(ptr,"hello world!"); return 0; } Compiling with the flag -fstack-protector and using the -S option I got: .file "malloc.c" .text .globl main .type main, @function main: .LFB2: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 movq %rsp, %rbp .cfi_def_cfa_register 6 subq $32, %rsp movl %edi, -20(%rbp) movq %rsi, -32(%rbp) movq %fs:40, %rax movq %rax, -8(

OAuth2 for mobile apps with simplest client-server architecture?

和自甴很熟 提交于 2020-07-01 07:33:49
问题 We have a classical C-S(client-server) architecture, i.e. a mobile app and a business server. We have our own account system (not using 3rd party accounts such as Google/Facebook account). I know I should use OAuth2 for authentication. The problem is, how shall I implement that ? There are two things that I did not found on the Internet: We are using our own account system - no Google/Facebook account. The user should input his password in the native app UI, not in a browser webpage embedded

adding httponly and secure flag for set cookie in java web application

时光怂恿深爱的人放手 提交于 2020-06-28 14:40:27
问题 I want to add the httponly and secure flags for Cookies. To implement it, I am using Filters which are configured in web.xml . The code for adding flags is as below: package com.crisil.dbconn; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.Cookie; import javax.servlet.http

adding httponly and secure flag for set cookie in java web application

百般思念 提交于 2020-06-28 14:33:16
问题 I want to add the httponly and secure flags for Cookies. To implement it, I am using Filters which are configured in web.xml . The code for adding flags is as below: package com.crisil.dbconn; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.Cookie; import javax.servlet.http

How to hit Secure Elastic Search through Java High Level Rest Client

a 夏天 提交于 2020-06-28 03:37:56
问题 I'm new to Elastic search. Integrated my Spring boot application with Elastic search through Java High Level Rest Client . I've configured JHLRC bean as below and it worked fine: @Bean(destroyMethod = "close") public RestHighLevelClient client() { RestHighLevelClient client = new RestHighLevelClient( RestClient.builder(new HttpHost("localhost", 9200, "http"))); return client; } Started exploring the security for Elasticsearch, after setup certificate and passwords, I've enabled security by