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

chore(indexer): remove indexer all command #7247

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

roninjin10
Copy link
Contributor

In k8s repo we are adding api as a new service and the new indexer replaces the old indexer/api

  • remove indexer all command
  • make indexer index the default docker command so we don't have to override the command when we upgrade

@roninjin10
Copy link
Contributor Author

roninjin10 commented Sep 14, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@mergify mergify bot added the A-indexer Area: indexer label Sep 14, 2023
@semgrep-app
Copy link
Contributor

semgrep-app bot commented Sep 14, 2023

Semgrep found 1 gorm-hardcoded-secret finding:

  • indexer/database/db.go: L51-55

A secret is hard-coded in the application. Secrets stored in source code, such as credentials, identifiers, and other types of sensitive data, can be leaked and used by internal or external malicious actors. Use environment variables to securely provide credentials and other secrets or retrieve them from a secure vault or Hardware Security Module (HSM).

View Dataflow Graph
Loading
flowchart LR
    classDef invis fill:white, stroke: none
    classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none

    subgraph File0["<b>indexer/database/db.go</b>"]
        direction LR
        %% Source

        subgraph Source
            direction LR

            v0("<b>[Line: 49]</b> #quot; password=%s#quot;")
        end
        %% Intermediate

        subgraph Traces0[Traces]
            direction TB

            v2("<b>[Line: 49]</b> dsn")
        end
        %% Sink

        subgraph Sink
            direction LR

            v1("<b>[Line: 51]</b> gorm.Open(postgres.Open(dsn), &gorm.Config{<br>			// The indexer will explicitly manage the transactions<br>			SkipDefaultTransaction: true,<br>			Logger:                 logger.Default.LogMode(logger.Silent),<br>		})")
        end
    end
    %% Class Assignment
    Source:::invis
    Sink:::invis

    Traces0:::invis
    File0:::invis

    %% Connections

    Source --> Traces0
    Traces0 --> Sink

    %% Clickable

    click v0 href "https://github.com/ethereum-optimism/optimism/blob/59bb1d5de89646a9811dee014f95b02104eb1369/indexer/database/db.go#L49" "View in source" _blank
    click v1 href "https://github.com/ethereum-optimism/optimism/blob/59bb1d5de89646a9811dee014f95b02104eb1369/indexer/database/db.go#L51" "View in source" _blank
    click v2 href "https://github.com/ethereum-optimism/optimism/blob/59bb1d5de89646a9811dee014f95b02104eb1369/indexer/database/db.go#L49" "View in source" _blank
Ignore this finding from gorm-hardcoded-secret.

Semgrep found 1 gorm-empty-password finding:

  • indexer/database/db.go: L51-55

The application uses an empty credential. This can lead to unauthorized access by either an internal or external malicious actor. Use environment variables to securely provide credentials and other secrets or retrieve them from a secure vault or Hardware Security Module (HSM).

View Dataflow Graph
Loading
flowchart LR
    classDef invis fill:white, stroke: none
    classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none

    subgraph File0["<b>indexer/database/db.go</b>"]
        direction LR
        %% Source

        subgraph Source
            direction LR

            v0("<b>[Line: 49]</b> #quot; password=%s#quot;")
        end
        %% Intermediate

        subgraph Traces0[Traces]
            direction TB

            v2("<b>[Line: 49]</b> dsn")
        end
        %% Sink

        subgraph Sink
            direction LR

            v1("<b>[Line: 51]</b> gorm.Open(postgres.Open(dsn), &gorm.Config{<br>			// The indexer will explicitly manage the transactions<br>			SkipDefaultTransaction: true,<br>			Logger:                 logger.Default.LogMode(logger.Silent),<br>		})")
        end
    end
    %% Class Assignment
    Source:::invis
    Sink:::invis

    Traces0:::invis
    File0:::invis

    %% Connections

    Source --> Traces0
    Traces0 --> Sink

    %% Clickable

    click v0 href "https://github.com/ethereum-optimism/optimism/blob/59bb1d5de89646a9811dee014f95b02104eb1369/indexer/database/db.go#L49" "View in source" _blank
    click v1 href "https://github.com/ethereum-optimism/optimism/blob/59bb1d5de89646a9811dee014f95b02104eb1369/indexer/database/db.go#L51" "View in source" _blank
    click v2 href "https://github.com/ethereum-optimism/optimism/blob/59bb1d5de89646a9811dee014f95b02104eb1369/indexer/database/db.go#L49" "View in source" _blank
Ignore this finding from gorm-empty-password.

@roninjin10 roninjin10 marked this pull request as draft September 14, 2023 16:10
@roninjin10 roninjin10 force-pushed the 09-01-feat_indexer_Add_sql_migrations_file branch from 0a15ed1 to 91da739 Compare September 14, 2023 18:16
@roninjin10 roninjin10 force-pushed the 09-14-chore_indexer_remove_indexer_all_command branch from 59bb1d5 to 6d24e42 Compare September 14, 2023 18:16
@roninjin10 roninjin10 force-pushed the 09-01-feat_indexer_Add_sql_migrations_file branch from 91da739 to 7318de6 Compare September 14, 2023 18:24
@roninjin10 roninjin10 force-pushed the 09-14-chore_indexer_remove_indexer_all_command branch from 6d24e42 to 149efb1 Compare September 14, 2023 18:25
@mergify
Copy link
Contributor

mergify bot commented Sep 15, 2023

Hey @roninjin10! This PR has merge conflicts. Please fix them before continuing review.

@mergify mergify bot added the S-conflict Status: A conflict is present label Sep 15, 2023
@roninjin10 roninjin10 force-pushed the 09-01-feat_indexer_Add_sql_migrations_file branch from d50c58f to bbc8a8d Compare September 19, 2023 16:35
@roninjin10 roninjin10 marked this pull request as ready for review September 21, 2023 06:06
@roninjin10 roninjin10 changed the base branch from 09-01-feat_indexer_Add_sql_migrations_file to develop September 21, 2023 06:08
@roninjin10 roninjin10 force-pushed the 09-14-chore_indexer_remove_indexer_all_command branch from 149efb1 to d7763d0 Compare September 21, 2023 06:08
@roninjin10 roninjin10 force-pushed the 09-14-chore_indexer_remove_indexer_all_command branch from d7763d0 to 313fbaf Compare September 21, 2023 06:08
@mergify mergify bot removed the S-conflict Status: A conflict is present label Sep 21, 2023
@OptimismBot OptimismBot merged commit cedd438 into develop Sep 21, 2023
7 checks passed
@OptimismBot OptimismBot deleted the 09-14-chore_indexer_remove_indexer_all_command branch September 21, 2023 06:20
@mergify
Copy link
Contributor

mergify bot commented Sep 21, 2023

This PR has been added to the merge queue, and will be merged soon.

@mergify mergify bot added the S-on-merge-train Status: This PR is in the merge queue label Sep 21, 2023
@mergify
Copy link
Contributor

mergify bot commented Sep 21, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

@mergify mergify bot removed the S-on-merge-train Status: This PR is in the merge queue label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-indexer Area: indexer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants