This repository contains a Go application that consumes the GitHub GraphQL API and posts a Slack message containing details of GitHub users with two-factor authentication disabled. Both enterprise members and outside collaborators are included.
Use make
to compile binaries for macOS and Linux.
The environment variables below are required:
EXCLUDED_GITHUB_LOGINS # List of GitHub logins with two-factor authentication disabled to exclude from reporting
GITHUB_ENTERPRISE_NAME # Name of the GitHub Enterprise
GITHUB_TOKEN # GitHub personal access token
SLACK_ALERTS_CHANNEL # Name of the Slack channel to post alerts to
SLACK_WEBHOOK # Used for accessing the Slack Incoming Webhooks API
The GitHub personal access token for using this application requires the following scopes:
admin:enterprise
read:user
user:email
Copyright (C) 2021 Crown Copyright (Office for National Statistics)