-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CodeQL Scan #4078
base: main
Are you sure you want to change the base?
Add CodeQL Scan #4078
Conversation
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work 👍 Thanks for extending the documentation about this topic. I only have a few tiny remarks and suggestions, let me know what you think.
Also for a next time, let's keep the scope smaller. The other workflow suggestions seem to be not relevant for CodeQL. From a DevSecOps view I can see why you'd pin the actions like this, but imo it seems quite inconvenient to apply it like this. We use common GitHub Actions in our workflow and Dependabot keeps an eye for vulnerabilities.
Perhaps we could pin on specific release tags, this is easier to read and update for us as maintainers and also compatible with Dependabot? What do you think @underdarknl @dekkers
I do like the permissions suggestions, this enhances security and prevents mistakes
docs/source/guidelines/security.rst
Outdated
Security in the pipeline | ||
========================= | ||
|
||
The OpenKAT project uses a variety of tools to ensure the security of the coWdebase. These include: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The OpenKAT project uses a variety of tools to ensure the security of the coWdebase. These include: | |
The OpenKAT project uses a variety of tools to ensure the security of the codebase. These include: |
docs/source/guidelines/security.rst
Outdated
|
||
- Python | ||
- JavaScript / TypeScript | ||
- Github Actions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Github Actions | |
- GitHub Actions |
docs/source/guidelines/security.rst
Outdated
SCA | ||
--- | ||
|
||
To scan for vulnerabilities in our code base we use the built-in tool from Github, Dependabot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To scan for vulnerabilities in our code base we use the built-in tool from Github, Dependabot. | |
To scan for vulnerabilities in our code base and keep dependencies up to date, we use Dependabot, a tool for automated dependency updates built into GitHub. |
docs/source/guidelines/security.rst
Outdated
SAST | ||
---- | ||
|
||
To scan for code smells in our code base we use the built-in tool from Github, CodeQL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think code smell is not the correct term for this. Code smells are traces in the code that indicate a deeper problem that should be addressed or refactored. They are not necessarily errors or bugs but rather violations of design principles and best practices (aka bad code) which can lead to maintainability issues.
CodeQL focuses on discovering vulnerabilities in the codebase, whereas linters are more commonly used to detect code smells.
(You could use CodeQL to detect code smells by querying AST trees to find specific patterns, but this requires writing intricate queries and is not the primary focus of CodeQL.)
@ammar92 thanks for the review. The addition of the hashes is because these are finding from CodeQL. In this article it's nicely explained why you would want this: https://blog.rafaelgss.dev/why-you-should-pin-actions-by-commit-hash. Also Dependabot supports this syntax: dependabot/dependabot-core#4691 so updating should not be an issue. But let's do an open discussion because I do understand your concerns. |
3ca731a
to
582189a
Compare
|
Changes
Add a security check by enabling CodeQL, this provides more insight into the security quality of the code.
Issue link
Closes #4077
Demo
QA notes
Make a Pull and it will be shown in the tasks overview.
Code Checklist
.env
changes files if required and changed the.env-dist
accordingly.Checklist for code reviewers:
Copy-paste the checklist from the docs/source/templates folder into your comment.
Checklist for QA:
Copy-paste the checklist from the docs/source/templates folder into your comment.