We're trying to add a Content Security Policy to a legacy application, and to not have it be too permissive.
The application uses asp.net, and, among other problems, we have a problem with event handlers that are created automatically by the framework. As these are inline and not separate script tags, we cannot allow them through a nonce or hash.
For example, we have a form with a defaultbutton, which creates the following code:
<form name="login" method="post" action="./login.aspx?logout=true" onsubmit="javascript:return WebForm_OnSubmit();" onkeypress="javascript:return WebForm_FireDefaultButton(event, 'submit')" id="login" autocomplete="off">
Is there a way to make asp.net create code that would comply to a restrictive CSP policy?