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

Docs: Add full web.config example #1224

Closed
wants to merge 1 commit into from
Closed

Docs: Add full web.config example #1224

wants to merge 1 commit into from

Conversation

molant
Copy link
Member

@molant molant commented Aug 8, 2018

Pull request checklist

Make sure you:

For non-trivial changes, please make sure you also:

  • Added/Updated related documentation.
  • Added/Updated related tests.

Short description of the change(s)

Ref #1100


There are some assumptions though:

* The site is static. If you are using node with iisnode, asp.net, etc.
Copy link
Contributor

Choose a reason for hiding this comment

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

ASP.NET

you will have to add the required configuration (but most of this
configuration should still be valid).
* All the static assets are in the folder `dist/static`.
* The static resources (CSS, JS, images, etc.) have precompressed `gzip`
Copy link
Contributor

Choose a reason for hiding this comment

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

JavaScript

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean zopfli?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, we just need a gzip file. It could be zopfli or regular gzip as long as it ends up with .gz.

Even though each hint has example on how to configure different server
technologies, they only contain the relevant portions.

The following are full examples of valid configurations that should
Copy link
Contributor

Choose a reason for hiding this comment

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

examples of server configurations

<urlCompression doStaticCompression="true" doDynamicCompression="true" dynamicCompressionBeforeCache="false" />
<staticContent>
<!--
We set the mimeType for all the types we are going to use in the site. IIS
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe drop you/we...

@molant
Copy link
Member Author

molant commented Aug 8, 2018

@alrra addresed your feedback

@aligneddev
Copy link

@molant this looks really good!

I've been struggling with Content Security Policy (CSP). It would nice to have an example and clear instructions on doing that. Html5 BoilerPlate has one, but it's not very clear.

I'd also suggest links to the Sonarwhal's user guide for each issue. They have a good explanation of each.

I'm adding a link from my article and will update it with approaches I learn from your work.

We recently converted to Asp.Net Core, so I'm re-learning how to do this with NWebSec and middle-ware.

Thanks for helping improve security on the web!

@alrra
Copy link
Contributor

alrra commented Aug 9, 2018

I'd also suggest links to the Sonarwhalwebhint's user guide for each issue. They have a good explanation of each.

Yes, I agree, we should do that.

I'm adding a link from my article and will update it with approaches I learn from your work.

@aligneddev Thank you!

@molant
Copy link
Member Author

molant commented Aug 9, 2018

OK, I've added links to the hints from the web.config and to the web.config from the hints.

Copy link

@aligneddev aligneddev left a comment

Choose a reason for hiding this comment

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

What about Content Security Policy? Does that fit in somewhere?

@@ -379,6 +379,8 @@ Note that:
* The above snippet works with IIS 7+.
* You should use the above snippet in the `web.config` of your
application.
* For the the complete set of IIS configurations, not just for this rule,
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove duplicate the.

Maybe change this to:

For the complete set of configurations, not just for this rule, see this IIS server configuration related docs.

@molant
Copy link
Member Author

molant commented Aug 9, 2018

What about Content Security Policy? Does that fit in somewhere?

Once we have the rule for CSP and its documentation we will update the template to cover it too.

@alrra alrra closed this in 4ac86c3 Aug 9, 2018
@alrra alrra deleted the docs/iis.config branch August 9, 2018 20:03
@aligneddev
Copy link

Thanks for doing this work! Troy Hunt has a very good article on CSP: https://www.troyhunt.com/implementing-content-security-policy/

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.

3 participants