Skip to content

Commit 41d3a71

Browse files
committed
Updated documentation and CHANGELOG for v1.0.15 - Ready to launch!
1 parent 2253c64 commit 41d3a71

File tree

7 files changed

+133
-68
lines changed

7 files changed

+133
-68
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## Release v1.0.15 (September 20th, 2024)
4+
5+
* Added searching for similar repository names in GitHub, Warning if another repository with the same name and better reputation is found.
6+
* Added commit time analysis, grouping commit hours per contributor and calculating the percentage of commits at each hour. This feature provides insights into contributors' activity patterns and helps identify potential anomalies.
7+
* Added new Workflows X-Ray module which contains all Workflow-related logic. Moved in some of the logic that was under the Repository x-Ray.
8+
* Added counts of Workflow Runs to identify when Workflow Runs were DELETED, which may have been the result of an attacker erasing their tracks, or legitimate cleanup.
9+
* Added a series of basic Workflow security checks which might be an indicator of a vulnerable Workflow.
10+
* Added to the Workflows X-Ray the ability to print, for each workflow, how many times it was executed by non-contributors as well as contributors.
11+
* Added to the Workflows X-Ray the ability to parse and print any secret names used in a Workflow.
12+
* Added a display of Progress % for time consuming queries and a time estimate in seconds-left prior to resuming execution.
13+
* Added ability to SKIP heavy querying live by handling CTRL+C, which means we've also removed any caps or limits recently introduced.
14+
* Fixed parsing of dict-formatted results coming from the REST API so that we keep the last key and not the second one.
15+
* Fixed a few exceptions which arise by hitting CTRL+C and skipping or breaking API calls
16+
317
## Release v1.0.14 (September 1st, 2024)
418

519
* Added a new check on workflow runs for accounts which are NOT contributors, presenting a WARNING on screen. This could help identify hack attempts via Workflow runs.

docs/code_structure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ Finally, last but not least important, the X-Rays under the xrays directory:
2323

2424
* `contributors_xray.py` - Handles all Contributor-related data and decides what to log.
2525
* `repository_xray.py` - Handles all Repository-related data and decides what to log.
26+
* `workflows_xray.py` - Handles all Workflow-related analysis and decides what to log.
2627
* `associations_xray.py` - Analyzes and reports all associations carried from prior X-Ray modules.
27-
Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Awesome Features 💫
1+
# Features 💫
22

33
Because of the amount of data it analyzes, `gitxray` can be a bit overwhelming at first. Let's look at a few examples of potential awesome findings which can better explain why you're here and why `gitxray` is awesome ♥.
44

@@ -35,6 +35,10 @@ gitxray -r https://github.com/SampleOrg/SampleRepo -v -f user_input
3535

3636
Associations MUST NOT be directly and blindly used to report fake or shadow accounts. They are automatic observations from a piece of well-intended code. Do NOT treat association results as findings directly. We must protect open-source projects by first and foremost respecting open-source developers. Ensure that any actions taken are thoughtful and based on solid evidence, not just automated associations.
3737

38+
## Duplicate Repository Name Check 🛡
39+
40+
`gitxray` will always check and detect duplicate repository names across different organizations and user profiles. This helps identify potential cloned or fake repositories. `gitxray` compares your target repository against others with the same name and the highest star count, ensuring you are engaging with the most popular (and likely legitimate) one.
41+
3842
## Forensics: What happened on the day of an incident? 🔍
3943

4044
Because `gitxray` collects data from multiple sources of activity including Commits, Comments, Workflow Runs, Issues, Deployments and more; and because Verbose mode in `gitxray` shows activity in a standarized YYYY-MM-DD format, it becomes possible to use Filtering in order to place focus on specific activity happening at a specific point in time.
@@ -46,6 +50,10 @@ gitxray -r https://github.com/SampleOrg/SampleRepo -v -f 2024-08
4650
gitxray -r https://github.com/SampleOrg/SampleRepo -v -f 2024-09-01
4751
```
4852

53+
## Analyzing Commit Hours to Identify Anomalies 🕛
54+
55+
`gitxray` provides a summary of contributor commit hours, allowing you to profile contributor activity and detect potential anomalies. This feature helps you understand typical patterns and flag unusual behavior for further investigation.
56+
4957
## Untrustworthy Repositories and Activity 🏴
5058

5159
`gitxray` can be used to protect yourself, your team and your customers from fake Repositories and suspicious activity. For example, by analyzing commit dates and comparing them to the account creation timestamp of contributors, `gitxray` can flag inconsistencies that may indicate:
@@ -60,6 +68,22 @@ Although we always recommend running a full unfiltered verbose X-Ray, it is poss
6068
gitxray -o https://github.com/SampleOrg -v -f warning
6169
```
6270

71+
## X-Raying GitHub Workflows ⚙
72+
73+
The Workflows X-Ray module is executed upon identifying existing Workflows or Actions. `gitxray` provides in-depth analysis and monitoring of GitHub workflows, including:
74+
75+
* Execution Analysis: Provides detailed insights into workflow execution, showing how many times each workflow was executed by contributors and non-contributors. This allows for better understanding of usage patterns and detection of unauthorized or unexpected activity.
76+
77+
* Detection of deleted runs: This feature helps identify whether workflow runs have been deleted, potentially indicating an attempt to erase traces of malicious activity or legitimate maintenance actions.
78+
79+
* Security Checks for Workflows: Performs a series of basic security checks on workflows to identify uses of Secrets, Self-hosted Runners and Potentially dangerous triggers (eg pull_request_target) that could pose a security risk.
80+
81+
### Disclaimer: Gitxray is NOT a complete Workflow Security Scanner
82+
83+
For more information on tools which are specialized in scanning Workflows refer to our [Vulnerable Workflows section](vulnerable_workflows.md).
84+
85+
86+
6387
## The PR Rejection Awards 🏆
6488

6589
Another `gitxray` feature is the ability to list a TOP 3 of GitHub accounts that have tried to submit Pull Requests to the repository, which ended up closed AND NOT merged. In certain emotional scenarios, this could be paraphrased as _rejected PRs_. Kidding aside, in some cases, this could lead to identifying Contributors who have repeatedly failed at merging a very evidently unaligned piece of code to a branch (I know, it sounds unlikely for an account to try and merge backdoor.py repeatedly... but is it?).
@@ -75,7 +99,7 @@ or targetting a specific Repository with (_Verbose is always optional_):
7599
``` bash
76100
gitxray -r https://github.com/SampleOrg/SampleRepo -v -f contributors
77101
```
78-
## Fake Stars, Private repos gone Public and more 🙈
102+
## Fake Starring, Private repos gone Public and more 🙈
79103

80104
GitHub shares publicly [up to 90 days of past Events](https://docs.github.com/en/rest/activity/events?apiVersion=2022-11-28) for any User account, which include actions such as Repository creation, Watching, Committing, Pull Requesting, and more. `gitxray` summarizes these events for you and prints them out under a `90d_events` category in the results included for each Contributor, summarized in order to reduce the amount of data listed by default.
81105

@@ -98,4 +122,55 @@ And you could then enable _Verbose_ (or before, you decide) and target a specifi
98122
```
99123
gitxray -r https://github.com/SampleOrg/SampleRepo -v -c some_user
100124
```
125+
## Lots of e-mail addresses 📧 and Profiling data 👤
126+
127+
`gitxray` will report for each Contributor, an `emails` category listing all unique e-mail address collected from parsing:
128+
129+
* The User's profile
130+
* Each commit made by the User
131+
* PGP Primary Keys and PGP SubKeys
132+
133+
Additionally, Personal Information (e.g. social networks) voluntarily made Public by the User is extracted from multiple sources including PGP Key BLOBs and reported under a `personal` category.
134+
135+
Finally, the `profiling` category tends to display information related to the account itself (e.g. creation date, last updated, and more.)
136+
137+
You may focus specifically on `emails`, `personal`, and `profiling` fields with (Verbose is optional):
138+
```py
139+
gitxray -o https://github.com/SampleOrg -v -f emails,personal,profiling
140+
```
141+
or, for a specific repository, with:
142+
``` py
143+
gitxray -r https://github.com/SampleOrg/SampleRepo -v -f emails,personal,profiling
144+
```
145+
146+
## Looking out for malicious Releases and Assets 👁
147+
148+
It is possible for Threat Actors to compromise credentials of a Repository Maintainer in order to deploy malware by silently updating released Assets (the typical package you would download when a Release includes downloadable Assets); which is why `gitxray` looks at all Repository Releases and informs of:
149+
150+
* Assets that were **updated** at least a day **AFTER** their release, which might lead to suggest they've been infected and/or tampered with. Or it could just be a maintainer fixing an asset without wanting to create a new release.
151+
152+
* Users who have historically created releases and/or uploaded assets, as well as the % vs. the total amount of releases or assets uploaded in the repository; which may allow you to flag potential suspicious activity. For example, you might notice an account which never created Releases before now uploading assets.
153+
154+
155+
All of this information is included by `gitxray` in a `releases` category, which means you can focus on those results (if any exist) with:
156+
157+
``` bash
158+
gitxray -o https://github.com/SampleOrg -f releases
159+
```
160+
161+
## Anonymous contributors 👁
162+
163+
As stated in [GitHub documentation](https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-repository-contributors), only the first 500 author email addresses in a Repository will link to actual GitHub users or accounts. The rest will appear as "anonymous" contributors without associated GitHub information.
164+
165+
Additionally, when an author's email address in a commit is not associated with a GitHub account, the User will also be considered Anonymous.
166+
167+
Lucky for us, `gitxray` also includes within its output the entire list of Anonymous contributors received from GitHub. The list is first processed to combine all variations of Names used by the author for a same e-mail, which means the list can also be pretty useful when, for example, executing OSINT.
168+
169+
To filter for anonymous contributors, you may use:
170+
``` bash
171+
gitxray -o https://github.com/SampleOrg -f anonymous
172+
```
173+
174+
## And so much more.
101175

176+
We've covered a large amount of use-cases for `gitxray`, yet we're nowhere finished. Start X-Raying today your favorite Organizations and Repositories and discover more ways of connecting dots.

docs/index.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@ The Octocat getting X-Rayed | [![Build Workflows](https://github.com/kulkansecu
77
<div style="clear: both;"></div>
88

99
# What is it for?
10-
* [Finding sensitive information in contributor profiles](/awesome_features/#unintended-disclosures-in-contributor-profiles) disclosed by accident within, for example, Armored PGP Keys, or Key Names.
11-
* Identifying threat actors in a Repository. [You may spot co-owned or shared accounts](/awesome_features/#spotting-shared-co-owned-or-fake-contributors), as well as inspect public events to [spot fake Stargazers](/awesome_features/#fake-stars-private-repos-gone-public-and-more).
12-
* Collecting [email addresses and analyzing contributor accounts](/more_features/#lots-of-e-mail-addresses-and-profiling-data) belonging to GitHub organizations and repositories.
13-
* Identifying fake or infected Repositories. It can [detect tampered commit dates](/awesome_features/#untrustworthy-repositories-and-activity) as well as, for example, [Release assets updated post-release](/more_features/#looking-out-for-malicious-releases-and-assets).
14-
* Forensics use-cases, such as [finding out what else happened on the day of an Incident](/awesome_features/#forensics-what-happened-on-the-day-of-an-incident).
10+
* Identifying threat actors in a Repository. [You may spot co-owned or shared accounts](/features/#spotting-shared-co-owned-or-fake-contributors), as well as inspect public events to [spot fake Stargazers](/features/#fake-stars-private-repos-gone-public-and-more).
11+
* Forensics use-cases, such as [finding out what else happened on the day of an Incident](/features/#forensics-what-happened-on-the-day-of-an-incident).
12+
* [Finding sensitive information in contributor profiles](/features/#unintended-disclosures-in-contributor-profiles) disclosed by accident within, for example, Armored PGP Keys, or Key Names.
13+
* Collecting [email addresses and analyzing contributor accounts](/features/#lots-of-e-mail-addresses-and-profiling-data) belonging to GitHub organizations and repositories.
14+
* Identifying fake or infected Repositories. It can [detect tampered commit dates](/features/#untrustworthy-repositories-and-activity) as well as, for example, [Release assets updated post-release](/features/#looking-out-for-malicious-releases-and-assets).
1515
* And so. much. more.
1616

1717
# Getting started
1818
* [Installing Gitxray](installing.md)
19-
* [Awesome Features](awesome_features.md) &#128171;
20-
* [More Features](more_features.md) &#129470;
19+
* [Features](features.md) &#128171;
2120

2221
## Rate Limits and the GitHub API
2322

docs/more_features.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

docs/vulnerable_workflows.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Vulnerable Workflows
2+
3+
You may have landed here because Git X-Ray suggested that you further inspect a specific Workflow in a repository that you were X-Raying, or because of some other reason.
4+
5+
Either way, here's a list of specialized software and documentation on how to proceed with analyzing the security of your workflow.
6+
7+
# Tools for Workflow analysis
8+
9+
* [https://github.com/synacktiv/octoscan](https://github.com/synacktiv/octoscan) - A SAST tool for GitHub Workflows.
10+
11+
* [https://github.com/AdnaneKhan/Gato-X](https://github.com/AdnaneKhan/Gato-X) - Excellent for identifying at scale vulnerable Workflows.
12+
13+
* [https://semgrep.dev/p/github-actions](https://semgrep.dev/p/github-actions) - Semgrep rules for GitHub Workflows.
14+
15+
* [https://github.com/tindersec/gh-workflow-auditor](https://github.com/tindersec/gh-workflow-auditor) - A script by Tinder Security which analyzes multiple aspects of a Workflow.
16+
17+
# Articles about Github Workflows and Security
18+
19+
## Official by GitHub
20+
21+
* [https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/](https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/)
22+
* [https://securitylab.github.com/resources/github-actions-untrusted-input/](https://securitylab.github.com/resources/github-actions-untrusted-input/)
23+
* [https://securitylab.github.com/resources/github-actions-building-blocks/](https://securitylab.github.com/resources/github-actions-building-blocks/)
24+
* [https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions](https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions)
25+
26+
## By independent researchers and organizations
27+
28+
* [https://medium.com/tinder/exploiting-github-actions-on-open-source-projects-5d93936d189f](https://medium.com/tinder/exploiting-github-actions-on-open-source-projects-5d93936d189f)
29+
30+
# Videos
31+
32+
* [https://www.youtube.com/watch?v=Ers-LcA7Nmc](https://www.youtube.com/watch?v=Ers-LcA7Nmc) - A great video and slides by Rob Bos on GitHub Actions with security in mind

mkdocs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ theme:
1010

1111
nav:
1212
- 'installing.md'
13-
- 'awesome_features.md'
14-
- 'more_features.md'
13+
- 'features.md'
14+
- 'vulnerable_workflows.md'
15+
- 'code_structure.md'
1516

1617
markdown_extensions:
1718
- toc:

0 commit comments

Comments
 (0)