gh-ThreatAware is a GitHub application developed from the ground up, designed to be installed across GitHub organizations. It efficiently tracks and analyzes pull requests (PRs) within the organization's repositories.
gh-ThreatAware utilizes webhooks to monitor and track PR events. Upon receiving a PR event, it collects essential context surrounding the PR, including details such as the PR description, file changes, commit diffs, user information, and other relevant parameters.
The application employs OpenAI's GPT-3.5 Turbo models to evaluate the security risks introduced by each PR. Leveraging these models, it measures and assigns a risk score based on the analysis performed.
If the PR's risk level exceeds a predefined threshold, gh-ThreatAware takes action by adding reviewers from the security team to ensure comprehensive evaluation and mitigation of potential security risks.
![290974888-366968c8-15ac-48f2-98e8-0c451c77354b](https://private-user-images.githubusercontent.com/42084500/290975156-78d25187-83c7-4b83-ad37-7c9fed9d567b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwOTQzMDEsIm5iZiI6MTcyNDA5NDAwMSwicGF0aCI6Ii80MjA4NDUwMC8yOTA5NzUxNTYtNzhkMjUxODctODNjNy00YjgzLWFkMzctN2M5ZmVkOWQ1NjdiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDE5MDAwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWViYzk3MGEzN2UyOTBlMjkzMTlkN2MyMTQ0YWQ1OGE5YzUxMTJlM2E4N2U4YWFhNzI5Zjk5ODc5OGJkMzMzY2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.K8Q-sUm3I1pN9Rd-vDhzjKMxMvH-tN7sw86GjKNtDGA)
![290974953-4073d839-d9e6-4185-89d8-44f22d0e4841](https://private-user-images.githubusercontent.com/42084500/290975169-a5261d44-f384-4acf-8280-a4d23715becc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwOTQzMDEsIm5iZiI6MTcyNDA5NDAwMSwicGF0aCI6Ii80MjA4NDUwMC8yOTA5NzUxNjktYTUyNjFkNDQtZjM4NC00YWNmLTgyODAtYTRkMjM3MTViZWNjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDE5MDAwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgwODM4ZjVmYmQyNzEzZDU1MTUzNjE2MjUxMTk0YjhjNThmMzBlZjg2ZTNjMzQyZTQ4NTI3NzQzNTBlZjFhODYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.UC1oNEmehzYJ4C-tlEmOgOvo2yPc4EdFmDOfb07cLlk)
![290975013-79d7be96-a5fe-427d-9f4b-3392be8a8936](https://private-user-images.githubusercontent.com/42084500/290975180-2881d670-a05b-4e88-b8d1-c7f5d9dd85e1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwOTQzMDEsIm5iZiI6MTcyNDA5NDAwMSwicGF0aCI6Ii80MjA4NDUwMC8yOTA5NzUxODAtMjg4MWQ2NzAtYTA1Yi00ZTg4LWI4ZDEtYzdmNWQ5ZGQ4NWUxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDE5MDAwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI5NDcwOWI4YzI3N2NkOTIyNjJjMDhkYTg5NTRlZTA3MDEwY2FmNWY4MGYyMzBmZTUwZWZkMDY5NTgwYmM0OTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.JZsuM7_HfwxQ9SMtFc1e451V6idPJ8p9Kjy7uh5zleQ)
To install gh-ThreatAware within your GitHub organization, follow these steps:
- Clone the Repository: Clone the gh-ThreatAware repository to a local environment or server that will host the application.
- Configure Webhooks: Set up webhooks in your GitHub organization's repositories to trigger events that communicate with the gh-ThreatAware application. Configure these webhooks to point to the application's designated endpoint.
- Configure Permissions: Ensure that gh-ThreatAware has appropriate permissions to access PR details and assign reviewers. Review and adjust permissions as needed within your GitHub organization settings.
Customize the risk threshold and reviewer assignment logic according to your organization's security policies and requirements. These configurations are adjustable within the designated configuration files provided with the application.