René's URL Explorer Experiment


Title: ⚙️ Extend the git-repo-scanner with an activity filter · Issue #320 · secureCodeBox/secureCodeBox · GitHub

Open Graph Title: ⚙️ Extend the git-repo-scanner with an activity filter · Issue #320 · secureCodeBox/secureCodeBox

X Title: ⚙️ Extend the git-repo-scanner with an activity filter · Issue #320 · secureCodeBox/secureCodeBox

Description: Is your feature request related to a problem? Please describe. As secureCodeBox user i am heavily using the git-repo-scanner in combination with the gitleaks scanner via cascadingRules. When scanning large Gitlab oder GitHub organisation...

Open Graph Description: Is your feature request related to a problem? Please describe. As secureCodeBox user i am heavily using the git-repo-scanner in combination with the gitleaks scanner via cascadingRules. When scanni...

X Description: Is your feature request related to a problem? Please describe. As secureCodeBox user i am heavily using the git-repo-scanner in combination with the gitleaks scanner via cascadingRules. When scanni...

Opengraph URL: https://github.com/secureCodeBox/secureCodeBox/issues/320

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"⚙️ Extend the git-repo-scanner with an activity filter","articleBody":"\u003c!--\r\nThank you for reporting an issue in our documentation 🙌\r\n\r\nBefore opening a new issue, please make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.\r\n--\u003e\r\n\r\n**Is your feature request related to a problem? Please describe.**\r\n\u003c!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] --\u003e\r\nAs secureCodeBox user i am heavily using the `git-repo-scanner` in combination with the `gitleaks` scanner via cascadingRules. When scanning large Gitlab oder GitHub organisations _with thousands of repos_ on a regular basis (daily, weekly) this leeds to thousands of independent `gitleaks` scans. \r\n\r\nTo save resources on the `gitleaks` side we extended `gitleaks` to be able to analyse all commits since a given timeframe (last 24h, last week,...): https://github.com/zricethezav/gitleaks/pull/498\r\n\r\nProblem is that the `git-repo-scanner` always returns all git repositories, even if they had no activity in the last timeframe. To safe even more resources it would be great to be able to configure an activity timeframe and use it as filter.\r\n\r\n**Describe the solution you'd like**\r\n\u003c!-- A clear and concise description of what you want to happen. --\u003e\r\nAdd the following configuration options to the `git-repo-scanner`:\r\n\r\n```\r\n--activity-since-duration= Return git repo findings with repo activity (e.g. commits) more recent than a specific date expresed by an duration (now + duration). A duration string is a possibly signed sequence of decimal numbers, each\r\n                               with optional fraction and a unit suffix, such as '300ms', '-1.5h' or '2h45m'. Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'.\r\n--activity-until-duration= Return git repo findings with repo activity (e.g. commits) older than a specific date expresed by an duration (now + duration). A duration string is a possibly signed sequence of decimal numbers, each with\r\n                               optional fraction and a unit suffix, such as '300ms', '-1.5h' or '2h45m'. Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'.\r\n```\r\n_Remark 🚧  : The concrete semantic of the timeframe definition can depend on the implementation details and might be slightly different. It is not important to implement it in exact that semantic._\r\n\r\n### Implementation Hints:\r\n- The GitLab Python client has some helpful methods like sorting all projects by `last_activity_at`: https://python-gitlab.readthedocs.io/en/stable/gl_objects/projects.html#examples \r\n  - `gl.projects.list(all=True, include_subgroups=True, order_by='last_activity_at', sort='desc')`\r\n  - could be used at: https://github.com/secureCodeBox/secureCodeBox/blob/fab01bdff212dde428e4dc9eb6eae4f34e211a98/scanners/git-repo-scanner/scanner/git_repo_scanner.py#L131\r\n- The Github Python client has some helpful methods like sorting all projects by last update https://pygithub.readthedocs.io/en/latest/github_objects/Organization.html#github.Organization.Organization.get_repos\r\n  - `get_repos(type='all', sort='updated', direction='desc')`\r\n  - could be used at: https://github.com/secureCodeBox/secureCodeBox/blob/fab01bdff212dde428e4dc9eb6eae4f34e211a98/scanners/git-repo-scanner/scanner/git_repo_scanner.py#L181\r\n\r\n### Example ScheduledScan Configuration\r\nThe following scheduled scan example will start a new `git-repo-scanner` scan every 24h and then cascades all the results with follow up `gitleaks` scans. The `gitleaks`scanner then analyses all the commits done within the last 24h timeframe.\r\n\r\n```yaml\r\napiVersion: \"execution.securecodebox.io/v1\"\r\nkind: ScheduledScan\r\nmetadata:\r\n  name: \"scb-github-repos\"\r\n  labels:\r\n    product: \"secureCodeBox\"\r\nspec:\r\n  interval: 24h\r\n  successfulJobsHistoryLimit: 1\r\n  failedJobsHistoryLimit: 1\r\n  scanSpec:\r\n    scanType: \"git-repo-scanner\"\r\n    parameters:\r\n      # configuration of the target git system\r\n      - \"--git-type\"\r\n      - \"github\"\r\n      - \"--organization\"\r\n      - \"secureCodeBox\"\r\n      # Provide an access token from ENV Vars defined via secret\r\n      - \"--access-token\"\r\n      - \"$(GITHUB_TOKEN)\"\r\n      # Filter findings - only return git repos with activity (commits) within a given timeframe \r\n      - \"--activity-since-duration\"\r\n      - \"24h\"\r\n    env:\r\n      - name: GITHUB_TOKEN\r\n        valueFrom:\r\n          secretKeyRef:\r\n            name: github-access-token\r\n            key: token\r\n    cascades:\r\n      matchLabels:\r\n        securecodebox.io/intensive: medium\r\n        securecodebox.io/invasive: non-invasive\r\n```\r\n\r\n```yaml\r\napiVersion: \"cascading.securecodebox.io/v1\"\r\nkind: CascadingRule\r\nmetadata:\r\n  name: \"gitleaks-github-scan-public\"\r\n  labels:\r\n    securecodebox.io/invasive: non-invasive\r\n    securecodebox.io/intensive: medium\r\nspec:\r\n  matches:\r\n    anyOf:\r\n      - name: \"GitHub Repo\"\r\n        attributes:\r\n          visibility: public\r\n  scanSpec:\r\n    scanType: \"gitleaks\"\r\n    parameters:\r\n      - \"--repo-url\"\r\n      - \"{{{attributes.web_url}}}\"\r\n      # Apply all available rules\r\n      - \"--config-path\"\r\n      - \"/home/config_all.toml\"\r\n      # Redact secrets from log messages and leaks\r\n      - \"--redact\"\r\n      # Only scan commits since the last 24h\r\n      - \"--commit-since-duration\"\r\n      - \"24h\"\r\n      # Provide an access token from ENV Vars defined via secret\r\n      - \"--access-token\"\r\n      - \"$(GITHUB_TOKEN)\"\r\n    env:\r\n      - name: GITHUB_TOKEN\r\n        valueFrom:\r\n          secretKeyRef:\r\n            name: github-access-token\r\n            key: token\r\n```\r\n\r\n**Describe alternatives you've considered**\r\n\u003c!-- A clear and concise description of any alternative solutions or features you've considered. --\u003e\r\nnone\r\n\r\n**Additional context**\r\n\u003c!-- Add any other context or screenshots about the feature request here. --\u003e\r\nnone","author":{"url":"https://github.com/rfelber","@type":"Person","name":"rfelber"},"datePublished":"2021-03-09T10:43:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/320/secureCodeBox/issues/320"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:92264905-b50a-466b-6730-cd4f3362b20e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA9AC:824BB:536413:6DA8C6:69765960
html-safe-noncecd06919a385f05d160da1d145d2ccfdc2e3782119baf4b3ad80919e153e8fd74
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOUFDOjgyNEJCOjUzNjQxMzo2REE4QzY6Njk3NjU5NjAiLCJ2aXNpdG9yX2lkIjoiODUzMDkyNTgxOTA0NjI4NzcxMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacb3d6057592c8217d591d3dc102e7bc874e80c5e5e0436cdeae3cd70399f6018f
hovercard-subject-tagissue:825709375
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/secureCodeBox/secureCodeBox/320/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6e100670fd6d5fe5e2ff35534a92f36d4a28b462741848ff06633ea1ba2a5345/secureCodeBox/secureCodeBox/issues/320
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6e100670fd6d5fe5e2ff35534a92f36d4a28b462741848ff06633ea1ba2a5345/secureCodeBox/secureCodeBox/issues/320
og:image:altIs your feature request related to a problem? Please describe. As secureCodeBox user i am heavily using the git-repo-scanner in combination with the gitleaks scanner via cascadingRules. When scanni...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamerfelber
hostnamegithub.com
expected-hostnamegithub.com
None032152924a283b83384255d9489e7b93b54ba01da8d380b05ecd3953b3212411
turbo-cache-controlno-preview
go-importgithub.com/secureCodeBox/secureCodeBox git https://github.com/secureCodeBox/secureCodeBox.git
octolytics-dimension-user_id34573705
octolytics-dimension-user_loginsecureCodeBox
octolytics-dimension-repository_id80711933
octolytics-dimension-repository_nwosecureCodeBox/secureCodeBox
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id80711933
octolytics-dimension-repository_network_root_nwosecureCodeBox/secureCodeBox
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5b577f6be6482e336e3c30e8daefa30144947b17
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/secureCodeBox/secureCodeBox/issues/320#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FsecureCodeBox%2FsecureCodeBox%2Fissues%2F320
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FsecureCodeBox%2FsecureCodeBox%2Fissues%2F320
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=secureCodeBox%2FsecureCodeBox
Reloadhttps://github.com/secureCodeBox/secureCodeBox/issues/320
Reloadhttps://github.com/secureCodeBox/secureCodeBox/issues/320
Reloadhttps://github.com/secureCodeBox/secureCodeBox/issues/320
secureCodeBox https://github.com/secureCodeBox
secureCodeBoxhttps://github.com/secureCodeBox/secureCodeBox
Notifications https://github.com/login?return_to=%2FsecureCodeBox%2FsecureCodeBox
Fork 175 https://github.com/login?return_to=%2FsecureCodeBox%2FsecureCodeBox
Star 941 https://github.com/login?return_to=%2FsecureCodeBox%2FsecureCodeBox
Code https://github.com/secureCodeBox/secureCodeBox
Issues 72 https://github.com/secureCodeBox/secureCodeBox/issues
Pull requests 3 https://github.com/secureCodeBox/secureCodeBox/pulls
Discussions https://github.com/secureCodeBox/secureCodeBox/discussions
Actions https://github.com/secureCodeBox/secureCodeBox/actions
Projects 1 https://github.com/secureCodeBox/secureCodeBox/projects
Security 1 https://github.com/secureCodeBox/secureCodeBox/security
Insights https://github.com/secureCodeBox/secureCodeBox/pulse
Code https://github.com/secureCodeBox/secureCodeBox
Issues https://github.com/secureCodeBox/secureCodeBox/issues
Pull requests https://github.com/secureCodeBox/secureCodeBox/pulls
Discussions https://github.com/secureCodeBox/secureCodeBox/discussions
Actions https://github.com/secureCodeBox/secureCodeBox/actions
Projects https://github.com/secureCodeBox/secureCodeBox/projects
Security https://github.com/secureCodeBox/secureCodeBox/security
Insights https://github.com/secureCodeBox/secureCodeBox/pulse
New issuehttps://github.com/login?return_to=https://github.com/secureCodeBox/secureCodeBox/issues/320
New issuehttps://github.com/login?return_to=https://github.com/secureCodeBox/secureCodeBox/issues/320
#327https://github.com/secureCodeBox/secureCodeBox/pull/327
⚙️ Extend the git-repo-scanner with an activity filterhttps://github.com/secureCodeBox/secureCodeBox/issues/320#top
#327https://github.com/secureCodeBox/secureCodeBox/pull/327
https://github.com/rfelber
enhancementNew feature or requesthttps://github.com/secureCodeBox/secureCodeBox/issues?q=state%3Aopen%20label%3A%22enhancement%22
pythonIssues based on python implementationshttps://github.com/secureCodeBox/secureCodeBox/issues?q=state%3Aopen%20label%3A%22python%22
scannerImplement or update a security scannerhttps://github.com/secureCodeBox/secureCodeBox/issues?q=state%3Aopen%20label%3A%22scanner%22
v2.6.0https://github.com/secureCodeBox/secureCodeBox/milestone/5
https://github.com/rfelber
https://github.com/rfelber
rfelberhttps://github.com/rfelber
on Mar 9, 2021https://github.com/secureCodeBox/secureCodeBox/issues/320#issue-825709375
gitleaks/gitleaks#498https://github.com/gitleaks/gitleaks/pull/498
https://python-gitlab.readthedocs.io/en/stable/gl_objects/projects.html#exampleshttps://python-gitlab.readthedocs.io/en/stable/gl_objects/projects.html#examples
secureCodeBox/scanners/git-repo-scanner/scanner/git_repo_scanner.pyhttps://github.com/secureCodeBox/secureCodeBox/blob/fab01bdff212dde428e4dc9eb6eae4f34e211a98/scanners/git-repo-scanner/scanner/git_repo_scanner.py#L131
fab01bdhttps://github.com/secureCodeBox/secureCodeBox/commit/fab01bdff212dde428e4dc9eb6eae4f34e211a98
https://pygithub.readthedocs.io/en/latest/github_objects/Organization.html#github.Organization.Organization.get_reposhttps://pygithub.readthedocs.io/en/latest/github_objects/Organization.html#github.Organization.Organization.get_repos
secureCodeBox/scanners/git-repo-scanner/scanner/git_repo_scanner.pyhttps://github.com/secureCodeBox/secureCodeBox/blob/fab01bdff212dde428e4dc9eb6eae4f34e211a98/scanners/git-repo-scanner/scanner/git_repo_scanner.py#L181
fab01bdhttps://github.com/secureCodeBox/secureCodeBox/commit/fab01bdff212dde428e4dc9eb6eae4f34e211a98
rfelberhttps://github.com/rfelber
enhancementNew feature or requesthttps://github.com/secureCodeBox/secureCodeBox/issues?q=state%3Aopen%20label%3A%22enhancement%22
pythonIssues based on python implementationshttps://github.com/secureCodeBox/secureCodeBox/issues?q=state%3Aopen%20label%3A%22python%22
scannerImplement or update a security scannerhttps://github.com/secureCodeBox/secureCodeBox/issues?q=state%3Aopen%20label%3A%22scanner%22
v2.6.0https://github.com/secureCodeBox/secureCodeBox/milestone/5
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.