Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set HttpOnly argument for cookies to true #230

Merged
merged 1 commit into from
Dec 16, 2024
Merged
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
1 change: 1 addition & 0 deletions app/src/main/webapp/META-INF/context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<!-- In production environments set deployXML="false" in the relevant <Host> section in server.xml, and add gxa.xml
to e.g. $CATALINA_BASE/conf/Catalina/localhost to configure the location of properties files -->
<Context>
<CookieProcessor useHttpOnly="true"/>
<Resources className="org.apache.catalina.webresources.StandardRoot">
<PreResources className="org.apache.catalina.webresources.DirResourceSet"
base="/webapp-properties"
Expand Down
22 changes: 21 additions & 1 deletion app/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<listener>
<listener-class>uk.ac.ebi.atlas.configuration.HttpOnlyCookieConfigurator</listener-class>
</listener>

<filter>
<filter-name>UrlRewriteFilter</filter-name>
Expand Down Expand Up @@ -95,6 +99,20 @@
<url-pattern>/sc/json/*</url-pattern>
</filter-mapping>

<filter>
<filter-name>httpHeaderSecurity</filter-name>
<filter-class>org.apache.catalina.filters.HttpHeaderSecurityFilter</filter-class>
<async-supported>true</async-supported>
<init-param>
<param-name>hstsEnabled</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>httpHeaderSecurity</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<security-role>
<role-name>admin</role-name>
</security-role>
Expand Down Expand Up @@ -123,8 +141,10 @@
<auth-constraint />
</security-constraint>

<!-- Disable JSessionID -->
<session-config>
<cookie-config>
<http-only>true</http-only>
</cookie-config>
<tracking-mode>COOKIE</tracking-mode>
</session-config>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = 'uk.ac.ebi.ge'
version = '36.6.1'
version = '36.7.0'

sourceCompatibility = 11
targetCompatibility = 11
Expand Down
Loading