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

Add remarks on avoiding inline JS #34431

Merged
merged 6 commits into from
Jan 7, 2025
Merged

Add remarks on avoiding inline JS #34431

merged 6 commits into from
Jan 7, 2025

Conversation

guardrex
Copy link
Collaborator

@guardrex guardrex commented Jan 2, 2025

Fixes #34425

Thanks @jbaumflek! 🚀 ... I'll start with this, and I'll ask Steve to review it next week. Let's give him a second to get back into the swing of things now that we're all coming back from the holidays.

BTW ... Ignore my code-fencing activities on the DIFF. I noticed in passing that I didn't have the policy directive cross-link API code-fenced, and I decided to do that here to avoid having to create a new PR. Scroll down to the new Use of inline JavaScript with a CSP section.

I'll keep an 👂 open if you create a product unit issue to discuss this subject with engineering.


Internal previews

📄 File 🔗 Preview link
aspnetcore/blazor/javascript-interoperability/location-of-javascript.md aspnetcore/blazor/javascript-interoperability/location-of-javascript
aspnetcore/blazor/security/content-security-policy.md aspnetcore/blazor/security/content-security-policy
aspnetcore/security/authentication/customize-identity-model.md aspnetcore/security/authentication/customize-identity-model

@guardrex guardrex self-assigned this Jan 2, 2025
@guardrex
Copy link
Collaborator Author

guardrex commented Jan 2, 2025

cc: @tdykstra ...

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/security/authentication/customize-identity-model.md

The build report says ...

Invalid value for 'ms.author', 'avickers' is not a valid Microsoft alias.

@tdykstra
Copy link
Contributor

tdykstra commented Jan 3, 2025

cc: @tdykstra ...

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/security/authentication/customize-identity-model.md

The build report says ...

Invalid value for 'ms.author', 'avickers' is not a valid Microsoft alias.

Change ms.author to riande.

@guardrex guardrex changed the title Add section on inline JS with CSPs Add remarks on avoiding inline JS Jan 7, 2025
@guardrex
Copy link
Collaborator Author

guardrex commented Jan 7, 2025

@jbaumflek ... Ok, so we have our answer from Javier ... don't recommend inline JS at all, and we'll just leave the CSP article as it currently is with its remarks about hashes for custom scripts. Although we didn't end up with inline JS-CSP coverage for this, thanks for your issue because we needed to firm up our recommendation on this subject for the community. Happy New Year! 🎉

@guardrex guardrex merged commit 393dc89 into main Jan 7, 2025
3 checks passed
@guardrex guardrex deleted the guardrex-patch-4 branch January 7, 2025 13:48
@jbaumflek
Copy link

jbaumflek commented Jan 7, 2025 via email

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.

frustration with inline script
3 participants