Linux Professional Institute

  • Linux Professional Institute LPIC-1
  • Linux Professional Institute LPIC-2
  • Linux Professional Institute LPIC-3
  • Linux Professional Institute DevOps Tools Engineer
  • Linux Professional Institute BSD Specialist

Red Hat

  • Red Hat Certified System Administrator (RHCSA)
  • Red Hat Certified Engineer (RHCE)
  • Red Hat Certified Specialist in Virtualization (RHCVA)

The Linux Foundation

  • Linux Foundation Certified System Administrator (LFCS)
  • Certified Kubernetes Application Developer (CKAD)
  • Cloud Foundry Certified Developer (CFCD)
  • Linux Foundation Certified Engineer (LFCE)
  • Certified Kubernetes Administrator (CKA)
  • Certified Hyperledger Fabric Administrator (CHFA)
  • Certified Hyperledger Sawtooth Administrator (CHSA)

Linux SUSE Certifications

  • SUSE Certified Linux Administrator: Entry-level certification intended for people who have the knowledge of the SUSE Linux Enterprise 12 operating system and the administration. You need to attend the LI-3124 course to acquire this certification.
  • SUSE Certified Linux Professional: Senior-level certification that approves the candidates’ knowledge and aptitudes as they move towards the advanced administration of the SUSE Linux Enterprise 12 operating system. You need to attend LI-2124 and LI-3125 courses to acquire this certification.
  • SUSE Certified Linux Engineer: Senior-level certification that approves the candidates’ knowledge and aptitudes related to SUSE specific tasks related to systems administration, storage, networking, disaster recovery, and virtualization. You need to have a CLP 11 or 12 certifications to acquire this certification. It is suggested that applicants attend the LI-3124, LI-3125, and the up and coming CLE courses.

Oracle Linux Certification

  • Oracle Certified Associate, Linux 5 and 6
  • Oracle Certified Professional, Oracle Linux 6
  • Oracle Linux 6 Certified Implementation Specialist

Reference

'Dev Story' 카테고리의 다른 글

[QGIS] QGIS for Peace  (0) 2022.03.02


AND




자바 기반의 로그 생성 라이브러리인 Log4j 2에서 중대하고 심각한 보안 취약점이 발견이 되었다는 소식이 전해졌다. GeoServer도 Log4j로 로그를 생성하는 기능이 관리 기능으로 포함되어 있기 때문에 즉시 점검이 필요했다.

 

지난 2021년 12월 13일 GeoServer 공식 사이트에 취약점 코드 CVE-2021-44228 대응법을 안내하는 Andrea Aime의 글이 GeoServer Blog를 통해 공개되었다.

 

http://geoserver.org/announcements/2021/12/13/logj4-rce-statement.html

 

Log4J2 zero day vulnerability assessment

The Java world has been taken by storm, last week, by the Log4J2 Log4Shell vulnerability, code CVE-2021-44228, which allows remote code execution by simply making API calls to the vulnerable servers. The understanding of the vulnerability is still evolving

geoserver.org

 

주요 내용은 아래와 같다.

  1. GeoServer는 문제가 되고 있는 Log4J 2를 사용하지 않아 CVE-2021-44228에 취약하지 않다. (GeoServer 래거시 버전, 최근에 릴리즈된 2.20.0에도 Log4j 1.2.17을 사용하고 있다.)
  2. GeoServer가 사용중인 Log4J 1.2.17 버전에도 CVE-2019-17571 보안 이슈가 있는데, SocketServer 클래스가 서버 명령줄에서 실행되야 하기 때문에 경미한 이슈라고 할 수 있다.
  3. 공격자가 서버에 직접 접근하여 로깅 구성 파일을 직접 수정해야 트리거로 사용할 수 있기 때문에 Log4j와 관련된 GeoServer의 기본 구성은 보안에 취약하지 않다.
  4. GeoServer 프로젝트는 취약점 CVE-2021-44228과 CVE-2019-17571과 관련된 클래스를 포함하고 있지 않은 Log4j 1.2.17 삭제된 버전의 라이브러리를 공개하였다. 이 라이브러리는 이전 버전의 GeoServer 에서도 사용할 수 있다.
  5. 기존 log4j-1.2.17.jar를 제거하고 새로운 log4j-1.2.17.norce.jar를 geoserver/webapps/WEB-INF/lib 폴더에 넣고 WAS를 재시작하면 패치가 완료 된다.
    (
    https://repo.osgeo.org/repository/geotools-releases/log4j/log4j/1.2.17.norce/log4j-1.2.17.norce.jar)
  6. Log4J 1.2.17은 EOL(End Of Lift) 프로젝트로 최신 버전으로 업그레이드 하기 위해서는 펀딩이 필요하다. 현재 릴리즈된 버전에 적용하기 위해서는 잠재적인 역호환성 문제가 있어 적용이 힘들고 2.21.x 버전부터는 새로운 로깅 라이브러리를 적용할 수 있을 것으로 기대한다.

끝.



AND




58
Duplicate item added to a unique collection. For example, it may be that you tried to add the same layer to a map twice. Check for calls to map.addLayer() or other places where the map's layer collection is modified.

유니크한 컬렉션이 중복으로 추가되었다. 

 

하나의 View를 공유해서 Map에 사용할 수 있다. 하지만 Layer는 복제해서 사용할 수 없다.



AND




 

GeoServer web.xml

<context-param>
	<param-name>ENABLE_JSONP</param-name>
	<param-value>true</param-value>
</context-param>

 

Request WFS

var wfsParams = {
    service: 'WFS',
    version: '1.1.0',
    request: 'GetFeature',
    typeName: 'vizm:tl_scco_sig',
    maxFeatures: '50',
    srsName: 'EPSG:4326',
    outputFormat: 'text/javascript',
    format_options: 'callback:responseJSON'
};

$.ajax({
    url: 'http://localhost:8081/geoserver/vizm/wfs',
    data: $.param(wfsParams),
    type: 'GET',
    jsonpCallback: 'responseJSON',
    dataType:'jsonp',
    success: function(data) {
        console.log(data);
        L.geoJson(data, {
        	onEachFeature: function(feature, layer) {
                var popupContent = "</p>" + feature.geometry.type + "</p>";
                if (feature.properties && feature.properties.sig_kor_nm) {
					popupContent += feature.properties.sig_kor_nm + '(' + feature.properties.sig_eng_nm + ')';
				}
                layer.bindPopup(popupContent);
			}
        }).addTo(map);
	}, error: function(xhr, status, thrown) {
    	console.log(status);
	}
});

 


Reference



AND




GeoServer를 윈도우에서 콘솔로 띄워 시작할 경우 퍼블리싱 되어 있는 레이어, 스타일 정보와 같은 많은 로그를 출력한다. 서비스에 올라가 있는 레이어가 몇개 안된다면 별다른 문제가 없겠지만 대부분의 운영 환경에서는 많은 양의 레이어가 서비스되고 있을 것이다. 그런데 그 레이어 관련 로그를 하나하나 콘솔창에 찍거나 로그 파일에 저장이 된다면 상당한 양의 로그가 저장이 될 것이다. 특히 WMS의 경우 타일 형식으로 서비스 되기 때문에 하나의 지도 영역을 그리기 위해 타일수 대로 로그가 찍힌다면 엄청난 양의 로그가 생성되는 것이다.

 

이런 문제를 해결하기 위해 간단히 설정 파일을 변경하여 처리해 줄 수 있다. GeoServer는 로그 관리를 위해 Log4j를 사용하는데 다양한 로그 정책을 선택할 수 있도록 설정 파일을 제공하고 이를 사용자는 선택하면 된다. 

GeoServer(2.4.5 버전 기준) 전역 환경설정

 

GeoServer 관리자 페이지의 전역 환경설정에서 로그 정책이 여러개 있는 것을 확인할 수 있는데, 기본 로그 정책은 DEFAULT_LOGGING.properties로 해당 파일을 수정하거나 다른 로그 정책을 선택하여 로그의 양을 줄일 수가 있다. 또는 간단하게 로그를 적게 출력하고 싶다면 PRODUCTION_LOGGING.properties를 선택하면 Error사항이 아니면 로그를 작성하지 않는다.

 

직접 로그 파일을 찾아서 열어 본다면 %GEOSERVER_HOME%\data\logs\DEFAULT_LOGGING.properties 경로에서 파일을 확인할 수 있다. 

## This log4j configuration file needs to stay here, and is used as the default logging setup
## during data_dir upgrades and in case the chosen logging config isn't available.

log4j.rootLogger=WARN, geoserverlogfile, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{dd MMM HH:mm:ss} %p [%c{2}] - %m%n


log4j.appender.geoserverlogfile=org.apache.log4j.RollingFileAppender
# Keep three backup files.
log4j.appender.geoserverlogfile.MaxBackupIndex=3
# Pattern to output: date priority [category] - message
log4j.appender.geoserverlogfile.layout=org.apache.log4j.PatternLayout
log4j.appender.geoserverlogfile.layout.ConversionPattern=%d %p [%c{2}] - %m%n

log4j.category.log4j=FATAL

log4j.category.org.geotools=WARN
log4j.category.org.geotools.factory=WARN
log4j.category.org.geoserver=INFO
log4j.category.org.vfny.geoserver=INFO

log4j.category.org.springframework=WARN

log4j.category.org.geowebcache=INFO
log4j.category.org.geowebcache.seed.TruncateTask=WARN

 

Logging Level을 보면 4번째 라인에 log4j.rootLogger=WARN 로 설정되어 있고 geoserver의 일반적인 상태(로딩, 퍼브리싱 등)와 관련된 로그는 22번째 라인에 있는 log4j.category.org.geoserver=INFO로 되어 있다.

먼저 log4j의 로거 레벨은 여섯단계로 나누어져 있는데 TRACE < DEBUG < INFO < WARN < ERROR < FATAL 순이다.
레벨의 중요도가 낮을 수록 상위 레벨의 로그까지 포함하게 된다.
예를 들어 log4j.rootLogger=WARN의 경우 소스코드에서 WARN, ERROR, FATAL로 설정된 것들만 로그로 남기게 되어 있다.

결론으로 돌아와 log4j.category.org.geoserver=WARN 또는 그 상위 레벨로 변경하면 오류 상황이 아니면 로그가 발생되지 않는다.



AND




Geotools(Version 2.7.4)를 이용하여 PostgreSQL(Version 9.3) 테이블을 추가하려고 하는데 schema를 생성할 때 다음과 같은 오류가 발생하였다.


java.io.IOException: Error occurred creating table
at org.geotools.jdbc.JDBCDataStore.createSchema(JDBCDataStore.java:660)
at org.geotools.jdbc.JDBCDataStore.createSchema(JDBCDataStore.java:138)
... 25 more
Caused by: org.postgresql.util.PSQLException: ERROR: function srid(geometry) does not exist
  Hint: No function matches the given name and argument types. You might need to add explicit type casts.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1890)
... 34 more

오류내용을 확인해 보니 srid function을 찾을 수 없다라고 나오는데, 기존 8.x버전에서 버전이 상향되면서 postgis 함수가 이름을 변경했는데 geotools 2.7.4버전 gt-jdbc-postgis가 postgresql-8.4-701.jdbc3를 참조하고 있었다.

사용하고 있는 DB 버전이 9.x 버전이기 때문에 기존의 함수를 추가해주기 위해서 C:\Program Files\PostgreSQL\9.3\share\contrib\postgis-2.1\legacy.sql 또는 legacy_minimal.sql에서 함수생성 쿼리를 찾을 수 있는데 아래 해당하는 데이터베이스에서 수행하면 된다.
(정확히 말하자면 PostgreSQL이 아니라 PostGIS에 있는 Spatial Function 이다.)



그런데 다음과 같은 오류가 또 발생하였다.


java.io.IOException: Error occurred creating table

at org.geotools.jdbc.JDBCDataStore.createSchema(JDBCDataStore.java:660)

at org.geotools.jdbc.JDBCDataStore.createSchema(JDBCDataStore.java:138)

... 25 more

Caused by: org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled.

at org.postgresql.jdbc2.AbstractJdbc2Connection.commit(AbstractJdbc2Connection.java:828)

at org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:334)

... 31 more


이것도 마찬가지로 jdbc 드라이버 문제인데 postgresql-8.4-701.jdbc3로 맞춰주면 해결된다.



AND