Skip to content

Commit

Permalink
[api] Fix helmet upgrade secure
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Hassine committed Feb 7, 2022
1 parent c6ca9fa commit 67ab916
Show file tree
Hide file tree
Showing 4 changed files with 463 additions and 432 deletions.
7 changes: 6 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -616,4 +616,9 @@ workflows:
- notify:
requires:
- docker_build_platform
- docker_build_worker
- docker_build_worker
filters:
tags:
only: /[0-9]+(\.[0-9]+)+(\.[0-9]+)*/
branches:
ignore: /.*/
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ const hashMergeValidation = (instances) => {
Object.entries(groupElements).forEach(([algo, values]) => {
const hashes = R.uniq(values.map(([, data]) => data));
if (hashes.length > 1) {
const field = `hash_${algo.toUpperCase()}`;
const field = `hashes_${algo.toUpperCase()}`;
const message = { message: `Hashes collision for ${algo} algorithm` };
throw ValidationError(field, message);
}
Expand Down
9 changes: 9 additions & 0 deletions opencti-platform/opencti-graphql/src/http/httpPlatform.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ const createApp = async (apolloServer) => {
expectCt: { enforce: true, maxAge: 30 },
referrerPolicy: { policy: 'unsafe-url' },
crossOriginEmbedderPolicy: false,
crossOriginOpenerPolicy: false,
crossOriginResourcePolicy: false,
contentSecurityPolicy: {
useDefaults: false,
directives: {
defaultSrc: ["'self'"],
scriptSrc,
Expand All @@ -69,6 +72,12 @@ const createApp = async (apolloServer) => {
'http://cdn.jsdelivr.net/npm/@apollographql/',
'https://fonts.googleapis.com/',
],
scriptSrcAttr: [
"'self'",
"'unsafe-inline'",
'http://cdn.jsdelivr.net/npm/@apollographql/',
'https://fonts.googleapis.com/',
],
fontSrc: ["'self'", 'https://fonts.gstatic.com/'],
imgSrc: ["'self'", 'data:', 'https://*', 'http://*'],
connectSrc: ["'self'", 'wss://*', 'ws://*', 'data:', 'http://*', 'https://*'],
Expand Down
Loading

0 comments on commit 67ab916

Please sign in to comment.