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

chore: add ngnix security headers #964

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

Agastya18
Copy link
Collaborator

@Agastya18 Agastya18 commented Dec 5, 2024

Description

This pull request for issue #939 updates the Nginx configuration to enhance security and allow communication with specific origins. The changes include:
Security Headers: Added headers to prevent MIME type sniffing, clickjacking, and XSS attacks.
Content Security Policy (CSP): Configured to restrict resources to specific trusted domains, including Google Analytics, Google Fonts, and hasadna.org.il.
CORS Configuration: Updated to allow cross-origin requests from specified domains.

screenshots

Screenshot 2024-12-05 at 7 40 38 PM

@Agastya18 Agastya18 requested a review from NoamGaash as a code owner December 5, 2024 14:11
@NoamGaash NoamGaash changed the title add ngnix security chore: add ngnix security headers Dec 5, 2024
Comment on lines 16 to 19
# CORS settings
add_header Access-Control-Allow-Origin "self https://www.google-analytics.com https://www.googletagmanager.com https://fonts.gstatic.com https://fonts.googleapis.com *.hasadna.org.il";
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
But regarding CORS settings - is it needed? I was under the impression that CORS is blocked by default for all origins, and that google analytics and google fonts doesn't need to be included here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, will remove # CORS settings section

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.

2 participants