Skip to content

Conversation

@jackton1
Copy link
Member

No description provided.

Copy link
Contributor

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

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

Some food for thought

LANGUAGE_CODE = "en"

# Tell Django where the project's translation files should be.
LOCALE_PATHS=(
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider setting SECURE_HSTS_SECONDS if the website is to be accessed exclusively via HTTPS. This reduces the chance of a Man In The Middle attack because modern browsers will block HTTP requests to your website. Start with a small number and increase once you're confident HTTPS works on your website.

Consider setting SECURE_HSTS_INCLUDE_SUBDOMAINS if all subbdomains of the website are to be accessed exclusively via HTTPS. This extends the HSTS protection to subdomains too, further reducing the chance of a Man In The Middle attack because modern browsers will block HTTP requests to your website.

Consider setting SECURE_HSTS_PRELOAD to facilitate adding your website to the browser preload list.

Consider setting SECURE_CONTENT_TYPE_NOSNIFF to prevent the security hole that if the MIME type is missing from a response's content-type header then the browser will infer the MIME type based on the content and so execute any nefarious javascript/html that a bad actor managed to upload to your website.

Consider setting SECURE_SSL_REDIRECT to prevent users from accessing the website over HTTP. HTTP connections allow bad actors to intercept passwords and session cookies, and to easily change the contents of the request or response.

Consider setting SESSION_COOKIE_SECURE to prevent cookies from being sent over non HTTPS connections. Cookies sent over insecure HTTP connections can be intercepted by hackers.

Consider setting CSRF_COOKIE_SECURE to prevent the CSRF cookies from being vulnerable to packet sniff attack.

# Tell Django where the project's translation files should be.
LOCALE_PATHS=(
os.path.join(BASE_DIR, "model_clone", "locale"),
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
)
)
SECURE_HSTS_SECONDS = 3600
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_SSL_REDIRECT = os.getenv("SECURE_SSL_REDIRECT_ENABLED") != "False"
SESSION_COOKIE_SECURE = os.getenv("SESSION_COOKIE_SECURE_ENABLED") != "False"
CSRF_COOKIE_SECURE = os.getenv("CSRF_COOKIE_SECURE_ENABLED") != "False"
SECURE_HSTS_PRELOAD = True

Copy link
Contributor

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

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

Some things to consider

@codecov
Copy link

codecov bot commented Jun 19, 2021

Codecov Report

Merging #369 (1ed2cab) into main (23b8b9a) will decrease coverage by 0.02%.
The diff coverage is n/a.

❗ Current head 1ed2cab differs from pull request most recent head 3b141f2. Consider uploading reports for the commit 3b141f2 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #369      +/-   ##
==========================================
- Coverage   96.32%   96.29%   -0.03%     
==========================================
  Files           6        6              
  Lines         272      270       -2     
==========================================
- Hits          262      260       -2     
  Misses         10       10              
Impacted Files Coverage Δ
model_clone/utils.py 96.84% <0.00%> (-0.04%) ⬇️
model_clone/mixins/clone.py 95.59% <0.00%> (-0.03%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 23b8b9a...3b141f2. Read the comment docs.

Co-authored-by: django-doctor[bot] <72320148+django-doctor[bot]@users.noreply.github.com>
@jackton1 jackton1 merged commit 6fc435a into main Jun 19, 2021
@jackton1 jackton1 deleted the feature/add-translation-support branch June 19, 2021 12:29
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