This procedure was added in MySQL 8.0.23. 

• sp_set_firewall_group_mode( group , mode ) 

no longer true after calling sp_reload_firewall_group_rules()  and you must set it to PROTECTING  again explicitly. 

This stored procedure establishes the operational mode for a firewall group profile, after registering the profile with the firewall if it was not already registered. The procedure also invokes firewall administrative functions as necessary to transfer firewall data between the cache and persistent storage. This procedure may be called even if the mysql_firewall_mode  system variable is OFF , although setting the mode for a profile has no operational effect until the firewall is enabled. 

If the profile previously existed, any recording limitation for it remains unchanged. To set or clear the limitation, call sp_set_firewall_group_mode_and_user()  instead. 

Arguments: 

• group : The name of the affected group profile. 

• mode : The operational mode for the profile, as a string. Permitted mode values are OFF , DETECTING , PROTECTING , and RECORDING . For details about their meanings, see Firewall Concepts. 

Example: 

CALL sp_set_firewall_group_mode(’myapp’, ’PROTECTING’); 

This procedure was added in MySQL 8.0.23. 

• sp_set_firewall_group_mode_and_user( group , mode , user ) 

This stored procedure registers a group with the firewall and establishes its operational mode, similar to sp_set_firewall_group_mode() , but also specifies the training account to be used when the group is in RECORDING  mode. 

Arguments: 

• group : The name of the affected group profile. 

• mode : The operational mode for the profile, as a string. Permitted mode values are OFF , DETECTING , PROTECTING , and RECORDING . For details about their meanings, see Firewall Concepts. 

• user : The training account for the group profile, to be used when the profile is in RECORDING  mode. The value is NULL , or a non- NULL  account that has the format user_name @ host_name : 

•If the value is NULL , the firewall records allowlist rules for statements received from any account that is a member of the group. 

•If the value is non- NULL , the firewall records allowlist rules only for statements received from the named account (which should be a member of the group). 

Example: 

CALL sp_set_firewall_group_mode_and_user(’myapp’, ’RECORDING’, ’myapp_user1@localhost’); 

This procedure was added in MySQL 8.0.23. 

