Skip to content

Update branch - #149

Open
hwgilbert16 wants to merge 67 commits into
feature/refactor-api-errorsfrom
develop
Open

Update branch#149
hwgilbert16 wants to merge 67 commits into
feature/refactor-api-errorsfrom
develop

Conversation

@hwgilbert16

Copy link
Copy Markdown
Owner

No description provided.

hwgilbert16 and others added 30 commits July 21, 2023 23:01
Resolve issue with handbook route returning 404
Hotfix: Fix issue with malformed HTTP responses
Bumps [sanitize-html](https://github.com/apostrophecms/sanitize-html) from 2.11.0 to 2.12.1.
- [Changelog](https://github.com/apostrophecms/sanitize-html/blob/main/CHANGELOG.md)
- [Commits](apostrophecms/sanitize-html@2.11.0...2.12.1)

---
updated-dependencies:
- dependency-name: sanitize-html
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
…tlint

feat(commitlint): add husky commit-msg with commitlint configuration
Bumps [ip](https://github.com/indutny/node-ip) from 1.1.8 to 1.1.9.
- [Commits](indutny/node-ip@v1.1.8...v1.1.9)

---
updated-dependencies:
- dependency-name: ip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…tize-html-2.12.1

Bump sanitize-html from 2.11.0 to 2.12.1
hwgilbert16 and others added 27 commits March 13, 2024 20:47
Prevent HTTP 500 for missing files

---------

Co-authored-by: Yet Another Stupid Coder <117515380+WhyNeet@users.noreply.github.com>
feat(api): add daily sitemap generation, fix Googlebot unable to access api
Bumps [katex](https://github.com/KaTeX/KaTeX) from 0.16.9 to 0.16.10.
- [Release notes](https://github.com/KaTeX/KaTeX/releases)
- [Changelog](https://github.com/KaTeX/KaTeX/blob/main/CHANGELOG.md)
- [Commits](KaTeX/KaTeX@v0.16.9...v0.16.10)

---
updated-dependencies:
- dependency-name: katex
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* feat(front + api): add public node_env option and disable features in mode

* feat(docs): update docs to reflect new public node_env option
Comment thread apps/api/src/main.ts
Comment on lines +63 to +65
app.use(helmet({
contentSecurityPolicy: false
}));

Check failure

Code scanning / CodeQL

Insecure configuration of Helmet security middleware High

Helmet security middleware, configured with security setting
contentSecurityPolicy
set to 'false', which disables enforcing that feature.

Copilot Autofix

AI almost 2 years ago

To fix the problem, we need to ensure that the contentSecurityPolicy is not disabled. Instead of setting it to false, we should provide a secure default configuration. If specific directives are required, they should be explicitly defined. Additionally, we should ensure that frameguard is not disabled to protect against clickjacking attacks.

  1. Update the Helmet configuration to enable contentSecurityPolicy with a secure default or custom directives.
  2. Ensure that frameguard is enabled with appropriate settings.
Suggested changeset 1
apps/api/src/main.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts
--- a/apps/api/src/main.ts
+++ b/apps/api/src/main.ts
@@ -63,3 +63,12 @@
     app.use(helmet({
-      contentSecurityPolicy: false
+      contentSecurityPolicy: {
+        directives: {
+          "default-src": ["'self'"],
+          "script-src": ["'self'", "'unsafe-inline'"],
+          "style-src": ["'self'", "'unsafe-inline'"],
+          "img-src": ["'self'", "data:"],
+          "connect-src": ["'self'"]
+        }
+      },
+      frameguard: { action: 'deny' }
     }));
EOF
@@ -63,3 +63,12 @@
app.use(helmet({
contentSecurityPolicy: false
contentSecurityPolicy: {
directives: {
"default-src": ["'self'"],
"script-src": ["'self'", "'unsafe-inline'"],
"style-src": ["'self'", "'unsafe-inline'"],
"img-src": ["'self'", "data:"],
"connect-src": ["'self'"]
}
},
frameguard: { action: 'deny' }
}));
Copilot is powered by AI and may make mistakes. Always verify output.
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants