Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit 8c777ee

Browse files
committed
Remove obsolete Okta and AWS evidence collection scripts and workflows
1 parent b62ced7 commit 8c777ee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+412
-744
lines changed

.github/prep.sh

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## ENVIRONMENT ##
2+
3+
#!/bin/bash
4+
5+
# Error tracking and logging function
6+
log_error() {
7+
echo "Error: $1" >&2
8+
}
9+
10+
# INSTALL JQ
11+
mkdir -p "$HOME/bin"
12+
curl -L https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -o "$HOME/bin/jq" > /dev/null 2>&1
13+
if [ $? -ne 0 ]; then
14+
log_error "Failed to download jq"
15+
exit 1
16+
fi
17+
chmod +x "$HOME/bin/jq"
18+
sudo ln -sf "$HOME/bin/jq" /usr/local/bin/jq
19+
if [ $? -ne 0 ]; then
20+
log_error "Failed to set up jq"
21+
exit 1
22+
fi
23+
24+
# INSTALL PYTHON
25+
sudo apt-get update -q && sudo apt-get install -y python3-pip python3-wheel > /dev/null 2>&1
26+
if [ $? -ne 0 ]; then
27+
log_error "Failed to install Python and pip"
28+
exit 1
29+
fi
30+
31+
# INSTALL PIP DEPENDENCIES
32+
sudo pip3 install --upgrade pytenable click arrow requests > /dev/null 2>&1
33+
if [ $? -ne 0 ]; then
34+
log_error "Failed to install pip dependencies"
35+
exit 1
36+
fi
37+
38+
# SETUP ENVIRONMENT VARIABLES
39+
YEAR=$(date +'%Y')
40+
EVIDENCE_DATE=$(date -d "last sunday +1 day" +'%d %B')
41+
42+
echo "YEAR=$YEAR" >> "$GITHUB_ENV"
43+
echo "EVIDENCE_DATE=$EVIDENCE_DATE" >> "$GITHUB_ENV"

.github/scripts/prep.sh

-23
This file was deleted.

.github/workflows/aws-evidence.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: AWS Evidence Collection
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
fetch_and_save_scans:
6+
runs-on: ubuntu-latest
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
env:
11+
CI_COMMIT_MESSAGE: AWS Evidence
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
with:
16+
ref: ${{ github.head_ref }}
17+
18+
- name: Environment Variables
19+
uses: .github/variables-federal.yml@main
20+
21+
- name: Environment Variables
22+
uses: .github/variables-commercial.yml@main
23+
24+
- name: Create Tenable evidence artifacts directory
25+
run: mkdir -p evidence-artifacts/federal/
26+
27+
- name: Create Tenable evidence artifacts directory
28+
run: mkdir -p evidence-artifacts/commercial/
29+
30+
- name: Run AWS Evidence Collection Scripts
31+
working-directory: src/collection/aws
32+
run: |
33+
python |
34+
python
35+
36+
- name: Commit & Push
37+
uses: ./.github/workflows/actions/commit-and-push.yml
38+
39+
- uses: stefanzweifel/git-auto-commit-action@v5
40+
with:
41+
commit_message: ${{ env.CI_COMMIT_MESSAGE }}
42+
43+
44+
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Fetch Merged PRs and Save to JSON
2+
3+
on:
4+
workflow_dispatch: # Allows manual trigger
5+
#schedule:
6+
# - cron: '0 0 * * *' # Runs daily at midnight (UTC)
7+
8+
jobs:
9+
fetch-merged-prs:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
# Checkout the repository
14+
- name: Checkout Repository
15+
uses: actions/checkout@v3
16+
17+
# Authenticate with GitHub CLI
18+
- name: Authenticate with GitHub CLI
19+
env:
20+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
run: |
22+
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
23+
24+
# Fetch merged PRs using gh CLI
25+
- name: Fetch Merged Pull Requests
26+
env:
27+
REPO_OWNER: CirrusMD
28+
REPO_NAME: cirrusmd-web-app
29+
run: |
30+
gh api repos/${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}/pulls \
31+
--method GET \
32+
--jq '.[] | select(.state == "closed" and .merged_at != null and (.merged_at | fromdateiso8601) >= (now - 30*86400)) | {number, title, merged_at, user: .user.login, merged_by: .merged_by.login, url: .html_url, additions, deletions, commits, changed_files}' \
33+
> merged_prs.json
34+
35+
# Commit and push the output JSON file
36+
- name: Commit and Push JSON
37+
env:
38+
COMMITTER_NAME: GitHub Action
39+
COMMITTER_EMAIL: [email protected]
40+
run: |
41+
git config --global user.name "${{ env.COMMITTER_NAME }}"
42+
git config --global user.email "${{ env.COMMITTER_EMAIL }}"
43+
git add merged_prs.json
44+
git commit -m "Add merged PRs report for the last 30 days"
45+
git push origin HEAD
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Fetch Completed Jira Tickets Monthly
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
fetch_completed_tickets:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout code
9+
uses: actions/checkout@v3
10+
- name: Environment Variables
11+
uses: .github/variables-commercial.yml@main
12+
13+
- name: Run Jira ticket collection script
14+
# env:
15+
# JIRA_DOMAIN: ${{ secrets.JIRA_DOMAIN }} | JIRA_EMAIL: ${{ secrets.JIRA_EMAIL }} | API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
16+
run: |
17+
python src/collection/jira/completed-jira-tickets.py
18+
19+
- name: Upload ticket JSON files
20+
uses: actions/upload-artifact@v3
21+
with:
22+
name: completed-tickets
23+
path: completed_tickets/**/*.json
24+
- name: Commit & Push
25+
uses: ./.github/workflows/actions/commit-and-push.yml

