Build 1 success

gitbay-security on main · 2a3787abf6 · queued 2026-11-01 04:00 UTC · finished 2026-11-01 04:41 UTC · ran 1m25s

setup
$ git clone ssh://git@127.0.0.1/krz/hutch-stats.git (2a3787abf6)
step 1/2 mkdir -p "$GITBAY_RESULTS"

step 2/2 opengrep scan --quiet --disable-version-check --config /opt/opengrep-rules --sarif-output="$GITBAY_RESULTS/opengrep.sarif" .
                    
                    
┌──────────────────┐
│ 12 Code Findings │
└──────────────────┘
              
    Dockerfile
     ❱ opt.opengrep-rules.dockerfile.audit.dockerfile-source-not-pinned
          To ensure reproducible builds, pin Dockerfile `FROM` commands to a specific hash. You can find the
          hash by running `docker pull python` and then  specify it with `python:3.12-slim@sha256:<hash goes
          here>`                                                                                            
                                                                                                            
            1┆ FROM python:3.12-slim
   
    ❯❱ opt.opengrep-rules.dockerfile.best-practice.remove-package-cache
          The package cache was not deleted after running 'apt-get update', which increases the size of the   
          image. Remove the package cache by appending '&& apt-get clean' at the end of apt-get command chain.
                                                                                                              
            8┆ RUN apt-get update \
   
   ❯❯❱ opt.opengrep-rules.dockerfile.security.missing-user
          By not specifying a USER, a program in the container may run as 'root'. This is a security hazard.
          If an attacker can control a process running as root, they may have control over the container.   
          Ensure that the last USER in a Dockerfile is a USER other than 'root'.                            
                                                                                                            
           ▶▶┆ Autofix ▶ USER non-root CMD ["sh", "-c", "alembic upgrade head && uvicorn srht_contrib.main:app --host
              0.0.0.0 --port 8000"]                                                                                  
           25┆ CMD ["sh", "-c", "alembic upgrade head && uvicorn srht_contrib.main:app --host 0.0.0.0
               --port 8000"]                                                                         
                                                           
    alembic/versions/20260411_0004_recent_backfill_scope.py
    ❯❱ opt.opengrep-rules.python.lang.best-practice.pass-body-fn
          `pass` is the body of function downgrade. Consider removing this or raise NotImplementedError() if
          this is a TODO                                                                                    
                                                                                                            
           88┆ def downgrade() -> None:
           89┆     pass
                          
    src/srht_contrib/db.py
   ❯❯❱ opt.opengrep-rules.python.lang.maintainability.useless-inner-function
          function `_configure_sqlite` is defined inside a function but never used
                                                                                  
           28┆ @event.listens_for(engine, "connect")
           29┆ def _configure_sqlite(dbapi_connection, connection_record) -> None:  # type: ignore[unused-
               ignore]                                                                                    
           30┆     cursor = dbapi_connection.cursor()
           31┆     cursor.execute(f"PRAGMA busy_timeout = {int(settings.sqlite_busy_timeout_seconds *
               1000)}")                                                                              
           32┆     if settings.database_url not in {"sqlite://", "sqlite:///:memory:"}:
           33┆         cursor.execute("PRAGMA journal_mode = WAL")
           34┆         cursor.execute("PRAGMA synchronous = NORMAL")
           35┆     cursor.close()
   
    ❯❱ opt.opengrep-rules.python.lang.security.audit.formatted-sql-query
          Detected possible formatted SQL query. Use parameterized queries instead.
                                                                                   
           31┆ cursor.execute(f"PRAGMA busy_timeout = {int(settings.sqlite_busy_timeout_seconds * 1000)}")
   
   ❯❯❱ opt.opengrep-rules.python.sqlalchemy.security.sqlalchemy-execute-raw-query
          Avoiding SQL string concatenation: untrusted input concatenated with raw SQL query can result in SQL
          Injection. In order to execute raw query safely, prepared statement should be used. SQLAlchemy      
          provides TextualSQL to easily used prepared statement with named parameters. For complex SQL        
          composition, use SQL Expression Language or Schema Definition Language. In most cases, SQLAlchemy   
          ORM will be a better option.                                                                        
                                                                                                              
           31┆ cursor.execute(f"PRAGMA busy_timeout = {int(settings.sqlite_busy_timeout_seconds * 1000)}")
                                   
    src/srht_contrib/jobs/poller.py
    ❯❱ opt.opengrep-rules.python.lang.maintainability.is-function-without-parentheses
          Is "is_active" a function or an attribute? If it is a function, you may have meant
          TrackedActor.is_active() because TrackedActor.is_active is always true.           
                                                                                            
           70┆ .where(TrackedActor.is_active.is_(True))
            ⋮┆----------------------------------------
    ❯❱ opt.opengrep-rules.python.lang.maintainability.is-function-without-parentheses
          Is "is_active" a function or an attribute? If it is a function, you may have meant
          tracked_actor.is_active() because tracked_actor.is_active is always true.         
                                                                                            
          136┆ tracked_actor.is_active = True
                                              
    src/srht_contrib/scripts/enqueue_actors.py
    ❯❱ opt.opengrep-rules.python.lang.maintainability.is-function-without-parentheses
          Is "is_active" a function or an attribute? If it is a function, you may have meant
          tracked_actor.is_active() because tracked_actor.is_active is always true.         
                                                                                            
           69┆ tracked_actor.is_active = True
                                           
    src/srht_contrib/services/aggregator.py
    ❯❱ opt.opengrep-rules.python.lang.maintainability.is-function-without-parentheses
          Is "is_indexed" a function or an attribute? If it is a function, you may have meant
          calendar.is_indexed() because calendar.is_indexed is always true.                  
                                                                                             
           62┆ is_indexed=calendar.is_indexed,
            ⋮┆----------------------------------------
    ❯❱ opt.opengrep-rules.python.lang.maintainability.is-function-without-parentheses
          Is "is_recent_window_backfilled" a function or an attribute? If it is a function, you may have meant
          calendar.is_recent_window_backfilled() because calendar.is_recent_window_backfilled is always true. 
                                                                                                              
           65┆ is_recent_window_backfilled=calendar.is_recent_window_backfilled,

results uploaded