Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

[StepSecurity] Apply security best practices - #1371

Closed
step-security-bot wants to merge 1 commit into
otterscale:mainfrom
step-security-bot:chore/GHA-251520-stepsecurity-remediation
Closed

step-security-bot wants to merge 1 commit into
otterscale:mainfrom
step-security-bot:chore/GHA-251520-stepsecurity-remediation

Conversation

@step-security-bot

Copy link
Copy Markdown
Contributor

Summary

This pull request is created by StepSecurity at the request of @iasthc. Please merge the Pull Request to incorporate the requested changes. Please tag @iasthc on your message if you have any questions related to the PR.

Security Fixes

Least Privileged GitHub Actions Token Permissions

The GITHUB_TOKEN is an automatically generated secret to make authenticated calls to the GitHub API. GitHub recommends setting minimum token permissions for the GITHUB_TOKEN.

Pinned Dependencies

GitHub Action tags and Docker tags are mutable. This poses a security risk. GitHub's Security Hardening guide recommends pinning actions to full length commit.

Harden Runner

Harden-Runner is an open-source security agent for the GitHub-hosted runner to prevent software supply chain attacks. It prevents exfiltration of credentials, detects tampering of source code during build, and enables running jobs without sudo access. See how popular open-source projects use Harden-Runner here.

Harden runner usage

You can find link to view insights and policy recommendation in the build log

Please refer to documentation to find more details.

Keeping your actions up to date with Dependabot

With Dependabot version updates, when Dependabot identifies an outdated dependency, it raises a pull request to update the manifest to the latest version of the dependency. This is recommended by GitHub as well as The Open Source Security Foundation (OpenSSF).

Detect Vulnerabilities with SAST Workflow

Static Code Analysis (also known as Source Code Analysis) is usually performed as part of a Code Review (also known as clear-box testing) and is carried out at the Implementation phase of a Security Development Lifecycle (SDL). Static Code Analysis commonly refers to the running of Static Code Analysis tools that attempt to highlight possible vulnerabilities within ‘static’ (non-running) source code by using techniques such as Taint Analysis and Data Flow Analysis.

Secure Dockerfiles

Pin image tags to digests in Dockerfiles. With the Docker v2 API release, it became possible to use digests in place of tags when pulling images or to use them in FROM lines in Dockerfiles.

Add Dependency Review Workflow

The Dependency Review Workflow enforces dependency reviews on your pull requests. The action scans for vulnerable versions of dependencies introduced by package version changes in pull requests, and warns you about the associated security vulnerabilities. This gives you better visibility of what's changing in a pull request, and helps prevent vulnerabilities being added to your repository.

Maintain Code Quality with Pre-Commit

Pre-commit is a framework for managing and maintaining multi-language pre-commit hooks. Hooks can be any scripts, code, or binaries that run at any stage of the git workflow. Pre-commit hooks are useful for enforcing code quality, code formatting, and detecting security vulnerabilities.

Feedback

For bug reports, feature requests, and general feedback; please email support@stepsecurity.io. To create such PRs, please visit https://app.stepsecurity.io/securerepo.

Signed-off-by: StepSecurity Bot bot@stepsecurity.io

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @step-security-bot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request, initiated by StepSecurity, significantly enhances the repository's security posture by integrating several best practices. The changes focus on automating dependency updates, enforcing code quality and security checks through pre-commit hooks, and securing Docker builds by pinning base images to immutable digests. These measures collectively aim to reduce vulnerabilities and maintain a robust development environment.

Highlights

  • Enhanced Dependency Management: Dependabot has been configured to monitor and update Docker and NPM dependencies across various directories, ensuring that the project's dependencies remain current and secure.
  • Introduced Pre-Commit Hooks: A new pre-commit configuration has been added to enforce code quality and security checks before commits are made. This includes tools for secret detection (gitleaks), Go linting (golangci-lint), shell script analysis (shellcheck), JavaScript linting (eslint), and basic formatting (end-of-file-fixer, trailing-whitespace).
  • Secured Docker Builds: Base images in the Dockerfiles have been updated to pin to specific SHA256 digests. This ensures immutability and prevents unexpected changes to the base images, enhancing the security and reproducibility of builds.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (7)
    • .github/workflows/ci-go.yml
    • .github/workflows/ci-sveltekit.yml
    • .github/workflows/codeql.yml
    • .github/workflows/dependency-review.yml
    • .github/workflows/ghcr-service.yml
    • .github/workflows/ghcr-web.yml
    • .github/workflows/scorecard.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request from StepSecurity introduces several valuable security enhancements, such as pinning base image versions in Dockerfiles to specific digests and setting up pre-commit hooks and Dependabot. These are excellent practices for improving repository security and code quality. I have one suggestion to correct the directory path in the Dependabot configuration for npm packages to ensure it functions as intended.

Comment thread .github/dependabot.yml
Comment on lines +33 to +36
- package-ecosystem: npm
directory: /web/static/vnc
schedule:
interval: daily

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The directory for the npm package ecosystem appears to be incorrect. The package.json and pnpm-lock.yaml files for the web application are in the /web directory, not /web/static/vnc. Updating this path will ensure Dependabot can correctly monitor and update your npm dependencies.

  - package-ecosystem: npm
    directory: /web
    schedule:
      interval: daily

@codecov

codecov Bot commented Dec 25, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@iasthc iasthc closed this Dec 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants