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

ci: Add listen.dev to Github Actions #3059

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft

ci: Add listen.dev to Github Actions #3059

wants to merge 4 commits into from

Conversation

jkan2
Copy link
Contributor

@jkan2 jkan2 commented Oct 29, 2024

Description

Adds a new security tool (listen.dev) to github actions.

note: this needs to be merged for it to work see this as I used this repo testing. It only works when it was already merged in main.

How Has This Been Tested?

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Summary by CodeRabbit

  • New Features

    • Introduced a new workflow for vulnerability checks in the listen.dev application, enhancing security measures during development.
  • Chores

    • Set up automated triggers for the vulnerability checks, including manual dispatch and events related to pull requests and branch pushes.

Copy link
Contributor

coderabbitai bot commented Oct 29, 2024

📝 Walkthrough

Walkthrough

A new GitHub Actions workflow named lstn.yml has been created to perform vulnerability checks for the listen.dev application. This workflow is triggered by manual dispatch, pull requests, and pushes to the develop branch. It includes a job that runs on the latest Ubuntu version, with conditions to skip execution for certain actors or pull request sources. The workflow consists of checking out the repository and executing a vulnerability scan using a specified action with a provided API key.

Changes

File Change Summary
.github/workflows/lstn.yml Introduced a new workflow for vulnerability checks, triggered by manual dispatch, pull requests, and pushes to develop. Includes conditions for execution and defines steps for repository checkout and vulnerability scanning.

Possibly related PRs

  • ci: Add Semgrep to CI #2912: The introduction of a new GitHub Actions workflow for Semgrep may relate to the overall CI/CD improvements, similar to the new workflow for vulnerability checks in the main PR.
  • ci: Add SARIF upload to GitHub Security Dashboard #2929: Enhancements to the Semgrep workflow, including output formatting and integration with GitHub Security Dashboard, indicate a focus on security checks, aligning with the vulnerability checks in the main PR.
  • fix(ci): prevents semgrep from failing on forks #3092: The modification to the Semgrep workflow to prevent failures on forks suggests a refinement in CI processes, which is relevant to the new workflow introduced in the main PR for vulnerability checks.

Suggested reviewers

  • gartnera
  • lumtis
  • CharlieMc0

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the ci Changes to CI pipeline or github actions label Oct 29, 2024
@jkan2 jkan2 changed the title add listen.dev github actions file Add listen.dev Github Actions Oct 29, 2024
@jkan2 jkan2 changed the title Add listen.dev Github Actions ci: Add listen.dev Github Actions Nov 7, 2024
@jkan2 jkan2 added the no-changelog Skip changelog CI check label Nov 7, 2024
@jkan2 jkan2 changed the title ci: Add listen.dev Github Actions ci: Add listen.dev to Github Actions Nov 9, 2024
Copy link

The listen.dev eavesdropping engine didn't spot any critical runtime threat.

Congrats, you're safe!

@jkan2 jkan2 marked this pull request as ready for review November 12, 2024 00:19
@jkan2 jkan2 requested a review from a team as a code owner November 12, 2024 00:19
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (3)
.github/workflows/lstn.yml (3)

1-8: Consider refining the workflow triggers

The current trigger configuration might be too broad. Consider limiting pull request triggers to specific target branches (e.g., develop, main) to avoid unnecessary runs.

 pull_request:
+  branches:
+    - develop
+    - main

13-15: Improve condition readability and fix formatting

The conditional logic is correct but could be more readable. Also, there's a trailing space on line 15.

-    if: |
-      github.actor != 'dependabot[bot]' &&
-      (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'zeta-chain/node') 
+    if: >
+      github.actor != 'dependabot[bot]' &&
+      (
+        github.event_name != 'pull_request' ||
+        github.event.pull_request.head.repo.full_name == 'zeta-chain/node'
+      )
🧰 Tools
🪛 yamllint

[error] 15-15: trailing spaces

(trailing-spaces)


16-24: Fix formatting issues

Several formatting issues need to be addressed:

  • Incorrect indentation in steps section
  • Trailing spaces
  • Missing newline at end of file
     steps:
-    - name: Checkout repository
-      uses: actions/checkout@v4
-      
-    - name: Run listen.dev Scan
-      uses: listendev/[email protected]
-      with: 
-        jwt: ${{ secrets.LSTN_API_KEY }}
-        ci: only
+      - name: Checkout repository
+        uses: actions/checkout@v4
+
+      - name: Run listen.dev Scan
+        uses: listendev/[email protected]
+        with:
+          jwt: ${{ secrets.LSTN_API_KEY }}
+          ci: only
+
🧰 Tools
🪛 yamllint

[warning] 17-17: wrong indentation: expected 6 but found 4

(indentation)


[error] 19-19: trailing spaces

(trailing-spaces)


[error] 22-22: trailing spaces

(trailing-spaces)


[error] 24-24: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 7c70809 and 931d777.

📒 Files selected for processing (1)
  • .github/workflows/lstn.yml (1 hunks)
🧰 Additional context used
🪛 yamllint
.github/workflows/lstn.yml

[error] 15-15: trailing spaces

(trailing-spaces)


[warning] 17-17: wrong indentation: expected 6 but found 4

(indentation)


[error] 19-19: trailing spaces

(trailing-spaces)


[error] 22-22: trailing spaces

(trailing-spaces)


[error] 24-24: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (1)
.github/workflows/lstn.yml (1)

20-24: Verify secret configuration and consider version pinning

The workflow depends on the LSTN_API_KEY secret. Also, consider pinning to an exact version of the listen.dev action for better security.

🧰 Tools
🪛 yamllint

[error] 22-22: trailing spaces

(trailing-spaces)


[error] 24-24: no new line character at the end of file

(new-line-at-end-of-file)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear what purpose this tool actually serves? From their website:

See and control every external connection your builds make to catch malicious behavior before it reaches production.

But this isn't integrated into any of the build/test workflows so you won't really see anything?

@jkan2 jkan2 marked this pull request as draft November 13, 2024 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Changes to CI pipeline or github actions no-changelog Skip changelog CI check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants