From 8681a87d53d159925de3ff459a65e61e3b0c3cf7 Mon Sep 17 00:00:00 2001 From: "pixeebot[bot]" <104101892+pixeebot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 03:25:26 +0000 Subject: [PATCH] Secure Source of Randomness --- ci/gitlab/pipeline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/gitlab/pipeline.py b/ci/gitlab/pipeline.py index 733bb0d..2f33eea 100644 --- a/ci/gitlab/pipeline.py +++ b/ci/gitlab/pipeline.py @@ -1,10 +1,10 @@ import os import gitlab -import random import sys import json import whatthepatch import base64 +import secrets # GitLab settings @@ -13,7 +13,7 @@ project_id = os.environ.get("CI_MERGE_REQUEST_PROJECT_ID") source_branch = os.environ.get("CI_MERGE_REQUEST_SOURCE_BRANCH_NAME") new_branch_name = "pixee_" + str( - random.randint(0, 1000) + secrets.SystemRandom().randint(0, 1000) ) # Replace with the desired new branch name merge_id = os.environ.get("CI_MERGE_REQUEST_IID")