<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question The request was rejected because the URL contained a potentially malicious String in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/The-request-was-rejected-because-the-URL-contained-a/m-p/93027#M1912</link>
    <description>&lt;P&gt;When using the Python SDK to create an InstanceTemplate if the bootstrap_scripts contain any special characters the API will reject it :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;cloudera.director.common.rest.ApiException: (500)
Reason: Server Error
HTTP response headers: HTTPHeaderDict({'Connection': 'close', 'Content-Type': 'application/json;charset=utf-8'})
HTTP response body: {
  "timestamp" : 1563826656470,
  "status" : 500,
  "error" : "Internal Server Error",
  "message" : "org.springframework.security.web.firewall.RequestRejectedException: The request was rejected because the URL contained a potentially malicious String \"%5C\"",&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An example bootstrap script that fails is if you put:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;wget https://www.google.com&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Spring Security will reject this as a malicious URL since it is being encoded in the URL and not being put in the body it appears.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, if you define the InstanceTemplate and don't create it in Director via the InstanceTemplatesAPI but rather just immediately pass it to the VirtualInstance in a ClusterTemplate or DeploymentTemplate then there is no issue. Of course it will not appear in the templates tab in Director of that environment in this situation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any way to turn off (or limit) the Spring firewall in application.properties or should I try to modify the python sdk to send the data in the body?&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 15:52:51 GMT</pubDate>
    <dc:creator>Da</dc:creator>
    <dc:date>2022-09-16T15:52:51Z</dc:date>
    <item>
      <title>The request was rejected because the URL contained a potentially malicious String</title>
      <link>https://community.cloudera.com/t5/Support-Questions/The-request-was-rejected-because-the-URL-contained-a/m-p/93027#M1912</link>
      <description>&lt;P&gt;When using the Python SDK to create an InstanceTemplate if the bootstrap_scripts contain any special characters the API will reject it :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;cloudera.director.common.rest.ApiException: (500)
Reason: Server Error
HTTP response headers: HTTPHeaderDict({'Connection': 'close', 'Content-Type': 'application/json;charset=utf-8'})
HTTP response body: {
  "timestamp" : 1563826656470,
  "status" : 500,
  "error" : "Internal Server Error",
  "message" : "org.springframework.security.web.firewall.RequestRejectedException: The request was rejected because the URL contained a potentially malicious String \"%5C\"",&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An example bootstrap script that fails is if you put:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;wget https://www.google.com&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Spring Security will reject this as a malicious URL since it is being encoded in the URL and not being put in the body it appears.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, if you define the InstanceTemplate and don't create it in Director via the InstanceTemplatesAPI but rather just immediately pass it to the VirtualInstance in a ClusterTemplate or DeploymentTemplate then there is no issue. Of course it will not appear in the templates tab in Director of that environment in this situation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any way to turn off (or limit) the Spring firewall in application.properties or should I try to modify the python sdk to send the data in the body?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 15:52:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/The-request-was-rejected-because-the-URL-contained-a/m-p/93027#M1912</guid>
      <dc:creator>Da</dc:creator>
      <dc:date>2022-09-16T15:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: The request was rejected because the URL contained a potentially malicious String</title>
      <link>https://community.cloudera.com/t5/Support-Questions/The-request-was-rejected-because-the-URL-contained-a/m-p/93032#M1913</link>
      <description>&lt;P&gt;As it turns out this was my screwup -- I tried to get the template (to verify it's existence) with the InstanceTemplate object instead of the string name before creating it with my defined InstanceTemplate object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies for any inconvenience!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 21:44:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/The-request-was-rejected-because-the-URL-contained-a/m-p/93032#M1913</guid>
      <dc:creator>Da</dc:creator>
      <dc:date>2019-07-22T21:44:09Z</dc:date>
    </item>
  </channel>
</rss>

