<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>yes</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.4 ? maybe also before</td>
</tr>
</tbody>
</table>
<p dir="auto">In the sulu recipe, we will add another file which adds the firewall to the existing configuration. This is not really possible without manually adding the <code class="notranslate">admin</code> key inside the <code class="notranslate">security.yaml</code> file!</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/stof/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/stof">@stof</a> hopefully you will add your thought which we have at the #SymfonyConHackday2017</p>
<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>no</td>
</tr>
<tr>
<td>Feature request?</td>
<td>yes</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>-</td>
</tr>
</tbody>
</table>
<p dir="auto">One of the most frustrating limitations of the Security component config is that you can't define the firewalls in different files:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="InvalidConfigurationException in PrototypedArrayNode.php line 325:

You are not allowed to define new elements for path &quot;security.firewalls&quot;. Please
define all elements for this path in one config file."><pre class="notranslate"><code class="notranslate">InvalidConfigurationException in PrototypedArrayNode.php line 325:

You are not allowed to define new elements for path "security.firewalls". Please
define all elements for this path in one config file.
</code></pre></div>
<p dir="auto">But this could be so useful! Like in this example:</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# app/config/dev/security.yml
security:
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false

# app/config/security.yml
security:
    # ...
    firewalls:
        main:
            # ..."><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> app/config/dev/security.yml</span>
<span class="pl-ent">security</span>:
    <span class="pl-ent">firewalls</span>:
        <span class="pl-ent">dev</span>:
            <span class="pl-ent">pattern</span>: <span class="pl-s">^/(_(profiler|wdt)|css|images|js)/</span>
            <span class="pl-ent">security</span>: <span class="pl-c1">false</span>

<span class="pl-c"><span class="pl-c">#</span> app/config/security.yml</span>
<span class="pl-ent">security</span>:
    <span class="pl-c"><span class="pl-c">#</span> ...</span>
    <span class="pl-ent">firewalls</span>:
        <span class="pl-ent">main</span>:
            <span class="pl-c"><span class="pl-c">#</span> ...</span></pre></div>
<p dir="auto">So, my question for those experts in the internals of the Security component: would be really hard to remove this limitation? Maybe it's a matter of changing a few lines of code but nobody really tried to do that. Thanks!</p>