'disable'에 해당되는 글 5건

  1. 2022.05.11 [Elasticsearch] 8.2.0 Docker Compose 예제.
  2. 2021.02.15 [Metricbeat] Module enable/disable.
  3. 2020.07.23 [Spring] Spring Security Session Timeout Disable.
  4. 2020.07.07 [Spring] Spring Security 기본 Login Form 제거 및 CSRF 만 사용하기
  5. 2020.05.20 [Spring] Spring Security Disabled.

[Elasticsearch] 8.2.0 Docker Compose 예제.

Elastic/Elasticsearch 2022. 5. 11. 16:42

Elasticsearch 7.x 와 다르게 8.x 에서는 기본 xpack.security.enabled: true 로 실행이 됩니다.

그래서 docker container 구성 시 보안 기능을 사용 하지 않고 예전 처럼 7.x 에서 사용 하듯이 사용 하고자 한다면 아래 예제를 참고해서 사용 하시기 바랍니다.

version: '3.7'
services:
  es-singlenode:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.2.0
    container_name: es-singlenode
    environment:
      - xpack.security.enabled=false
      - node.name=single-node
      - cluster.name=es-singlenode-c
      - discovery.type=single-node
    ports:
      - 9200:9200
      - 9300:9300
    networks:
      - es-bridge
networks:
  es-bridge:
    driver: bridge

저 같은 경우 xpack basic 을 사용 하기는 하지만 보안 기능을 사용 하지는 않습니다.

모두 private subnet 에서 구성해서 사용중이기도 하고 별도 ACL 통제를 통해서 접근 제어도 이루어 지고 있어서 인데요.

판단은 각자가 알아서 하셔야 할 것 같습니다.

 

:

[Metricbeat] Module enable/disable.

Elastic/Beats 2021. 2. 15. 10:05

[Enable]
$ ./metricbeat modules enable apache mysql

 

[Disable]
$ ./metricbeat modules disable apache mysql

:

[Spring] Spring Security Session Timeout Disable.

ITWeb/개발일반 2020. 7. 23. 07:55

application.yml 또는 properties 파일 내 아래와 같이 선언 하시면 됩니다.

server:
  servlet:
    session:
      timeout: 0

 

:

[Spring] Spring Security 기본 Login Form 제거 및 CSRF 만 사용하기

ITWeb/개발일반 2020. 7. 7. 08:33

사용하다 보면 별의 별 요구사항이 나오게 됩니다.

단순 하게 CSRF 만 사용 하고 싶은데 자꾸 login form 이 나와서 설정만으로 이걸 해결해 보고자 했습니다.

그러나 설정 만으로는 안되더라고요.

 

설정 예시) 비추천

security:
  enable:
    csrf: true
  basic:
    enabled: false

management:
  security:
    enabled: false

 

코드 예시) 추천

@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {

  @Override
  protected void configure(HttpSecurity httpSecurity) throws Exception {
    httpSecurity.httpBasic().disable();
  }
}

참고 정보)

dependencies {
  implementation 'org.springframework.boot:spring-boot-starter-quartz'
  implementation 'org.springframework.boot:spring-boot-starter-web'

  // thymeleaf
  implementation 'org.thymeleaf.extras:thymeleaf-extras-java8time'
  implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
  implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect'

  // spring security
  implementation 'org.springframework.boot:spring-boot-starter-security'
  implementation 'org.springframework.security:spring-security-test'
  implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'

  implementation 'org.webjars:jquery:3.5.0'
  implementation 'org.webjars:jquery-ui:1.12.1'
  implementation 'org.webjars.bower:bootstrap:4.4.0'

  compileOnly 'org.projectlombok:lombok'
  annotationProcessor 'org.projectlombok:lombok'
  providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
  testImplementation('org.springframework.boot:spring-boot-starter-test') {
    exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
  }
}


<meta id="_csrf" name="_csrf" th:content="${_csrf.token}" />
<meta id="_csrf_header" name="_csrf_header" th:content="${_csrf.headerName}" />

let token = $("meta[name='_csrf']").attr("content");
let header = $("meta[name='_csrf_header']").attr("content");

$(function() {
  $(document).ajaxSend(function(e, xhr, options) {
    xhr.setRequestHeader(header, token);
  });
});


spring:
  security:
    user:
      name: admin
      password: admin

 

 

:

[Spring] Spring Security Disabled.

ITWeb/개발일반 2020. 5. 20. 15:10

spring security 를 사용하면서 테스트를 위해 인증을 off 하고 싶을 때 사용 하면 됩니다.

 

Application main)
@SpringBootApplication(exclude = SecurityAutoConfiguration.class)

application.yml)
security:
  enable:
    csrf: false
  basic:
    enabled: false
  ignored: /**
management:
  security:
    enabled: false

위에서 처럼 두 군데에 적용해 주면 됩니다.

: