Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion amp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ RUN --mount=type=cache,target=/root/.m2 \
&& rm -rf target; \
fi

FROM tomcat:8.5.79-jdk8
FROM tomcat:8.5.94-jdk8-temurin-focal

RUN apt-get update \
&& apt-get install -y apt-transport-https ca-certificates curl gnupg --no-install-recommends \
Expand Down
8 changes: 3 additions & 5 deletions amp/context.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?xml version="1.0"?>

<Context path="/" debug="0" reloadable="false" unloadDelay="4000" swallowOutput="true"
<Context path="/" debug="0" reloadable="false" unloadDelay="4000" swallowOutput="true" useHttpOnly="true"
allowLinking="true" antiJARLocking="" antiResourceLocking="" clearReferencesStopTimerThreads="true"
clearReferencesThreadLocals="true" jndiExceptionOnFailedWrite="false" processTlds="false">
<Environment name="hostname" value="" type="java.lang.String"/>

<!-- SameSite=Lax: browser will not send the session cookie on cross-site
POST/PUT/DELETE requests, providing CSRF protection for all endpoints
including /rest/** without requiring any token in requests. -->
<CookieProcessor sameSiteCookies="lax" />
<!-- Strict prevents session cookies from being sent in cross-site requests. -->
<CookieProcessor sameSiteCookies="strict" />
Comment on lines +8 to +9
<!-- PostgreSQL connection -->
<Resource factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
defaultTransactionIsolation="READ_COMMITTED"
Expand Down
4 changes: 2 additions & 2 deletions amp/docker/server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

<Connector port="8080" URIEncoding="UTF-8" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
redirectPort="8443" server="AMP"
relaxedQueryChars="|{}" />

<Engine name="Catalina" defaultHost="localhost">
Expand All @@ -63,7 +63,7 @@
<!-- Internal proxies regex matches the following ips: 10/8, 192.168/16, 169.254/16, 127/8 and 172.16/12 -->
<Valve className="org.apache.catalina.valves.RemoteIpValve"
internalProxies="172\.(?:16|17|18|19|2\d|30|31)\.\d{1,3}\.\d{1,3}|10\.\d{1,3}\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3}|169\.254\.\d{1,3}\.\d{1,3}|127\.\d{1,3}\.\d{1,3}\.\d{1,3}"
protocolHeader="x-forwarded-proto" />
protocolHeader="x-forwarded-proto" portHeader="x-forwarded-port" />

</Host>
</Engine>
Expand Down
2 changes: 2 additions & 0 deletions amp/src/main/java/org/digijava/kernel/util/DgUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ private static void setLanguageCookie(Locale language, HttpServletRequest reques
cookiePath = "/";
}
cookie.setPath(cookiePath);
cookie.setHttpOnly(true);
cookie.setSecure(request.isSecure());
Comment on lines +268 to +269
response.addCookie(cookie);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
</lang>
</script>
</apply>
</tns:patch
</tns:patch>
Loading