зеркало из
1
0
Форкнуть 0
This commit is contained in:
Dan Hoerst 2022-05-24 14:53:49 -04:00
Родитель 279a0ccfbc
Коммит 39458ffcee
4 изменённых файлов: 44 добавлений и 13 удалений

Просмотреть файл

@ -9,3 +9,14 @@ entitlements/strictly_audited/admin.txt:
days: 182 days: 182
strategy: manager strategy: manager
title: Admin access title: Admin access
entitlements/strictly_audited/user.txt:
sha256sum: ad4b73042433ca4bd475664fff6480de9225284173e18c9d661cb1158d164e0d
format:
- txt
reviews:
enabled: true
labels:
- Periodic Audit
days: 182
strategy: manager
title: User access

Просмотреть файл

@ -0,0 +1 @@
username = danhoerst

Просмотреть файл

@ -0,0 +1,32 @@
#!/bin/bash
if [ -z $GITHUB_HEAD_REF ];
then
GITHUB_HEAD_REF=$(git rev-parse --abbrev-ref HEAD)
fi
# Get the PR diff
diff=$(git diff origin/main origin/${GITHUB_HEAD_REF})
audit_files=()
# See if the PR diff is related to entitlements configs
while IFS='' read -r FILES; do
for line in "${FILES[@]}"; do
if [[ $line = "+++ "* ]] || [[ $line = "--- "* ]]
then
IFS=" " read add_remove file_name <<< $line
echo $file_name
# Grab the manager from the Org Chart for each affected user
audited_files=$(yq 'keys' "audit.yaml")
for i in "${audited_files[@]}"
do
:
audited_file=$(echo ${i} | sed 's/- //')
if [[ $file_name == *"$audited_file"* ]];
then
echo "YES"
fi
done
IFS=''
fi
done
done <<< "$diff"

Просмотреть файл

@ -1,13 +0,0 @@
#!/bin/bash
if [ -z $GITHUB_HEAD_REF ];
then
GITHUB_HEAD_REF=$(git rev-parse --abbrev-ref HEAD)
fi
# Get the PR diff
diff=$(git diff origin/main origin/${GITHUB_HEAD_REF})
# See if the PR diff is related to entitlements configs
while IFS='' read -r FILES; do
echo "${FILES[@]}"
done <<< "$diff"