Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

val → prod #2044

Merged
merged 47 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
8d87bb0
Making QMR Dev Environments Not Publicly Accessible (#2036)
dwhitestratiform Jan 22, 2024
d55e349
Rename existing WAF to fix existing environment build failure (#2037)
dwhitestratiform Jan 23, 2024
e5aeb94
Dev -> Val : VPN restriction (#2038)
BearHanded Jan 23, 2024
690f948
CMDCT-3179: FFY2024 Setup (#2039)
karla-vm Jan 25, 2024
7973e54
fix tealium domain (#2040)
braxex Jan 29, 2024
ea5cb98
test → val (#2043)
braxex Jan 29, 2024
f376264
modify qmr api gateway waf to utilize the enterprise cmcs waf plugin …
dwhitestratiform Feb 1, 2024
b4299eb
CMDCT-3288: Fix Tealium Environment Variable (#2047)
karla-vm Feb 12, 2024
1c25bbb
CMDCT-3291: Update References from FFY2023 to FFY2024 (#2051)
karla-vm Feb 13, 2024
8639a17
OPM - Describe Rate Validation (#2050)
ailZhou Feb 14, 2024
fb10f3f
Measure Eligible Population Validation (#2054)
ailZhou Feb 14, 2024
eb3562e
CMDCT-3295: Landing Page Content Update (#2053)
karla-vm Feb 14, 2024
4052f9d
Fix infrastructure destroy actions (#2046)
berryd Feb 15, 2024
8e21463
CMDCT-3292: Update Home Health SPA IDs (#2052)
karla-vm Feb 15, 2024
45b783c
CMDCT-3288.II: Tealium Fix (#2056)
karla-vm Feb 15, 2024
f5b9520
test → val (#2048)
BearHanded Feb 15, 2024
d8a5725
[QMR Cleanup] Removing types.ts From Each Measures P1 (#2055)
ailZhou Feb 21, 2024
aeee9f9
Remove signup email configuration, unused, revert to default account …
BearHanded Feb 21, 2024
b232fb5
Update CODEOWNERS (#2062)
ailZhou Feb 21, 2024
cf93a18
Upgrade Github Actions checkout actions to version 4 (#2063)
berryd Feb 26, 2024
7563d94
Fix for ipv6 (#2057)
dwhitestratiform Feb 26, 2024
3859718
[Snyk] Upgrade aws-sdk from 2.1326.0 to 2.1531.0 (#2041)
BearHanded Feb 27, 2024
a8b2a28
Attempt to suppress email (#2069)
berryd Feb 27, 2024
e0faf20
Bump es5-ext from 0.10.61 to 0.10.63 in /services/app-api (#2068)
dependabot[bot] Feb 27, 2024
d96f264
Bump es5-ext from 0.10.61 to 0.10.63 (#2067)
dependabot[bot] Feb 27, 2024
4848fab
[Fix] SS-HH Cypress Test (#2070)
ailZhou Feb 28, 2024
9b7c3bf
[Snyk] Security upgrade pac-resolver from 6.0.2 to 7.0.1 (#2049)
BearHanded Feb 28, 2024
9b122b4
Cypress SS-HH Fix 2 (#2073)
ailZhou Feb 28, 2024
3972dc2
CMDCT-3336 - Disable size restriction for pdf (#2071)
BearHanded Feb 28, 2024
38179e1
Refactor: Additional Notes (#2064)
ailZhou Feb 28, 2024
881e657
Purify incoming html body (#2065)
gmrabian Feb 29, 2024
8580454
Bump ip from 1.1.5 to 1.1.9 in /services/ui-src (#2059)
dependabot[bot] Feb 29, 2024
a7ab7c8
Bug: Fix Display Logic for Core Set Text (#2074)
karla-vm Feb 29, 2024
4ab25e5
Master -> Val (#2072)
BearHanded Feb 29, 2024
caac7ac
Fix branch name validation script (#2075)
berryd Feb 29, 2024
8ab45bb
CMDCT-3324: ADD-CH Content Updates (FFY2024) (#2082)
karla-vm Mar 1, 2024
61fb7cf
CIS-CH & CDF-CH: Update text (#2081)
ailZhou Mar 1, 2024
f26141b
cmdct-3332 - OEV-CH text changes (#2086)
britt-mo Mar 4, 2024
8a261cd
cmdct-3331 - text change (#2085)
britt-mo Mar 4, 2024
64dbb71
PPC-CH Content and Rate updates (#2077)
ailZhou Mar 4, 2024
05f1616
Implement DocRaptor for PDF generation (#2079)
benmartin-coforma Mar 4, 2024
065cbb4
Master -> Val (#2088)
BearHanded Mar 4, 2024
fa858bb
CMDCT-3325.I: Content Updates for CCP-CH (#2090)
karla-vm Mar 4, 2024
52573c2
[Fix] Parser to be Recursive (#2076)
ailZhou Mar 5, 2024
5b3d6b7
Remove Unused Email Senders (#2084)
ailZhou Mar 5, 2024
07a60f9
Cypress test to 2024 (#2078)
ailZhou Mar 5, 2024
1ee1973
Main -> Val (#2091)
BearHanded Mar 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ exclude_patterns:
- "src/"
- "services/.sechub/"
- "services/database/"
- "services/stream-functions/"
- "services/ui/"
- "services/ui-src/public/"
- "services/ui-src/src/libs/"
Expand Down
4 changes: 3 additions & 1 deletion .env_example
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ MEASURE_TABLE_NAME=local-measures

# LAUNCHDARKLY
LD_PROJECT_KEY=mdct-qmr
LD_SDK_KEY=sdk-25b0f45f-bb20-4223-aede-32d66b525721 #pragma allowlist secret
LD_SDK_KEY=sdk-25b0f45f-bb20-4223-aede-32d66b525721 #pragma: allowlist secret

docraptorApiKey=YOUR_API_KEY_HERE #pragma: allowlist secret
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Default repo owners
* @BearHanded @braxex @cassandradanger
* @BearHanded @braxex @ailZhou

# Rate label file changes require application owner approval
*rateLabelText.ts @davidkoger
14 changes: 11 additions & 3 deletions .github/branchNameValidation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ set -e

local_branch=${1}

valid_branch="^[a-z][a-z-0-9-]*$"
valid_branch='^[a-z][a-z0-9-]*$'

reserved_words=(
cognito
)

if [[ ! $local_branch =~ $valid_branch ]] && [[ $local_branch -gt 128 ]]; then
join_by() { local IFS='|'; echo "$*"; }

#creates glob match to check for reserved words used in branch names which would trigger failures
glob=$(join_by $(for i in ${reserved_words[@]}; do echo "^$i-|-$i$|-$i-|^$i$"; done;))

if [[ ! $local_branch =~ $valid_branch ]] || [[ $local_branch =~ $glob ]] || [[ ${#local_branch} -gt 64 ]]; then
echo """
------------------------------------------------------------------------------------------------------------------------------
ERROR: Please read below
Expand All @@ -28,4 +36,4 @@ if [[ ! $local_branch =~ $valid_branch ]] && [[ $local_branch -gt 128 ]]; then
exit 1
fi

exit 0
exit 0
2 changes: 2 additions & 0 deletions .github/build_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ set_value() {
if [ ! -z "${!varname}" ]; then
echo "Setting $varname"
echo "${varname}=${!varname}" >> $GITHUB_ENV
echo "${varname}=${!varname}" >> $GITHUB_OUTPUT
fi
}

set_name() {
varname=${1}
echo "BRANCH_SPECIFIC_VARNAME_$varname=${branch_name//-/_}_$varname" >> $GITHUB_ENV
echo "BRANCH_SPECIFIC_VARNAME_$varname=${branch_name//-/_}_$varname" >> $GITHUB_OUTPUT
}

action=${1}
Expand Down
19 changes: 19 additions & 0 deletions .github/setBranchName.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -e

GITHUB_REFNAME="${1}"

[ -z "${GITHUB_REFNAME}" ] && echo "Error setting branch name. No input given." && exit 1

case ${GITHUB_REFNAME} in
$([[ "$GITHUB_REFNAME" =~ ^dependabot/.* ]] && echo ${GITHUB_REFNAME}))
echo ${GITHUB_REFNAME} | md5sum | head -c 10 | sed 's/^/x/'
;;
$([[ "$GITHUB_REFNAME" =~ ^snyk-* ]] && echo ${GITHUB_REFNAME}))
echo ${GITHUB_REFNAME##*-} | head -c 10 | sed 's/^/s/'
;;
*)
echo ${GITHUB_REFNAME}
;;
esac
132 changes: 132 additions & 0 deletions .github/waf-controller.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
#!/usr/bin/env bash

CIRCUIT_BREAKER=10
AWS_RETRY_ERROR=254
AWS_THROTTLING_EXCEPTION=252
#0, 1, 2 are the levels of debug, with 0 being off
DEBUG=1

set -o pipefail -o nounset -u

case ${1} in
append)
OP=append
;;
set)
OP=set
;;
*)
echo "Error: unkown operation"
echo "Usage: ${0} [append|set]" && exit 1
;;
esac

shift
NAME="${1}"
ID="${2}"
shift; shift
RUNNER_CIDRS="${@}"

[[ $DEBUG -ge 1 ]] && echo "Inputs: NAME ${NAME}, ID ${ID}, RUNNER_CIDRS ${RUNNER_CIDRS}"

#Exponential backoff with jitter
jitter() {
#.5 seconds
SHORTEST=50
#10 seconds
LONGEST=1000
DIV=100
EXP=$(perl -e "use bigint; print $SHORTEST**$1")
MIN=$(($EXP>$LONGEST ? $LONGEST : $EXP))
RND=$(shuf -i$SHORTEST-$MIN -n1)
perl -e "print $RND/$DIV"
}

#Attempt to avoid resource contention from the start
sleep $(jitter $(shuf -i1-10 -n1))

for ((i=1; i <= $CIRCUIT_BREAKER; i++)); do
#This loop is ONLY for retrying if the retries exceeded exception is thrown
for ((j=1; j <= $CIRCUIT_BREAKER; j++)); do
#Read WAF configuration from AWS
WAF_CONFIG=$(aws wafv2 get-ip-set --scope CLOUDFRONT --id ${ID} --name ${NAME} 2>&1)
CMD_CD=$?
[[ $DEBUG -ge 1 ]] && echo "AWS CLI Read Response Code: ${CMD_CD}"
[[ $DEBUG -ge 2 ]] && echo "AWS CLI Read Response: ${WAF_CONFIG}"

#If the retries exceeded error code is returned, try again, otherwise exit the loop
[[ $CMD_CD -eq $AWS_RETRY_ERROR ]] || break

SLEEP_FOR=$(jitter ${j})
echo "CLI retries exceed. Waiting for ${SLEEP_FOR} seconds to execute read again...(${j})"
sleep ${SLEEP_FOR}
done

#Unable to get the lock tocken and IP set so there isn't any point in attempting the write op
[[ $j -ge $CIRCUIT_BREAKER ]] && echo “Attempts to read WAF IPSet exceeded” && sleep $(jitter ${i}) && continue

#The loop was short circuited with an error code other than 0, so something is wrong
[[ $CMD_CD -eq 0 ]] || ( echo "An unexpected read error occurred: ${CMD_CD}" && exit 2 )

echo "Read was successful."

if [ ${OP} == "append" ]; then
##If this is used to whitelist individual ips or cidrs, using an additive approach is what is required
#Parse out IP set addresses to array
IP_ADDRESSES=($(jq -r '.IPSet.Addresses | .[]' <<< ${WAF_CONFIG}))

#If CIDR is already present in IP set, eject
grep -q $RUNNER_CIDRS <<< ${IP_ADDRESSES}
[[ $? -ne 0 ]] || ( echo "CIDR is present in IP Set." && exit 0 )

#Add runner CIDR to array
IP_ADDRESSES+=("$RUNNER_CIDRS")
else
##If this is used to hard set the IP set, just clobber it
IP_ADDRESSES=("$RUNNER_CIDRS")
fi

#Stringify IPs
STRINGIFIED=$(echo $(IFS=" " ; echo "${IP_ADDRESSES[*]}"))
[[ $DEBUG -ge 2 ]] && echo "Ip Addresses: ${STRINGIFIED}"

#Parse out optimistic concurrency control token
OCC_TOKEN=$(jq -r '.LockToken' <<< ${WAF_CONFIG})
[[ $DEBUG -ge 2 ]] && echo "LockToken: ${OCC_TOKEN}"

#This loop is ONLY for retrying if the retries exceeded exception is thrown
for ((k=1; k <= $CIRCUIT_BREAKER; k++)); do
#Write updated WAF configuration to AWS
OUTPUT=$(aws wafv2 update-ip-set --scope CLOUDFRONT --id ${ID} --name ${NAME} --lock-token ${OCC_TOKEN} --addresses ${STRINGIFIED} 2>&1)
CMD_CD=$?
[[ $DEBUG -ge 1 ]] && echo "AWS CLI Write Response Code: ${CMD_CD}"
[[ $DEBUG -ge 2 ]] && echo "AWS CLI Write Response: ${OUTPUT}"

#If the retries exceeded error code is returned, try again, otherwise exit the loop
[[ $CMD_CD -eq $AWS_RETRY_ERROR ]] || break
#If WAFOptimisticLockException error code is returned, exit the loop
[[ "$OUTPUT" =~ "WAFOptimisticLockException" ]] && break

SLEEP_FOR=$(jitter ${k})
echo "CLI retries exceed. Waiting for ${SLEEP_FOR} seconds to execute write again...(${k})"
sleep ${SLEEP_FOR}
done

[[ $CMD_CD -ne 0 ]] || break
#Still not having success, so try again

echo "Exit Code: ${CMD_CD}"

SLEEP_FOR=$(jitter ${i})
echo "Waiting for ${SLEEP_FOR} seconds to execute main loop again...(${i})"
sleep ${SLEEP_FOR}
done

[[ $DEBUG -ge 1 ]] && echo "Attempts to update ip set: $i"

[[ $i -gt $CIRCUIT_BREAKER ]] && echo “Attempts to update WAF IPSet exceeded, exiting.” && exit 2

echo "Applied the IP Set successfully."

#Things should not have made it this far without being able to successfully write the IP Set
exit $CMD_CD
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cypress-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
name: Setup Cypress Test Matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- id: set-test-matrix
run: |
echo "test-matrix=$(ls -1 tests/cypress/cypress/e2e/${{ inputs.test-path }}/* | xargs -n 1 basename | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
Expand All @@ -46,14 +46,14 @@ jobs:
runs-on: ubuntu-latest
container:
image: cypress/browsers:node16.16.0-chrome107-ff107
options: --user 1001
options: --user root
needs: setup
strategy:
fail-fast: false
matrix:
containers: ${{ fromJson(needs.setup.outputs.test-matrix) }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: set path
Expand Down
Loading
Loading