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

Support scanning multiple git repositories in one invocation #193

Merged
merged 1 commit into from
Jun 16, 2019

Conversation

domanchi
Copy link
Contributor

Description

With the changes made in #188, this supports scanning for multiple git repositories at once.

There are several benefits to this:

  1. With this, you can generate one giant baseline for all repositories that you track. This is especially handy for plugin development, when you want to compare baselines across multiple repositories.

  2. Scanning multiple repositories, without needing to scan every file (with --all-files flag).

I also threw in a bug fix to ignore files, if no git tracked files are found.

Example

~ $ git status
fatal: Not a git repository (or any parent up to mount point /home/aaronloo)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
~ $ detect-secrets scan detect-secrets/test_data detect-secrets-server
{
  "exclude": {
    "files": null,
    "lines": null
  },
  "generated_at": "2019-06-15T02:59:26Z",
  "plugins_used": [...],
  "results": {
    "detect-secrets-server/README.md": [
      {
        "hashed_secret": "cdd5f4b553c63f87de1a4fce14f1ad8fa2a1d1f6",
        "line_number": 191,
        "type": "Hex High Entropy String"
      }
    ],
    ...
    "detect-secrets/test_data/config.env": [
      {
        "hashed_secret": "513e0a36963ae1e8431c041b744679ee578b7c44",
        "line_number": 1,
        "type": "Base64 High Entropy String"
      }
    ]
}

Also, bug fix to ignore files if no git tracked files are found.
Copy link
Collaborator

@KevinHock KevinHock left a comment

Choose a reason for hiding this comment

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

LGTM ☕️ ✅🛳

@domanchi domanchi merged commit fbf245f into master Jun 16, 2019
@KevinHock KevinHock deleted the support-scanning-multiple-git-repos branch September 21, 2019 00:38
killuazhu pushed a commit to IBM/detect-secrets that referenced this pull request May 28, 2020
* Refactor get_caller_info into a general query_aws function

Allows reuse of this same function to query for email address using accountid.

Supports git-defenders/detect-secrets-discuss#185
Follow up of [this thread](https://github.ibm.com/git-defenders/detect-secrets-stream/pull/182#discussion_r2404867)

* Docstring update
killuazhu pushed a commit to IBM/detect-secrets that referenced this pull request Jul 9, 2020
* Refactor get_caller_info into a general query_aws function

Allows reuse of this same function to query for email address using accountid.

Supports git-defenders/detect-secrets-discuss#185
Follow up of [this thread](https://github.ibm.com/git-defenders/detect-secrets-stream/pull/182#discussion_r2404867)

* Docstring update
killuazhu pushed a commit to IBM/detect-secrets that referenced this pull request Sep 17, 2020
Refactor AWS verification to enable reuse for owner resolution

Follow up of git-defenders/detect-secrets-stream#182

Fix AWS verify (Yelp#192)

Addresses git-defenders/detect-secrets-discuss#187

Refactor get_caller_info into a general query_aws function (Yelp#193)

Allows reuse of this same function to query for email address using accountid.

Supports git-defenders/detect-secrets-discuss#185
Follow up of [this thread](https://github.ibm.com/git-defenders/detect-secrets-stream/pull/182#discussion_r2404867)

* Docstring update
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.

None yet

2 participants