Add security scanning CI (CodeQL, pip-audit, Dependabot) and pre-commit#92
Open
ivan-pinatti wants to merge 5 commits intoAlfredoSequeida:mainfrom
Open
Add security scanning CI (CodeQL, pip-audit, Dependabot) and pre-commit#92ivan-pinatti wants to merge 5 commits intoAlfredoSequeida:mainfrom
ivan-pinatti wants to merge 5 commits intoAlfredoSequeida:mainfrom
Conversation
Adds three free security layers for the public repo: - CodeQL SAST for Python logic bugs and unsafe API usage - pip-audit dependency scan against OSV database for CVEs - Dependabot for automated dependency and Actions version updates Closes: AlfredoSequeida#91
Adds bandit (SAST) as a pre-commit hook for catching security issues in Python code locally before push. Runs only on staged files by default. Existing findings in the codebase (shell=True, pickle.loads, /tmp socket path) are pre-existing and for the maintainer to review separately. pip-audit is intentionally CI-only: installing this project requires system libs (libgirepository, Cairo) unavailable in pre-commit's isolated environment.
Adds local dependency vulnerability scanning via pip-audit alongside the existing bandit SAST hook. requirements.txt mirrors setup.py install_requires and is used by pip-audit with --no-deps to avoid dependency resolution. PyGObject is excluded from requirements.txt: it requires gobject-introspection system headers to build metadata, which are not universally available locally. It is fully covered by pip-audit in CI where system libs are installed. Transitive dependency CVEs are also covered by CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the security scanning proposal from #91.
Adds free, automated security scanning at two levels:
CI (GitHub Actions)
Local (pre-commit)
requirements.txtagainst the OSV database before each commit.requirements.txt: it requiresgobject-introspectionsystem headers to build metadata, which are not universally available locally. It is fully covered by pip-audit in CI.Files added / modified
.github/workflows/security.yml.github/dependabot.yml.pre-commit-config.yamlrequirements.txtsetup.py install_requires)README.mdTrigger conditions (CI)
mainworkflow_dispatchPre-existing findings
bandit surfaced the following in the existing codebase (not introduced by this PR):
shell=Truein subprocess calls (hints.py,setup.py,plasmashell.py, others) — CWE-78pickle.loadsfrom a Unix domain socket (mouse.py,mouse_service.py) — CWE-502/tmpsocket path (constants.py) — CWE-377These are reported for the maintainer's awareness. The pre-commit hook runs only on staged files so it won't block existing workflows.
All tooling is free for public repositories — no external accounts or tokens required. All CI jobs have been validated on the fork before this PR.