Python Automation

[Guide] Security in RPA with Python: how to ensure governance and orchestration?

In today’s hyperautomation scenario, with the rise of hybrid automation models and multivendor RPA architectures that combine low-code automations with Python-based automations, security is a critical concern. Especially when working with programming languages like Python, where flexibility comes with significant responsibilities for orchestration and governance.

For CoE leaders and RPA developers, ensuring security in Python RPA automations is crucial to protect sensitive data, maintain control over environments and processes, and ensure operational governance. Never put security issues on the back burner, as security breaches can lead to immeasurable costs and damages.

In this guide, we will explore the pillars of security in Python RPA and best practices to ensure governance. Keep reading!

Pillars of security in Python RPA

To safeguard operations in Python, a language increasingly adopted for its versatility and affinity with artificial intelligence, it’s essential to ensure that your automations are not only efficient but also resilient and reliable. Some pillars of security in Python RPA include:

  • Access control to sensitive data;
  • Isolation of robot execution environments;
  • Log, Error, and Alert management;
  • Access and permission controls;
  • Credential management;
  • Centralization and protection of credentials used in automations;
  • Auditing and monitoring.

Now, let’s dive into the best practices automation teams should follow when orchestrating Python-based automations.

1. Data access control in RPA

In business processes involving sensitive data, it is crucial that automations are executed within your infrastructure to ensure full control over where and how data and documents are processed. Consider the following aspects:

Security policy

Check your company’s security policy to understand the restrictions associated with each type of document, ensuring that processing occurs internally according to security standards.

Temporary file deletion

During the execution of automations, it is common for files to be temporarily saved in the execution environment so that robots can access and manipulate data. It is essential that, once the automation is completed, these temporary files are deleted to prevent unauthorized access.

Segregation of data access

As the automation initiative grows, it is natural that the number of people involved increases, so it is necessary to implement a segregation of access to information.

This can be done by dividing access by departments, teams, or groups, ensuring that each individual has access only to the data they are authorized to work with. This helps maintain the integrity and security of the information handled by automations.

2. Environment isolation in RPA

Network segregation is a crucial isolation measure. It is essential that the IT team sets up this segregation so that the RPA robot execution environment has restricted access only to the network resources necessary for automation execution. Here are some best practices to follow:

Access control to VMs

It is vital to establish access control policies for VMs (Virtual Machines), containers, and other execution environments. In some cases, systems may be accessible with continuously logged-in users, which poses a significant security risk. Therefore, it is important to adopt robust management and monitoring practices for all access to execution environments.

Session control

During automation execution, it is important to ensure that only the necessary sessions are active in the operating systems. Implement mechanisms that allow dynamic creation and termination of sessions according to the automation needs to maximize security and efficiency.

3. Log, error, and alert management

Regardless of the process type—whether it’s supplier approval in ERP systems, financial reconciliation, or document issuance—it is crucial to record detailed information during the execution of automations.

Execution logs in Python RPA

By using logging tools and RPA orchestration tools, it is possible to display and monitor every step of the automation process, allowing the team to view in real-time everything being processed.

In the case of BotCity Orchestrator, from a programming perspective, the development team simply needs to run a Python command to send this data to the orchestrator, facilitating integration and operational transparency. Here’s an example:

creating a new log entry with BotCity

Log management is then handled directly on the orchestrator’s dashboard.

logs

Error management in Python RPA

In RPA automation development, errors are more common than in other types of software development, often due to changes in automations, systems, or poorly formatted data entries by users.

The orchestration platform plays a key role in monitoring these errors and notifying the team for quick interventions and necessary adjustments.

This can be easily managed using the platform’s API, such as BotCity’s, which allows sending error commands to facilitate viewing and handling within the orchestrator.

recording an error in Python RPA

If you’re already using BotCity and want to monitor errors, access the error module to view details such as automation ID, message, automation version, programming language used, and other relevant data.

The stack trace indicates the exact line of the error, the screenshot at the time of the error, and tags related to the execution context, as well as attached files that assist in resolving the issue.

Alerts for technical and business users

During the execution of automations, for various reasons, it may be necessary to notify the team about important occurrences. In BotCity, the alert module makes this communication easy. Alerts can be configured to appear on the web interface or sent via API to emails, WhatsApp, and other communication channels.

From a development perspective, it’s simple to implement in BotCity Orchestrator: the developer just needs to insert a Python command to trigger the alert, specifying the alert type and message.

You can then see the list of alerts with the automation that triggered the alert, task ID, message, and the repository to which the automation belongs.

4. Access control and permissions for Python orchestration

It is recommended to organize users into groups for security reasons, such as teams or departments, allowing controlled access to the information and resources necessary for their roles. This improves productivity, governance, and security.

Within the BotCity orchestration platform, for example, three roles are defined to specify access and permissions:

  • Developers: can manage the development and deployment of automations;
  • Operators: can use and monitor automations, like business users;
  • Administrators: have full oversight and auditing capabilities. Ideal for CoE leaders and automation.

Creating user groups and automation repositories

No matter which platform you use, it’s important to create groups and repositories to segment automations and their access for specific departments and users.

In BotCity Orchestrator, to create a group, just define a name, label, and description. Using repositories to segregate information, you can specify which user groups have access to certain data and resources, increasing security and organization.

Credential management

For security reasons, credentials should not be embedded directly in the source code of automations, especially considering the impact that credential updates can have on automations in production.

To address these challenges, we recommend using a credential management module, which can be implemented in various ways, depending on your company’s security policy. Here are some alternatives:

Password vaults

For companies that prefer to keep their credentials internal, local password vaults can be used to securely store credentials within the company’s own infrastructure.

Cloud platforms for credential management

Solutions such as AWS Secrets and HashiCorp Vault are secure options for managing credentials in the cloud. BotCity offers plugins that facilitate interaction with these platforms, allowing secure handling of credentials.

Credential management in BotCity Orchestrator

In the BotCity platform, developers can create and manage credentials directly through the orchestrator interface.

After creating a new credential, assigning a label, and selecting the appropriate repository, the keys are added securely. An API is available to allow credentials to be accessed dynamically during robot execution. This enables credentials to be updated without impacting running automations, improving the security and resilience of operations.

Auditing and monitoring in Python RPA

Monitoring and auditing actions on RPA platforms is an essential security practice since RPA operations involve sensitive data.

For companies working with code-based automations, BotCity allows you to view audit logs in the orchestrator, filter events by user, source, and date, and integrate this data with other BI platforms through BotCity Insights for greater observability.

All set to enhance the security of your Python automations?

A few key points to emphasize: the most crucial aspect of any RPA project is the process assessment and mapping of scenarios and potential adverse situations. Security is the responsibility of every person and system involved in the processes at all stages.

Now you can implement security measures to protect your code, operations, and company as much as possible. If your team is looking for an orchestration tool for Python, it’s worth exploring BotCity. You can try our orchestrator free for 30 days or connect with our team for a demo of advanced functionalities designed for complex operations.

Gabriel is co-founder and CTO at BotCity. He is one of the maintainers of BotCity Core, Marvin, and MarvinJ open-source frameworks. Follow me: https://www.linkedin.com/in/gabrielarchanjo/

Leave a Reply

Discover more from Blog BotCity - Content for Automation and Governance

Subscribe now to keep reading and get access to the full archive.

Continue reading