Skip to content
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 trivy workflow to scan repo as IaC #251

Merged
merged 3 commits into from
Jun 25, 2024
Merged

Conversation

hossnys
Copy link
Collaborator

@hossnys hossnys commented May 13, 2024

due to https://github.com/threefoldtech/tf_operations/issues/2163

  • added Trivy workflow to run with any commit or PR on development branch .

@hossnys hossnys marked this pull request as draft May 14, 2024 07:51
@github-advanced-security
Copy link

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.

@hossnys hossnys marked this pull request as ready for review May 14, 2024 12:34
@PeterNashaat
Copy link
Member

  • Noticed that the workflow didn't seem to produce any results in the Security tab, nor I found the trivy-results.sarif file anywhere. It looks like the current setup is configured to scan Infrastructure as Code (IaC) configurations not Dockerfiles or container images. The scan-type: 'config' setting tells Trivy to focus on configuration files instead of container images.

  • Using scan-type: 'config' does scan Dockerfles for misconfigurations, like security best practice, but not for the vulns found in software packages within Docker images. If you want to scan Docker images for vulnerabilities, you should use scan-type: 'image'. :-

(config) Scans : This type checks for issues like running as the root user or missing security configurations in Docker files.
(image) Scans : This type find vulns in the software packages included in Dcoker images.

Trivy Configuration Scanning
Trivy Container Image Scanning

@hossnys
Copy link
Collaborator Author

hossnys commented May 16, 2024

  • Noticed that the workflow didn't seem to produce any results in the Security tab, nor I found the trivy-results.sarif file anywhere. It looks like the current setup is configured to scan Infrastructure as Code (IaC) configurations not Dockerfiles or container images. The scan-type: 'config' setting tells Trivy to focus on configuration files instead of container images.
  • according to this part the workflow is configured to work against development branch , so as the PR is not merged yet so the code is not there to be triggered by a push on development branch , I tested it on a fork on my GH account here .
  • for trivy-results.sarif file it's included in every result like here :
    Firefox_Screenshot_2024-05-16T13-48-32 143Z
* Using scan-type: 'config' does scan Dockerfles for misconfigurations, like security best practice, but not for the vulns found in software packages within Docker images. If you want to scan Docker images for vulnerabilities, you should use scan-type: 'image'. :-

(config) Scans : This type checks for issues like running as the root user or missing security configurations in Docker files. (image) Scans : This type find vulns in the software packages included in Dcoker images.

Trivy Configuration Scanning Trivy Container Image Scanning

according to this type of IaC scan this was approved by Thabet to go ahead with it , and we can improve it later on with the current and new comming images .

@xmonader
Copy link
Collaborator

I can only provide ideas, if it can be enabled on all branches it would be great :) the end goal is to have security scanning, but you guys know the best how to implement that 😊

@hossnys hossnys merged commit c0df6d6 into development Jun 25, 2024
2 checks passed
@hossnys hossnys deleted the development_add_trivy branch June 25, 2024 13:32
@xmonader xmonader added this to the 3.15.x milestone Oct 14, 2024
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.

4 participants