Skip to content

Commit

Permalink
ADM-819 mask sensitive data in log message (#1086)
Browse files Browse the repository at this point in the history
* ADM-819: [backend]feat: modify log4j2 config to mask sensitive token in log message

* ADM-819: [backend]feat: add off heap storage to jiraCard cache
  • Loading branch information
sqsq5566 authored Feb 28, 2024
1 parent af7a7ea commit 4576627
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion backend/src/main/java/heartbeat/config/CacheConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ public CacheManager ehCacheManager() {

@SuppressWarnings("unchecked")
private <K, V> javax.cache.configuration.Configuration<K, V> getCacheConfiguration(Class<V> valueType) {
ResourcePoolsBuilder offHeap = ResourcePoolsBuilder.newResourcePoolsBuilder().offheap(2, MemoryUnit.MB);
ResourcePoolsBuilder offHeap;
if (valueType == String.class) {
offHeap = ResourcePoolsBuilder.newResourcePoolsBuilder().offheap(4, MemoryUnit.MB);
}
else {
offHeap = ResourcePoolsBuilder.newResourcePoolsBuilder().offheap(2, MemoryUnit.MB);
}
Duration timeToLive;
if (valueType == HolidaysResponseDTO.class) {
timeToLive = Duration.ofSeconds(300);
Expand Down
2 changes: 1 addition & 1 deletion backend/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Configuration status="INFO" name="Heartbeat">
<Properties>
<Property name="LOG_PATTERN">
%d{yyyy-MM-dd HH:mm:ss.SSS} [%highlight{%-5level}{FATAL=bg_red, ERROR=red, WARN=yellow, INFO=green}] [%t] %M(%c{1}:%L): %m%n%ex
%d{yyyy-MM-dd HH:mm:ss.SSS} [%highlight{%-5level}{FATAL=bg_red, ERROR=red, WARN=yellow, INFO=green}] [%t] %M(%c{1}:%L): %replace{%msg}{(((ghp_)|(bkua_))[a-zA-Z0-9]+)|((Basic )([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==))}{xxxxx}%n%ex
</Property>
</Properties>
<Appenders>
Expand Down

0 comments on commit 4576627

Please sign in to comment.