.github/workflows/evidence-okta.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Running Okta Evidence
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
run-okta:
6+
runs-on: ubuntu-latest
7+
env:
8+
OKTA_DOMAIN: ${{ secrets.OKTA_DOMAIN }}
9+
API_TOKEN: ${{ secrets.OKTA_API_TOKEN }}
10+
CI_COMMIT_MESSAGE: Okta Evidence
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v3
14+
- name: Environment Variables
15+
uses: .github/variables-commercial.yml@main
16+
17+
- name: Run check-authentication-settings
18+
run: python src/evidence-collection/okta/check_authentication_settings.py
19+
- name: Run check-deactivated-users
20+
run: python src/evidence-collection/okta/check_deactivated_users.py
21+
- name: Run check-mfa-enrollments
22+
run: python src/evidence-collection/okta/check_mfa_enrollments.py
23+
- name: Run check-password-policies
24+
run: python src/evidence-collection/okta/check_password_policies.py
25+
- name: Run check-users-and-groups
26+
run: python src/evidence-collection/okta/check_users_and_groups.py
27+
28+
- name: Commit & Push
29+
uses: ./.github/workflows/actions/commit-and-push.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Run TriNet Employee Script
2+
on:
3+
workflow_dispatch: # Allows manual triggering of the workflow
4+
jobs:
5+
run-trinet-script:
6+
runs-on: ubuntu-latest
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
env:
11+
CI_COMMIT_MESSAGE: 'New Personnel List'
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
- name: Environment Variables
16+
uses: .github/variables-commercial.yml@main
17+
continue-on-error: false
18+
- name: Run TriNet Script
19+
run: |
20+
python src/collection/personnel/current-employees.py
21+
22+
- name: Upload Evidence Artifacts
23+
uses: actions/upload-artifact@v3
24+
with:
25+
name: employee-list-artifacts
26+
path: evidence-artifacts/personnel/employee_list.json
27+
28+
- name: Commit & Push
29+
uses: ./.github/workflows/actions/commit-and-push.yml

.github/workflows/main-beta.yml

-34
This file was deleted.

.github/workflows/main.yml

-16
This file was deleted.

0 commit comments

Comments
 (0)