Skip to main content

[!Warning]
This repository has been deprecated. We will not be making any changes or enhancements to this repository. If you are actively using this utility. Please contact your Customer Success Manager to get in touch with a Mend Professional Services Engineer to discuss possible alternative solutions.

Logo

License GitHub release WS Copy Policy Build and Publish Python 3.6

Mend copy policy tool

The script allows copying policies automatically, from the template project/product to the newly created projects/products, and update existing projects with the template policy. It should run periodically, in order to make sure that all the policies under the required projects/products are up to date.

How to use the script

  1. Create an empty project/product or few with the required template policy.
  2. Tag an empty project/product with the following project tag: key=Policy.Template.Source, value=<yourUniqueTemplateName>.
  3. For a new project/product creation that requires the template policy, add the following project/product tag: key=Policy.Template.Destination, value=<yourUniqueTemplateName>. It can be added via the UI or as part of the Unified Agent run.
  4. The template policy will be updated for the required projects/products. Note: Make sure that the tag Policy.Template.Source value is unique and is presented only in one project/product.

What does the script do?

For each project/product in the system, the script extracts the Tag key called: Policy.Template.Source, and the tag key called Policy.Template.Destination. In the event, the tag value of the project/product with Policy.Template.Source tag key equals the tag value of the project/product with Policy.Template.Destination tag key, the script will do the following:

  • Delete the existing policies from the project/product with Policy.Template.Destination tag key.
  • Copy the project/product policies of the project/product with Policy.Template.Source tag key to the project/product with Policy.Template.Destination tag key.

Supported Operating Systems

  • Linux (Bash): CentOS, Debian, Ubuntu, RedHat
  • Windows (PowerShell): 10, 2012, 2016

Prerequisites

  • Python 3.9 or above

Installation and Execution by pulling package from PyPi:

  1. Execute pip install ws-copy-policy
  • Note: If installing packages as a non-root be sure to include the path to the executables within the Operating System paths.
  1. Run report: ws-copy-policy --wssURL <URL> --userKey <USER_KEY> --apiKey <ORG_TOKEN> --scope <COPY_SCOPE> --thread <THREAD_NUMBER> or ws-copy-policy <CONFIG_FILE_PATH>
  • Note: If installing packages as a non-root be sure to include the path to the executables within the Operating System paths.

Configuration Parameters

===============================================================================================================
| Group         | Parameter            | Description                                                          |
===============================================================================================================
| DEFAULT       | wssUrl                | Mend server URL. Can be found under the 'Integrate' tab in          |   
|               |                      | your Mend organization under Server URL:                             |
|               |                      | https://<domain>.whitesourcesoftware.com                             |
---------------------------------------------------------------------------------------------------------------
| DEFAULT       | userKey              | Mend User Key. Can be found under the 'Profile' section in           |
|               |                      | your Mend organization.                                              |
---------------------------------------------------------------------------------------------------------------
| DEFAULT       | apiKey               | Mend API Key. Can be found under the 'Integrate' tab in your         |
|               |                      | your Mend organization.                                              |
---------------------------------------------------------------------------------------------------------------
| DEFAULT       | scope                | The scope where the copying policies should be performed on.         |
|               |                      | Possible values: project/product.                                    |
---------------------------------------------------------------------------------------------------------------
| DEFAULT       | thread               | Multi-threading - speeds up the copying, but it depends              |
|               |                      | on your environment capabilities (default: 5).                       |
===============================================================================================================

Author

Mend.io ©

Metadata

Release files for ws-copy-policy 23.12.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for ws-copy-policy 23.12.2
File Interpreter ABI Platform Actions
ws_copy_policy-23.12.2-py3-none-any.whl Python 3 none any Details for ws_copy_policy-23.12.2-py3-none-any.whl

Release files / ws_copy_policy-23.12.2-py3-none-any.whl

Download URL ws_copy_policy-23.12.2-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3413009eebc9680f2b3d99dd3196a5ef07b5388afdb69f1ae6dbe955e02b2ffc
BLAKE2b-256 checksum
How to use checksums
b7aadc9bf8f466aaa1ac344c2ff6fe911eb23beeb8a1e7c9b843ccc932cd5945
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Security for ws-copy-policy 23.12.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page