Skip to content

Conversation

@ssherar
Copy link
Collaborator

@ssherar ssherar commented Apr 10, 2025

  • Validates configuration coming in from the agent on the wire
  • Uses the go-github library as the abstraction to query the Github API
  • Pulls information down about the organization to then execute the example policy against and fire back to the agent and the API server

ssherar added 5 commits April 9, 2025 16:25
Logic is stored within a validator map that can be changed. At some point
we should add some more complex structures within it to check if it is required
on the wire and if we can add sensible defaults. e.g. for api_url, default to
https://api.github.com/

References BCH-868
Firstly, opted against re-inventing the wheel by querying the APIs manually, as going forward, it will help with rate limiting and other queries we can pass into the functions

A unit test has also been created to simulate the output from the /org/{org} endpoint so we can replicate items uniformly. In the future, proper fixtures should be put in place so we can test unauthenticated responses from GH which will fail a lot of the audit rules due to the sensitive nature

Finally, A single test rego policy is in place just to aide with testing. Future policies will be created in an isolated repository

References BCH-868
- add context about the plugin
- Update pre-reqs
- describe expected configuration

References BCH-868
@ssherar ssherar requested a review from chris-cmsoft April 10, 2025 15:13
@chris-cmsoft chris-cmsoft merged commit c755f16 into main Apr 13, 2025
1 check passed
@chris-cmsoft chris-cmsoft deleted the feature/init branch April 13, 2025 08:41
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.

3 participants