Skip to content

Conversation

@sk-keeper
Copy link
Collaborator

No description provided.

adeshmukh-ks and others added 30 commits October 31, 2025 21:47
* record_type_info and load_record_types functions added

* Moved functions to cli commands

* Corrected review changes
@socket-security
Copy link

socket-security bot commented Nov 1, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcbor2@​5.7.1100100100100100
Addedwinrt-runtime@​3.2.1100100100100100
Addedpyobjc-framework-localauthentication@​12.0100100100100100

View full report

Comment on lines +49 to +71
name: Publish Keeper CLI to PyPi
runs-on: ubuntu-latest
needs: [build-n-publish]
environment: prod

steps:
- uses: actions/download-artifact@v3
with:
name: CommanderWheel
path: dist
name: KeeperCLIWheel
path: keepercli-package/dist

- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: 'x64'

- name: Retrieve secrets from Keeper
id: ksecrets
uses: Keeper-Security/ksm-action@master
with:
keeper-secret-config: ${{ secrets.KSM_COMMANDER_SECRET_CONFIG }}
secrets: |
gD5LOOhI5QbnSFk8mIg3gg/field/password > PYPI_PASSWORD
python-version: '3.11'

- name: Publish to PyPi
- name: Publish keepercli to PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ steps.ksecrets.outputs.PYPI_PASSWORD }}
TWINE_PASSWORD: ${{ secrets.PYPI_PUBLISH_TOKEN }}
run: |
python -m pip install -U setuptools pip wheel twine
twine upload dist/*
twine upload -r pypi keepercli-package/dist/*

Check warning

Code scanning / CodeQL

Workflow does not contain permissions

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}

Copilot Autofix

AI about 2 months ago

To fix this issue, we need to add a permissions block to the publish-pypi job in .github/workflows/publish-cli-to-pypi.yml, as was already done for the build-n-publish job. The recommended minimum starting point is to set contents: read, which allows the job to read repository contents but not write to it. This achieves the principle of least privilege and stops jobs from having unnecessary access. To implement this, add the block after the timeout-minutes/runs-on/needs/environment section but before steps: in the publish-pypi job.


Suggested changeset 1
.github/workflows/publish-cli-to-pypi.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/publish-cli-to-pypi.yml b/.github/workflows/publish-cli-to-pypi.yml
--- a/.github/workflows/publish-cli-to-pypi.yml
+++ b/.github/workflows/publish-cli-to-pypi.yml
@@ -50,6 +50,8 @@
     runs-on: ubuntu-latest
     needs: [build-n-publish]
     environment: prod
+    permissions:
+      contents: read
 
     steps:
       - uses: actions/download-artifact@v3
EOF
@@ -50,6 +50,8 @@
runs-on: ubuntu-latest
needs: [build-n-publish]
environment: prod
permissions:
contents: read

steps:
- uses: actions/download-artifact@v3
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines 68 to 96
name: Publish to Production PyPI
runs-on: ubuntu-latest
needs: [build-wheel]
needs: [publish-test-pypi]
environment: prod

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: CommanderWheel
path: dist

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.11'
name: KeeperSdkWheel
path: keepersdk-package/dist

- name: Retrieve secrets from Keeper
id: ksecrets
uses: Keeper-Security/ksm-action@master
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
keeper-secret-config: ${{ secrets.KSM_COMMANDER_SECRET_CONFIG }}
secrets: |
gD5LOOhI5QbnSFk8mIg3gg/field/password > PYPI_PASSWORD
python-version: '3.13'

- name: Publish to PyPi
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ steps.ksecrets.outputs.PYPI_PASSWORD }}
TWINE_PASSWORD: ${{ secrets.PYPI_PUBLISH_TOKEN }}
run: |
python -m pip install -U setuptools pip wheel twine
twine upload dist/*
python -m pip install -U twine
twine upload keepersdk-package/dist/*

Check warning

Code scanning / CodeQL

Workflow does not contain permissions

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}

Copilot Autofix

AI about 2 months ago

The best fix is to add an explicit permissions block to the publish-pypi job, limiting the permissions of the GITHUB_TOKEN. In this case, since the job does not appear to require any write access to the repository (it only uploads the built artifact to PyPI using secrets), the minimal contents: read permission is appropriate. This is already the setting used in the build-and-test job, so it should also be applied here for consistency and in accordance with the principle of least privilege.

Change needed:
In .github/workflows/publish-sdk.yml, add the following under the publish-pypi: job (aligned with other keys like runs-on and needs):

permissions:
  contents: read

No additional methods, imports, or library dependencies are needed.


Suggested changeset 1
.github/workflows/publish-sdk.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/publish-sdk.yml b/.github/workflows/publish-sdk.yml
--- a/.github/workflows/publish-sdk.yml
+++ b/.github/workflows/publish-sdk.yml
@@ -69,6 +69,8 @@
     runs-on: ubuntu-latest
     needs: [publish-test-pypi]
     environment: prod
+    permissions:
+      contents: read
 
     steps:
       - uses: actions/download-artifact@v4
EOF
@@ -69,6 +69,8 @@
runs-on: ubuntu-latest
needs: [publish-test-pypi]
environment: prod
permissions:
contents: read

steps:
- uses: actions/download-artifact@v4
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@sk-keeper sk-keeper merged commit c53e96f into master Nov 1, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants