<p><a href="https://cloud.google.com/kubernetes-engine/docs/how-to/cloud-armor-backendconfig" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/how-to/cloud-armor-backendconfig</a></p>

<p>I have only seen example assigning one securityPolicy but I want to assign multiple ones.</p>

<p>I created the following backend config with 2 policies and applied to my service with <code>beta.cloud.google.com/backend-config: my-backend-config</code></p>

<pre><code>apiVersion: cloud.google.com/v1beta1
kind: BackendConfig
metadata:
  namespace: cloud-armor-how-to
  name: my-backend-config
spec:
  securityPolicy:
    name: "policy-one"
    name: "policy-two"
</code></pre>

<p>When I deploy only "policy-two" is applied. Can I assign two policies somehow? I see no docs for this </p>

<p>There's nothing in the docs that says that you can specify more than one policy. Even the spec says <em>securityPolicy</em> the singular and the YAML structure is not an array. </p>

<p>Furthermore, if you look at your spec:</p>

<pre><code>spec:
  securityPolicy:
    name: "policy-one"
    name: "policy-two"
</code></pre>

<p>The YAML standard completely ignores the first <code>name: "policy-one"</code> which explains why only <code>name: "policy-two"</code> is used.  You can check it on <a href="http://www.yamllint.com/" rel="nofollow noreferrer">YAMLlint</a>. To have one more value on your YAML you would have to convert <code>securityPolicy</code> to an array. Something like this:</p>

<pre><code>apiVersion: cloud.google.com/v1beta1
kind: BackendConfig
metadata:
  namespace: cloud-armor-how-to
  name: my-backend-config
spec:
  securityPolicy:
  - name: "policy-one"
  - name: "policy-two"
</code></pre>

<p>The issue with this is that it's probably not supported by GCP.</p>
