Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Comptoir du Libre v3 - Upcoming version
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Comptoir
Comptoir du Libre v3 - Upcoming version
Commits
68fc1610
Commit
68fc1610
authored
8 months ago
by
Fabrice Gangler
Browse files
Options
Downloads
Patches
Plain Diff
chore: improve configuration [ config/packages/security.yaml ]
parent
f1164a2a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
webapp/config/packages/security.yaml
+73
-10
73 additions, 10 deletions
webapp/config/packages/security.yaml
with
73 additions
and
10 deletions
webapp/config/packages/security.yaml
+
73
−
10
View file @
68fc1610
security
:
#############################################################################
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
password_hashers
:
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface
:
'
auto'
#############################################################################
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
providers
:
users_in_memory
:
{
memory
:
null
}
# used to reload user from session & other features (e.g. switch_user)
app_user_provider
:
entity
:
class
:
App\Entity\User
property
:
email
#############################################################################
# https://symfony.com/doc/current/reference/configuration/security.html#session-fixation-strategy
session_fixation_strategy
:
invalidate
# When authenticating users, the entire session is regenerated,
# so the session ID is updated and all the other session attributes are lost.
#############################################################################
#############################################################################
role_hierarchy
:
ROLE_CONTRIBUTOR
:
-
ROLE_USER
ROLE_ORGANISATION_ADMIN
:
-
ROLE_CONTRIBUTOR
ROLE_MODERATOR
:
-
ROLE_CONTRIBUTOR
ROLE_ADMIN
:
-
ROLE_MODERATOR
ROLE_SUPERADMIN
:
-
ROLE_ADMIN
-
ROLE_ALLOWED_TO_SWITCH
#############################################################################
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
# https://symfony.com/doc/current/security/access_control.html
access_control
:
# - { route: 'superadmin_configuration', roles: ROLE_SUPERADMIN }
-
{
path
:
^/admin/configuration/
,
roles
:
ROLE_SUPERADMIN
}
-
{
path
:
^/admin/
,
roles
:
ROLE_ADMIN
}
-
{
path
:
^/user/profile
,
roles
:
ROLE_USER
}
-
{
path
:
^/
,
roles
:
PUBLIC_ACCESS
}
-
{
path
:
^/health-check
,
roles
:
PUBLIC_ACCESS
}
-
{
path
:
^/account/login
,
roles
:
PUBLIC_ACCESS
}
-
{
path
:
^/account/logout
,
roles
:
PUBLIC_ACCESS
}
#############################################################################
firewalls
:
dev
:
pattern
:
^/(_(profiler|wdt)|css|images|js)/
security
:
false
main
:
lazy
:
true
provider
:
users_in_memory
provider
:
app_user_provider
logout
:
path
:
'
app_account_logout'
target
:
'
app_home'
# Send [ Clear-Site-Data ] HTTP Header to clears browsing data
# https://symfony.com/doc/current/reference/configuration/security.html#clear-site-data
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Clear-Site-Data
clear_site_data
:
-
cookies
-
storage
# - executionContexts
# - cache
form_login
:
enable_csrf
:
true
form_only
:
true
# checks that the request content-type is application/x-www-form-urlencoded
always_use_default_target_path
:
false
login_path
:
'
app_account_login'
check_path
:
'
app_account_login'
# rate_limiter:
# login_throttling:
# switch_user: true # https://symfony.com/doc/current/security/impersonating_user.html
########### login_throttling ###################################################
# configure the maximum login attempts
# by default, the feature allows 5 login attempts per minute
# login_throttling: null
# login_throttling:
# max_attempts: 5 # by default, the feature allows 5 login attempts per interval
# interval: '15 minutes' # by default = 1 minute
################################################################################
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#the-firewall
# https://symfony.com/doc/current/security/impersonating_user.html
# switch_user: true
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control
:
# - { path: ^/admin, roles: ROLE_ADMIN }
# - { path: ^/profile, roles: ROLE_USER }
when@test
:
security
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment