Safe mode enabled for 1s 8. Safe mode set

In version 8.3.9.2170, security has been increased - now the system asks for confirmation to launch external processing, extensions, and so on. Apparently after the Trojan:

A mechanism for protection against dangerous actions has been implemented. When a potentially dangerous action is taken, the system issues a warning containing information about the action being performed and the potential danger of this action. Potentially dangerous activities include:

  • Loading an external report, processing or expanding the configuration.
  • Load or update configuration / extension.
  • Access from an external report / processing or extension to the following capabilities:
  • Operating system command execution.
  • User management.

The user has the ability to allow or deny a potentially dangerous action. If an action is allowed, in some cases it may be necessary to re-execute the allowed action.

The message looks like this:

Security warning

Opens "" from the file "C: \\ ....... epf". It is recommended to pay attention to the source from which this file was obtained. If there is no agreement with the source about the development of additional modules, or there are doubts about the contents of the file, then it is not recommended to open it, since this can harm the computer and data. Allow this file to be opened. WELL NO

Decision:

In the configurator, in the properties of the IB user, uncheck the "Protection against dangerous actions" box.

From the documentation:Disabling the mechanism of protection against dangerous actions

In some cases, it is necessary to disable the protection mechanism against dangerous actions. To do this, you can use the following features:

1. Disable the Protection against dangerous actions (Protection against dangerous actions) checkbox in the properties of a specific user. This will disable protection for that user.

2. Use the ProtectionOfDangerousActions parameter of the Connect () external processing (report) managers. In this case, it is possible to load external processing (report) without user requests.

3. Use the ProtectionOnDangerousActions property of the ConfigurationExtension object before calling the Write () method of this object.

4. Use the DisableUnsafeActionProtection parameter of the conf.cfg file. In this case, the mechanism of protection against dangerous actions will be disabled for all infobase users whose connection strings satisfy the specified masks.

Disabling protection against dangerous actions is performed according to the following rules (in the specified order):

1. Protection is considered disabled if the current user has cleared the Protection against dangerous actions checkbox.

2. Protection is considered disabled if the infobase connection string matches one of the templates specified in the DisableUnsafeActionProtection parameter of the conf.cfg file.

3. If an external processing (report) is connected with protection explicitly disabled using the AntiDangerousActions parameter.

4. If protection is explicitly disabled using the AntiDangerousActions extension property.

The fact is that when using the client-server version of 1C operation, external processing / reports are opened in safe mode, in which the use of privileged mode is prohibited. And the privileged mode is used very often in typical configurations: the formation of printed forms, various service checks (registration of exchanges), etc. As a result, even using a regular report on the ACS without a form (by default, the general "Report Form" form is used) and saving the custom report settings (to the corresponding reference), you will receive an error about insufficient access rights to various constants and session parameters used for service purposes after the line SetPrivilegedMode (True);

The "correct" solution would be to connect external processors and reports through the mechanisms of the BSP "Additional reports and processing" with disabling the safe mode or adding permissions (in my opinion, from the BSP version 2.2.2.1). But if, for some reason, it is necessary to use external report / processing files, then you can configure a cluster security profile used as a safe mode security profile for a specific infobase.

I would like to note right away that this option is not preferable, but due to various circumstances it can be used in such a simplified form. For example, I have several bases in different cities, a common local sit down with strictly limited rights, closed USB, etc., somewhere I use Accounting 2.0, and somewhere 3.0, I make almost all reports using ACS without forms, so that they opened in both versions. Serving all these reports for different versions and different databases is a laborious and unpromising business, since the plans include a transition to a single configuration and base ...

Create a profile.
In the cluster console, create a security profile in which we set flags "Can be used as a safe mode security profile" and "under" Full access allowed: " "to privileged mode".

In many cases of using reports and simple processing, this method will be applicable. For more complex situations, it makes no sense to describe the process, because it is described in the documentation (the ability to configure security profiles for specific external files by specifying its hash, etc.).

P.S. I thought that security profiles function only when using licenses for the platform and server of the CORP level, but this functionality is also fulfilled on the 1C: Enterprise 8.3 platform (conditionally, you can call PROF by analogy with the standard configurations Basic / PROF / CORP)

When you start the program Loading documents as a regular user, the error "Safe mode is set. Operation is prohibited"

This complexity arises because not enough rights to start external processing. To set up access rights, go to the database in 1C Enterprise mode on behalf of Administratorand go to section User and rights settings / Access group profiles,click To create a group.

Enter the name of the group and check the boxes available to users of this group of roles -

  • Interactive opening of external reports and processing
  • Using additional reports and processing

Click Burn and close


Return to the Users menu and select from the list the employee who will work with the Download Documents program. Click Permissions. In the list of profiles, mark the profile you created earlier. Click To write.


It is recommended to add Document Upload to the list of external processors so that users can start processing. For this in the menu Administration / Printing forms and processing / Additional reports and processing create a new treatment. Browse to and name the LoadDocuments.epf file. Specify the processing location in the menu from where the user can launch it in the future, for example, select the menu References

By clicking on the Quick access item, you indicate which user has access to processing:


After setting, click Burn and close... To start processing, users will just need to re-enter the database and open it from the access menu (in the example - Reference books) and click Execute.


Open up Menu - All functions ..... and find the Security Profiles in use option in the list.


It is enough to uncheck the "Security profiles are used" option.


After that, the program will start successfully.

External processing is programmatically opened using the ExternalProcessing global context object, which has the type ExternalProcessingManager... For each operating mode of the 1C platform (normal application mode and managed application mode), various object methods are used to work with external processing.

Run external processing in normal application mode

In a typical application, you must use the Create () method of the ExternalProcessing object, which is passed the full name of the external processing file. The method returns an object of type External Processing, this object is the external processing being opened. If you need to open an external processing form, then call the GetForm () method on the resulting object, which will return the main form, and then call the Open () method to open it.


Processing \u003d ExternalProcessing.Create (FullFileName);
Processing.GetForm (). Open ();

In external processors, the main form must always be a regular form, and the managed form must always be an additional one, otherwise the GetForm () method will not work in the normal application mode.

Running external processing in managed application mode

In managed forms mode, a division of the algorithm by execution context appears. On the client, we get binary data by the full name of the external processing file. We transfer the received binary data to the server and put it in temporary storage. Next, you need to call the Connect () method of the ExternalProcessing object, to which the address to the temporary storage is passed. The method returns the name of the connected external processing. We return the name of the external processing to the client, form a string path to the processing form and use the OpenForm () method to open the external processing form.

&On server
Function GetExternalProcessingName (BinaryData)
AddressToTemporaryStorage \u003d PutToTemporalStore (BinaryData);
Return ExternalProcessing.Connect (AddressInTemporaryStorage);
EndFunction

& On Client
FullFileName \u003d ""; // Full name of the external processing file.
FileData \u003d New BinaryData (FullFileName);
ExternalProcessingName \u003d GetExternalProcessingName (FileData);
OpenForm ("ExternalProcessing." + ExternalProcessingName + ".Form");

Safe mode for external treatments

The Create () and Connect () methods of the ExternalProcessing object have an input parameter SafeMode - a sign of connecting external processing in safe mode. If the parameter is not specified, the connection will be made in safe mode.
Safe mode is designed to protect the system from executing "untrusted" program code on the server. Potential danger is external processing or program code entered by the user for use in the Execute () and Calculate () methods.
Safe mode imposes the following restrictions:
  • privileged mode is canceled if it was set;
  • attempts to enter privileged mode are ignored;
  • operations with COM objects are prohibited;
  • loading and connecting external components is prohibited;
  • access to the file system is denied (except for temporary files);
  • internet access is denied.
Processing opened interactively is not performed in safe mode, therefore it is recommended to implement a mechanism for opening external processing in safe mode, as well as to prevent the user from interactively opening external processing at the permission level.
To prohibit the interactive opening of processing, in all roles assigned to the user, it is necessary to remove the "Interactive opening of external processing" right (see Figure 1).
Figure 1. Rights of interactive opening of external processings / reports
The Open External Processors interactively right has no effect on the ExternalProcessing object.

Opening external reports programmatically, similar to external processors, you should only use the External Reports global context object, which has the type ExternalReportManager.

With the release of platform 8.3.9.2033, a new mechanism has appeared "Protection against dangerous actions".

Thanks to this innovation, 1C -ka now began to swear at the opening of processing (and not only):

Security warning

Opens "My external processing" from the file "My_External_Processing.epf"

It is recommended to pay attention to the source from which this file is obtained. If there is no agreement with the source about the development of additional modules, or there are doubts about the contents of the file, then it is not recommended to open it, since this can harm the computer and data.

Allow this file to be opened?

So 1C decided to fight against malicious code!

Where this "malicious code" will come from at the enterprise is still a mystery)

Potentially dangerous actions included:

  • Loading an external report, processing or a configuration extension.
  • Load or update configuration / extension.
  • Access from an external report / processing or extension to the following capabilities:
  • Operating system command execution.
  • User management (recording or deleting information about an infobase user).
  • Calling the Connect () method of the external processors (reports) manager.
  • Calling the ConfigurationExtension.Write () method.
  • Working with COM objects.

How can you turn off this "miracle"?

To do this, you need to run 1C Enterprise in the configurator mode.
Select the "Administration" - "Users" menu.
In the window that opens for our users, you need to open the user settings window and remove the checkbox on the "Basic" tab "Protection against dangerous actions"

There are other ways to turn this off:

The ability to specify a list of infobases has been implemented, when working with which protection against dangerous actions will be disabled.
The DisableUnsafeActionProtection parameter in the conf.cfg file is responsible for this function, which allows you to disable the protection mechanism against dangerous actions for all users of certain infobases whose connection strings match the masks specified in the DisableUnsafeActionProtection parameter.

In this parameter, you can specify several masks separated by the ";" symbol, for example:

DisableUnsafeActionProtection \u003d test _. *; Stage _. *;

In addition, protection against dangerous user actions can be disabled programmatically, for which there are the following parameters and properties:

  • Parameter Protection from Hazardous Actions of methods Connect () managers of external processing (reports)
  • The HazardousActionProtection property of theConfigurationExtension object before calling the Write () method of this object.

Checking the need to use protection against dangerous actions is performed in the following order:

1. If the "Protection against dangerous actions" checkbox is cleared for the current user, then protection is considered disabled.

2. If the infobase connection string matches one of the templates specified in the DisableUnsafeActionProtection parameter of the conf.cfg file, then protection is considered disabled.

3. If protection is explicitly disabled using the AntiDangerousActions parameter of an external processing or report.

4. If protection is explicitly disabled using the AntiDangerousActions extension property.

Share this