Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
4033bd4
Added No Filter conditional to FilterChips
hawkishpolicy Dec 2, 2024
71b447d
Added pluralization to the "No Filter" filter chip
hawkishpolicy Dec 2, 2024
f4a450f
console log
lwersiy Dec 5, 2024
6d7266d
Edited FieldToLabelMap in FilterTags.tsx
hawkishpolicy Dec 5, 2024
b3a5670
More edits to FieldToLabelMap
hawkishpolicy Dec 5, 2024
ead9005
refactored FilterTags.tsx to include sorting function in service port…
lwersiy Dec 5, 2024
e64b5b0
Refactored sort functions in FieldToLabelMap
hawkishpolicy Dec 5, 2024
cde543e
Refactored Region sort function in FieldToLabelMap
hawkishpolicy Dec 5, 2024
80f0e11
Added sort to Org Names in FilterTags
hawkishpolicy Dec 6, 2024
2594358
Added additional sorting to remaining filter tags
hawkishpolicy Dec 6, 2024
3fa6884
Cleaned up console logs
hawkishpolicy Dec 6, 2024
2f092ea
N/A and Other added to the severity array
lwersiy Dec 11, 2024
9439c85
applied sorting logic to sort filters by predefined order from left t…
lwersiy Dec 12, 2024
7861c81
Merge remote-tracking branch 'origin/develop' into 732-filter-by-regi…
hawkishpolicy Dec 17, 2024
d520ee5
Merge branch '732-filter-by-region-gets-distorted-after-unselecting' …
hawkishpolicy Dec 17, 2024
2887b9c
Merge remote-tracking branch 'origin/develop' into 739-set-filtertags…
hawkishpolicy Dec 17, 2024
4d9ea65
Edited users.ts
hawkishpolicy Dec 20, 2024
3f7de25
Refined Severity Levels filtering in Bar Chart
hawkishpolicy Dec 23, 2024
e5a8017
Added to-do for N/A values array
hawkishpolicy Dec 23, 2024
433a0f3
Initial commit: configured matomo ports
chrtorres Dec 27, 2024
c562310
Refined Severity Level sorting and grouping
hawkishpolicy Dec 27, 2024
2da4510
Removed unnecessary if statement from Comparator
hawkishpolicy Dec 27, 2024
cbd704d
Removed unused console.logs and variables
hawkishpolicy Dec 27, 2024
af52494
Refined User State Selection Form
hawkishpolicy Dec 30, 2024
1afe5c3
Refactored if statement for N/A values
hawkishpolicy Dec 30, 2024
ffa2013
Removed console.logs and unused variables
hawkishpolicy Dec 30, 2024
fb89559
Updated matomo from version 3.14 -> 5.2.1; Added matomo tracking to i…
chrtorres Dec 30, 2024
cc4b5e5
Merge remote-tracking branch 'origin/develop' into Add-No-Filter-to-F…
hawkishpolicy Dec 30, 2024
2202eaf
Merge pull request #751 from cisagov/integration
cduhn17 Jan 6, 2025
b4b9865
Add pythonPath and Django_setting_Module to env.yml
aloftus23 Jan 6, 2025
ebfc0b7
Add to the production section too
aloftus23 Jan 6, 2025
5a56918
Merge pull request #752 from cisagov/AL-add-django-env-vars
rapidray12 Jan 6, 2025
8caa82e
Merge remote-tracking branch 'origin/develop' into matomo
chrtorres Jan 7, 2025
f40048b
Merge remote-tracking branch 'origin/develop' into Add-No-Filter-to-F…
hawkishpolicy Jan 7, 2025
b4761ab
Merge remote-tracking branch 'origin/develop' into 732-filter-by-regi…
hawkishpolicy Jan 7, 2025
b6a5286
Merge remote-tracking branch 'origin/develop' into 739-set-filtertags…
hawkishpolicy Jan 7, 2025
7f29bc1
Changed 'Domain' to 'Name' in FilterOrder array
hawkishpolicy Jan 7, 2025
7fbe090
Add better logging and refresh to elastic search
aloftus23 Jan 8, 2025
bf9801a
Merge remote-tracking branch 'origin/AL-fix-local-es' into 739-set-fi…
hawkishpolicy Jan 8, 2025
4ac0ff9
merge Andy's fux
hawkishpolicy Jan 8, 2025
bef267a
Removed unused loggin import and ran pre-commit
hawkishpolicy Jan 8, 2025
e8add49
Add new app and models
DJensen94 Jan 8, 2025
f0ecf2d
Merge remote-tracking branch 'origin/develop' into User-State-Selecti…
hawkishpolicy Jan 8, 2025
bc9764a
Add models
DJensen94 Jan 8, 2025
8ba79fe
Update synchronize to handle both dbs
aloftus23 Jan 8, 2025
887e1db
Add Phony: pytest to make sure pytest will always be runnable even if…
JCantu248 Jan 8, 2025
d0d6694
Merge remote-tracking branch 'origin/develop' into Severity-Level-Imp…
hawkishpolicy Jan 8, 2025
e5c0233
Add create user/databse to syncmdl and remove second db container for…
aloftus23 Jan 9, 2025
b797875
Fix syncdb SQL vulnerability
aloftus23 Jan 9, 2025
2c9475c
Fix path traversal docs vulnerability
aloftus23 Jan 9, 2025
27085f7
Add CRF protection to setting.py
aloftus23 Jan 9, 2025
62e93a0
Merge pull request #754 from cisagov/add_phony_pytest_to_makefile
cduhn17 Jan 9, 2025
cb2fa65
Remove postgres-data-mdl from .gitignore
aloftus23 Jan 9, 2025
7f14316
Add f-string suggestion to pylint ignore
aloftus23 Jan 9, 2025
f98c696
Fix get_models in ordered_models: Make it a list
aloftus23 Jan 9, 2025
0630c77
Run pre-commit and take out any f-strings
aloftus23 Jan 9, 2025
6b7e064
Fix class tabbing
DJensen94 Jan 9, 2025
56306fe
adding null permission
DJensen94 Jan 9, 2025
127aad4
Readd handler
aloftus23 Jan 10, 2025
d94ab7c
Refactor test files f-strings to .factor()
JCantu248 Jan 10, 2025
2f321b2
Fix local ElasticSearch (#753)
aloftus23 Jan 10, 2025
ec145d8
Fix all Checkmarx Medium/High vulns (#755)
aloftus23 Jan 10, 2025
8489044
Merge remote-tracking branch 'origin/develop' into Severity-Level-Imp…
hawkishpolicy Jan 10, 2025
ff83325
Change all f-strings to .format.
JCantu248 Jan 11, 2025
c55ebe3
Upgrade MariaDB version for Matomo from 10.6 to 11.4.
Matthew-Grayson Jan 13, 2025
22e52ff
Merge remote-tracking branch 'origin/develop' into matomo
chrtorres Jan 13, 2025
57b4da5
Irregular Severity Levels Improvements
hawkishpolicy Jan 13, 2025
096cfe3
Removed console.logs and prints
hawkishpolicy Jan 13, 2025
0bb820b
Refactored boolean logic in filter_helpers.py
hawkishpolicy Jan 13, 2025
382d408
Removed commented out code
hawkishpolicy Jan 13, 2025
78ce2aa
Updated cross-spawn to 7.0.6
hawkishpolicy Jan 14, 2025
9a1c8e4
Updated nanoid to 5.0.9
hawkishpolicy Jan 14, 2025
27b945c
Merge branch 'develop' of github.com:cisagov/XFD into CRASM_1073_fstr…
JCantu248 Jan 14, 2025
2d84f2d
Allow all methods to pass through P&E proxy and update latest ATC
aloftus23 Jan 14, 2025
33afe0a
Update CD --> LZ scans to use X-API-KEY
aloftus23 Jan 15, 2025
2c1d1cf
Merge pull request #759 from cisagov/AL-fix-pe-proxy
cduhn17 Jan 15, 2025
0c10b37
Move CSP and HSTS headers to settings.py
aloftus23 Jan 15, 2025
fdf6d64
Run pre-commit
aloftus23 Jan 15, 2025
fc63a2c
Merge branch 'develop' into AL-fix-checkmarx
aloftus23 Jan 15, 2025
749baff
Merge pull request #760 from cisagov/AL-fix-checkmarx
cduhn17 Jan 15, 2025
20e74df
Update Matomo image and allow Matomo's Fargate to access the paramete…
aloftus23 Jan 15, 2025
6ab4f52
Update Font URLs for Matomo in app.ts and views.py.
Matthew-Grayson Jan 15, 2025
e653734
Merge branch 'matomo' of github.com:cisagov/XFD into matomo
Matthew-Grayson Jan 15, 2025
eadd96a
hawkishpolicy Jan 15, 2025
3e63362
Ran linter
DJensen94 Jan 15, 2025
91406cd
Fix merge conflict in syncdb_helpers
aloftus23 Jan 16, 2025
15b99cd
Merge branch 'develop' into DJ_add-mdl-WIP
aloftus23 Jan 16, 2025
4ba44c0
Updated axios to 1.7.9
hawkishpolicy Jan 16, 2025
7210800
Make sure save() reverse_name is in the subdomain class not CVE
aloftus23 Jan 16, 2025
28aad6a
Updated express to 4.21.2
hawkishpolicy Jan 16, 2025
644c13f
Updated cross-spawn to 7.0.6
hawkishpolicy Jan 16, 2025
bc76c2f
Removed console.logs
hawkishpolicy Jan 16, 2025
aed962c
Updated dompurify to 3.2.3
hawkishpolicy Jan 16, 2025
1346f2e
Updated browser list
hawkishpolicy Jan 16, 2025
06b1198
Revert to Lamar Steward in matomo.tf
chrtorres Jan 16, 2025
bdbe1b9
Merge pull request #761 from cisagov/matomo
rapidray12 Jan 16, 2025
e28f20e
Fix terraform errors merging LZ infrastructure
aloftus23 Jan 16, 2025
185ca6f
Updated import of sanitize in app.ts
hawkishpolicy Jan 16, 2025
072f2d2
Merge pull request #764 from cisagov/AL-fix-teraform
rapidray12 Jan 16, 2025
cacba6d
Changes to dompurify import
hawkishpolicy Jan 16, 2025
c6eff3a
Reverted changes to ResultCard
hawkishpolicy Jan 16, 2025
456e47a
Updated import/usage of DOMPurify in ResultCard
hawkishpolicy Jan 16, 2025
33ea6b2
Update models to remove small errors
DJensen94 Jan 16, 2025
7a524f9
Installed version 2.5.8 of DOMPurify
hawkishpolicy Jan 16, 2025
259a132
Updated fast-xml-parser to 4.5.1
hawkishpolicy Jan 16, 2025
fb18450
Fix pytests working with MDL addition
aloftus23 Jan 16, 2025
9d2e8ba
Updated http-proxy-middleware to 3.0.3
hawkishpolicy Jan 16, 2025
a2ec471
Updated nanoid to 5.0.9
hawkishpolicy Jan 16, 2025
5cbbdbd
Merge remote-tracking branch 'origin/develop' into Frontend-Node-Modu…
hawkishpolicy Jan 16, 2025
1eb0117
Merge remote-tracking branch 'origin/develop' into Severity-Level-Imp…
hawkishpolicy Jan 16, 2025
7384ce6
Updated path-to-regexp to 8.2.0
hawkishpolicy Jan 16, 2025
21225cf
Updated rollup to 2.79.2
hawkishpolicy Jan 16, 2025
4338d4f
Updated webpack to 5.97.1
hawkishpolicy Jan 16, 2025
bb9dc11
Add functionality to create a postgres user for scanning
aloftus23 Jan 17, 2025
eb17a26
Run pre-commit checks
aloftus23 Jan 17, 2025
5316154
Ran npm audit fix
hawkishpolicy Jan 17, 2025
1a42a4c
Updated cookie to 1.0.2
hawkishpolicy Jan 17, 2025
dbb323b
Merge pull request #757 from cisagov/Docs-Node-Modules-(CRASM-1077)
schmelz21 Jan 17, 2025
341834c
Updated universal-cookie to 7.2.2
hawkishpolicy Jan 17, 2025
d279b4b
Merge pull request #731 from cisagov/Add-No-Filter-to-Filter-Chips-CR…
schmelz21 Jan 17, 2025
cafebc9
Merge branch 'develop' of github.com:cisagov/XFD into CRASM_1073_fstr…
JCantu248 Jan 17, 2025
b88dab5
Fix logging to use % formatting.
JCantu248 Jan 17, 2025
67e1269
Fix test cases were were broken when using GPT.
JCantu248 Jan 17, 2025
2c136b2
Merge pull request #763 from cisagov/Frontend-Node-Modules-CRASM-1076
schmelz21 Jan 17, 2025
d0b03c4
Merge branch 'develop' into AL-create-pg-scan-user
aloftus23 Jan 17, 2025
a0a23d5
Merge branch 'develop' into DJ_add-mdl-WIP
aloftus23 Jan 17, 2025
7dbfe7f
Merge pull request #756 from cisagov/CRASM_1073_fstrings_to_format
schmelz21 Jan 17, 2025
d534e1a
Merge branch 'develop' into DJ_add-mdl-WIP
aloftus23 Jan 17, 2025
5672314
Fix filename typo in comment
aloftus23 Jan 17, 2025
3d16c52
Merge remote-tracking branch 'origin/develop' into Severity-Level-Imp…
hawkishpolicy Jan 21, 2025
ff361d0
Update regional resource policy to handle multiple IPs
aloftus23 Jan 21, 2025
ccbf9e6
Also update in the frontend api gateway resource policy
aloftus23 Jan 21, 2025
6b24fe4
Merge pull request #762 from cisagov/DJ_add-mdl-WIP
schmelz21 Jan 21, 2025
2d79602
Create the syncmdl lambda and call the run_syncmdl script
aloftus23 Jan 21, 2025
e2079c8
Fix linter
aloftus23 Jan 21, 2025
10ce721
Merge pull request #768 from cisagov/DJ_add-mdl-WIP
schmelz21 Jan 21, 2025
54f50b0
Merge pull request #765 from cisagov/AL-create-pg-scan-user
schmelz21 Jan 21, 2025
91cc9c5
Merge branch 'develop' into AL-whitelist-IPs
aloftus23 Jan 22, 2025
5a9ccdd
Fix pylint error
aloftus23 Jan 22, 2025
aa52c67
Merge pull request #770 from cisagov/AL-fix-pylint
schmelz21 Jan 22, 2025
cd9b215
Merge branch 'develop' into AL-whitelist-IPs
aloftus23 Jan 22, 2025
daac442
Merge pull request #733 from cisagov/732-filter-by-region-gets-distor…
schmelz21 Jan 22, 2025
808bcac
Merge pull request #746 from cisagov/User-State-Selection-Not-Saving-…
schmelz21 Jan 22, 2025
25e1b3d
Merge pull request #747 from cisagov/Severity-Level-Improvements
schmelz21 Jan 22, 2025
3c32282
Merge remote-tracking branch 'origin/develop' into 739-set-filtertags…
hawkishpolicy Jan 22, 2025
f6b42c9
Merge pull request #741 from cisagov/739-set-filtertags-to-be-in-a-co…
schmelz21 Jan 22, 2025
f19e484
Merge pull request #767 from cisagov/AL-whitelist-IPs
schmelz21 Jan 22, 2025
5e5f66a
Use direct PE_API_URL instead of CD proxy
aloftus23 Jan 27, 2025
2bc6d7e
Allow API Keys to be passed through Authorization header
aloftus23 Jan 28, 2025
5de44fe
Merge pull request #775 from cisagov/AL-allow-authorization
rapidray12 Jan 28, 2025
3f56756
Add -y flag ensure that apt installs the packages without prompting f…
aloftus23 Jan 28, 2025
02c82db
Create EC2 instance for sending emails
aloftus23 Jan 30, 2025
5c3b033
run pre-commit
aloftus23 Jan 30, 2025
72b88ab
update emailSenderConnect with ssh
aloftus23 Jan 30, 2025
7355816
Fix email-sener subnet_id
aloftus23 Jan 30, 2025
b687cca
Fix undeclared reference in terraform
aloftus23 Jan 30, 2025
ef2868a
fix terraform count
aloftus23 Jan 30, 2025
8ce2f89
fix variable type for instance type
aloftus23 Jan 30, 2025
c76bc5c
Fix linter
aloftus23 Jan 30, 2025
7789222
Fix terraform typo
aloftus23 Jan 30, 2025
2850294
Merge pull request #778 from cisagov/AL-email-EC2
cduhn17 Jan 30, 2025
70d0ecc
Fix aws_instance definition
aloftus23 Jan 30, 2025
a1d4197
Merge pull request #779 from cisagov/AL-email-EC2
rapidray12 Jan 30, 2025
ae78d8e
Ensure profile exists when creating EC2
aloftus23 Jan 30, 2025
bafbb07
Merge pull request #780 from cisagov/AL-email-EC2
cduhn17 Jan 30, 2025
20e1bce
Update the ami to differentiate DMZ/LZ
aloftus23 Jan 30, 2025
371366b
Add count to ubuntu ami call
aloftus23 Jan 30, 2025
b21a7ed
Merge pull request #781 from cisagov/AL-email-EC2
rapidray12 Jan 30, 2025
c8ab1b4
Merge pull request #773 from cisagov/AL-fix-SQS-PE-URL
rapidray12 Jan 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ max-line-length=120

[MESSAGES CONTROL]
disable=C0103, # Conforms to snake_case
C0209, # Formatting a regular string which could be an f-string (consider-using-f-string)
C0301, # Line too long
C0415, # Import outside top-level (consider refactoring)
C0302, # Too many lines in module
Expand Down
4 changes: 2 additions & 2 deletions backend/Dockerfile.pe
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COPY ./package* ./

COPY src ./src

RUN apt update && apt install git zlib1g-dev
RUN apt update && apt install -y git zlib1g-dev

RUN apt-get update && apt-get install -y jq

Expand All @@ -28,7 +28,7 @@ RUN ./aws/install
# Sync the latest from cf-staging branch
RUN git clone -b crossfeed-SQS https://github.com/cisagov/ATC-Framework.git && \
cd ATC-Framework && \
git checkout 694dc68487ab24b625f157fb5d79f675c7ec1467 && \
git checkout 563f59e8b67ca153ab5564d697433ca0d8db451a && \
pip install .

RUN python -m spacy download en_core_web_lg
Expand Down
13 changes: 13 additions & 0 deletions backend/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.PHONY: syncdb
.PHONY: populate-cache
.PHONY: pytest

# Synchronize and populate the database
syncdb:
Expand All @@ -8,6 +9,18 @@ syncdb:
syncdb-populate:
docker compose exec backend python manage.py syncdb --populate

syncdb-dangerously-force:
docker compose exec backend python manage.py syncdb --dangerouslyforce


# Synchronize and populate the database
syncmdl:
docker compose exec backend python manage.py syncmdl

syncmdl-dangerously-force:
docker compose exec backend python manage.py syncmdl --dangerouslyforce


# Pytest
# i.e. make pytest FILE=xfd_api/tests/test_domain.py
pytest:
Expand Down
16 changes: 16 additions & 0 deletions backend/env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ dev:
REGION: us-east-1

staging-cd:
IS_DMZ: 1
REGION: us-east-1
ENDPOINT_TYPE: REGIONAL
COGNITO_URL: https://cognito-idp.us-east-1.amazonaws.com
BACKEND_DOMAIN: https://api.staging-cd.crossfeed.cyber.dhs.gov
EMAIL_REGION: us-east-1
DJANGO_KEY: ${ssm:/crossfeed/staging/DJANGO_KEY}
PYTHONPATH: src/xfd_django
DJANGO_SETTINGS_MODULE: xfd_django.settings
DB_DIALECT: postgres
DB_PORT: 5432
DB_HOST: ${ssm:/crossfeed/staging/DATABASE_HOST}
Expand All @@ -22,6 +25,8 @@ staging-cd:
MDL_USERNAME: ${ssm:/crossfeed/staging/MDL_USERNAME}
MDL_PASSWORD: ${ssm:/crossfeed/staging/MDL_PASSWORD}
MDL_NAME: ${ssm:/crossfeed/staging/MDL_NAME}
POSTGRES_SCAN_USER: ${ssm:/crossfeed/staging/POSTGRES_SCAN_USER}
POSTGRES_SCAN_PASSWORD: ${ssm:/crossfeed/staging/POSTGRES_SCAN_PASSWORD}
MI_ACCOUNT_NAME: ${ssm:/readysetcyber/staging/MI_ACCOUNT_NAME}
MI_PASSWORD: ${ssm:/readysetcyber/staging/MI_ACCOUNT_PASSWORD}
PE_DB_NAME: ${ssm:/crossfeed/staging/PE_DB_NAME}
Expand Down Expand Up @@ -76,6 +81,7 @@ staging-cd:
REACT_APP_COGNITO_CALLBACK_URL: https://staging-cd.crossfeed.cyber.dhs.gov/okta-callback

integration:
IS_DMZ: 1
REGION: us-east-1
ENDPOINT_TYPE: REGIONAL
COGNITO_URL: https://cognito-idp.us-east-1.amazonaws.com
Expand All @@ -93,6 +99,8 @@ integration:
MDL_USERNAME: ${ssm:/crossfeed/integration/MDL_USERNAME}
MDL_PASSWORD: ${ssm:/crossfeed/integration/MDL_PASSWORD}
MDL_NAME: ${ssm:/crossfeed/integration/MDL_NAME}
POSTGRES_SCAN_USER: ${ssm:/crossfeed/integration/POSTGRES_SCAN_USER}
POSTGRES_SCAN_PASSWORD: ${ssm:/crossfeed/integration/POSTGRES_SCAN_PASSWORD}
MI_ACCOUNT_NAME: ${ssm:/readysetcyber/integration/MI_ACCOUNT_NAME}
MI_PASSWORD: ${ssm:/readysetcyber/integration/MI_ACCOUNT_PASSWORD}
JWT_SECRET: ${ssm:/crossfeed/integration/APP_JWT_SECRET}
Expand Down Expand Up @@ -140,6 +148,7 @@ integration:
ELASTICACHE_ENDPOINT: ${ssm:/crossfeed/integration/ELASTICACHE_ENDPOINT}

staging:
IS_DMZ: 0
REGION: us-gov-east-1
ENDPOINT_TYPE: PRIVATE
COGNITO_URL: https://cognito-idp.us-gov-west-1.amazonaws.com
Expand All @@ -155,6 +164,8 @@ staging:
DB_NAME: ${ssm:/crossfeed/staging/DATABASE_NAME}
DB_USERNAME: ${ssm:/crossfeed/staging/DATABASE_USER}
DB_PASSWORD: ${ssm:/crossfeed/staging/DATABASE_PASSWORD}
POSTGRES_SCAN_USER: ${ssm:/crossfeed/staging/POSTGRES_SCAN_USER}
POSTGRES_SCAN_PASSWORD: ${ssm:/crossfeed/staging/POSTGRES_SCAN_PASSWORD}
JWT_SECRET: ${ssm:/crossfeed/staging/APP_JWT_SECRET}
JWT_ALGORITHM: ${ssm:/crossfeed/staging/JWT_ALGORITHM}
JWT_TIMEOUT_HOURS: ${ssm:/crossfeed/staging/JWT_TIMEOUT_HOURS}
Expand Down Expand Up @@ -202,13 +213,16 @@ staging:
ELASTICACHE_ENDPOINT: ${ssm:/crossfeed/staging/ELASTICACHE_ENDPOINT}

prod:
IS_DMZ: 0
REGION: us-gov-east-1
ENDPOINT_TYPE: PRIVATE
COGNITO_URL: https://cognito-idp.us-gov-west-1.amazonaws.com
BACKEND_DOMAIN: https://api.crossfeed.cyber.dhs.gov
EMAIL_REGION: us-gov-west-1
LZ_PROXY_URL: ${ssm:/crossfeed/prod/LZ_PROXY_URL}
DJANGO_KEY: ${ssm:/crossfeed/prod/DJANGO_KEY}
PYTHONPATH: src/xfd_django
DJANGO_SETTINGS_MODULE: xfd_django.settings
DB_DIALECT: postgres
DB_PORT: 5432
DB_HOST: ${ssm:/crossfeed/prod/DATABASE_HOST}
Expand All @@ -219,6 +233,8 @@ prod:
MDL_PASSWORD: ${ssm:/crossfeed/prod/MDL_PASSWORD}
DJANGO_SECRET: ${ssm:/crossfeed/prod/DJANGO_SECRECT}
MDL_NAME: ${ssm:/crossfeed/prod/MDL_NAME}
POSTGRES_SCAN_USER: ${ssm:/crossfeed/prod/POSTGRES_SCAN_USER}
POSTGRES_SCAN_PASSWORD: ${ssm:/crossfeed/prod/POSTGRES_SCAN_PASSWORD}
JWT_SECRET: ${ssm:/crossfeed/prod/APP_JWT_SECRET}
JWT_ALGORITHM: ${ssm:/crossfeed/prod/JWT_ALGORITHM}
JWT_TIMEOUT_HOURS: ${ssm:/crossfeed/prod/JWT_TIMEOUT_HOURS}
Expand Down
1 change: 1 addition & 0 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ click==8.1.7
cryptography==38.0.0
dill==0.3.9
Django==5.1.4
django-netfields==1.3.2
dnspython==2.7.0
docker==7.1.0
elasticsearch==7.9.0
Expand Down
2 changes: 1 addition & 1 deletion backend/scripts/populateCountiesCities/cities.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def pull_cities():
)
time.sleep(1)
except Exception as e:
print(f"Error: {e}")
print("Error: {}".format(e))
pass

df = pd.DataFrame(holding_pen, columns=["State", "County", "City", "URL"])
Expand Down
2 changes: 1 addition & 1 deletion backend/scripts/populateCountiesCities/counties.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def pull_counties():
}
)
except Exception as e:
print(f"Error: {e}")
print("Error: {}".format(e))
pass

time.sleep(1)
Expand Down
4 changes: 3 additions & 1 deletion backend/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ custom:
Condition:
IpAddress:
aws:SourceIp:
- ${file(env.yml):${self:provider.stage}.DMZ_CIDR, ''}
'Fn::Split':
- ','
- ${file(env.yml):${self:provider.stage}.DMZ_CIDR, ''}

# Conditional logic for GovCloud vs
# non-GovCloud (Private endpoints require a VPC Endpoint)
Expand Down
6 changes: 3 additions & 3 deletions backend/src/api/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,17 +444,17 @@ app.use(
// API Gateway isn't able to proxy fonts properly -- so we're using a CDN instead.
if (req.path === '/plugins/Morpheus/fonts/matomo.woff2') {
return res.redirect(
'https://cdn.jsdelivr.net/gh/matomo-org/matomo@3.14.1/plugins/Morpheus/fonts/matomo.woff2'
'https://cdn.jsdelivr.net/gh/matomo-org/matomo@5.2.1/plugins/Morpheus/fonts/matomo.woff2'
);
}
if (req.path === '/plugins/Morpheus/fonts/matomo.woff') {
return res.redirect(
'https://cdn.jsdelivr.net/gh/matomo-org/matomo@3.14.1/plugins/Morpheus/fonts/matomo.woff'
'https://cdn.jsdelivr.net/gh/matomo-org/matomo@5.2.1/plugins/Morpheus/fonts/matomo.woff'
);
}
if (req.path === '/plugins/Morpheus/fonts/matomo.ttf') {
return res.redirect(
'https://cdn.jsdelivr.net/gh/matomo-org/matomo@3.14.1/plugins/Morpheus/fonts/matomo.ttf'
'https://cdn.jsdelivr.net/gh/matomo-org/matomo@5.2.1/plugins/Morpheus/fonts/matomo.ttf'
);
}
// Only allow global admins to access all other paths.
Expand Down
4 changes: 3 additions & 1 deletion backend/src/api/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,9 @@ export const updateV2 = wrapHandler(async (event) => {
}

// Check if authorizer's region matches the user's
if (!matchesUserRegion(event, user.regionId)) return Unauthorized;
// Allows new users to select their state without a region on initial account creation
if (user.invitePending === false && !matchesUserRegion(event, user.regionId))
return Unauthorized;

if (body.state) {
body.regionId = REGION_STATE_MAP[body.state];
Expand Down
5 changes: 3 additions & 2 deletions backend/src/api/vulnerabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,12 @@ class VulnerabilitySearch {
if (this.filters?.severity) {
if (this.filters.severity === 'N/A') {
qs.andWhere(
"vulnerability.severity IS NULL OR vulnerability.severity = ''"
"vulnerability.severity IS NULL OR vulnerability.severity = '' OR vulnerability.severity ILIKE 'N/A' OR vulnerability.severity ILIKE 'NULL'"
);
} else if (this.filters.severity === 'Other') {
qs.andWhere(
`vulnerability.severity NOT ILIKE 'N/A' AND
`vulnerability.severity NOT ILIKE 'NULL' AND
vulnerability.severity NOT ILIKE 'N/A' AND
vulnerability.severity NOT ILIKE 'Low' AND
vulnerability.severity NOT ILIKE 'Medium' AND
vulnerability.severity NOT ILIKE 'High' AND
Expand Down
4 changes: 4 additions & 0 deletions backend/src/tasks/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ syncdb:
timeout: 900
handler: src/xfd_django/xfd_api/tasks/run_syncdb.handler

syncmdl:
timeout: 900
handler: src/xfd_django/xfd_api/tasks/run_syncmdl.handler

bastion:
timeout: 900
handler: src/xfd_django/xfd_api/tasks/bastion.handler
Expand Down
12 changes: 6 additions & 6 deletions backend/src/xfd_django/xfd_api/api_methods/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@

async def handle_okta_callback(request):
"""POST API LOGIC."""
print(f"Request from /auth/okta-callback: {str(request)}")
print("Request from /auth/okta-callback: {}".format(str(request)))
body = await request.json()
print(f"Request json from callback: {str(request)}")
print(f"Request json from callback: {body}")
print(f"Body type: {type(body)}")
print("Request json from callback: {}".format(str(request)))
print("Request json from callback: {}".format(body))
print("Body type: {}".format(type(body)))
code = body.get("code")
print(f"Code: {code}")
print("Code: {}".format(code))
if not code:
return HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail="Code not found in request body",
)
jwt_data = await get_jwt_from_code(code)
print(f"JWT Data: {jwt_data}")
print("JWT Data: {}".format(jwt_data))
if jwt_data is None:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
Expand Down
4 changes: 2 additions & 2 deletions backend/src/xfd_django/xfd_api/api_methods/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def export_domains(domain_search: DomainSearch, current_user):
for product in service.products.all():
if product.name:
product_entry = (
f"{product.name} {product.version}"
"{} {}".format(product.name, product.version)
if product.version
else product.name
)
Expand Down Expand Up @@ -221,5 +221,5 @@ def export_domains(domain_search: DomainSearch, current_user):

except Exception as e:
# Log the exception for debugging (optional)
print(f"Error exporting domains: {e}")
print("Error exporting domains: {}".format(e))
raise HTTPException(status_code=500, detail=str(e))
8 changes: 4 additions & 4 deletions backend/src/xfd_django/xfd_api/api_methods/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def get_organization(organization_id, current_user):
raise http_exc

except Exception as e:
print(f"An error occurred: {e}")
print("An error occurred: {}".format(e))
raise HTTPException(status_code=500, detail=str(e))


Expand Down Expand Up @@ -715,7 +715,7 @@ def delete_organization(org_id: str, current_user):
# Return success response
return {
"status": "success",
"message": f"Organization {org_id} has been deleted successfully.",
"message": "Organization {} has been deleted successfully.".format(org_id),
}

except HTTPException as http_exc:
Expand Down Expand Up @@ -1064,7 +1064,7 @@ def search_organizations_task(search_body, current_user: User):
# Use match_all if searchTerm is empty
if search_body.searchTerm.strip():
query_body["query"]["bool"]["must"].append(
{"wildcard": {"name": f"*{search_body.searchTerm}*"}}
{"wildcard": {"name": "*{}*".format(search_body.searchTerm)}}
)
else:
query_body["query"]["bool"]["must"].append({"match_all": {}})
Expand All @@ -1076,7 +1076,7 @@ def search_organizations_task(search_body, current_user: User):
)

# Log the query for debugging
print(f"Query body: {query_body}")
print("Query body: {}".format(query_body))

# Execute the search
search_results = client.search_organizations(query_body)
Expand Down
4 changes: 2 additions & 2 deletions backend/src/xfd_django/xfd_api/api_methods/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ async def proxy_request(
if cookie_name:
cookies = manipulate_cookie(request, cookie_name)
if cookies:
headers["Cookie"] = f"{cookie_name}={cookies[cookie_name]}"
headers["Cookie"] = "{}={}".format(cookie_name, cookies[cookie_name])

# Make the request to the target URL
async with httpx.AsyncClient() as client:
proxy_response = await client.request(
method=request.method,
url=f"{target_url}/{path}",
url="{}/{}".format(target_url, path),
headers=headers,
params=request.query_params,
content=await request.body(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def delete_saved_search(saved_search_id, user):
return JsonResponse(
{
"status": "success",
"message": f"Saved search id:{saved_search_id} deleted.",
"message": "Saved search id:{} deleted.".format(saved_search_id),
}
)
except User.DoesNotExist:
Expand Down
9 changes: 6 additions & 3 deletions backend/src/xfd_django/xfd_api/api_methods/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,10 @@ def delete_scan(scan_id: str, current_user):

scan.delete()

return {"status": "success", "message": f"Scan {scan_id} deleted successfully."}
return {
"status": "success",
"message": "Scan {} deleted successfully.".format(scan_id),
}

except HTTPException as http_exc:
raise http_exc
Expand All @@ -297,7 +300,7 @@ def run_scan(scan_id: str, current_user):
scan.save()
return {
"status": "success",
"message": f"Scan {scan_id} set to manualRunPending.",
"message": "Scan {} set to manualRunPending.".format(scan_id),
}

except HTTPException as http_exc:
Expand All @@ -320,7 +323,7 @@ async def invoke_scheduler(current_user):
lambda_client = LambdaClient()

# Form the lambda function name using environment variable
lambda_function_name = f"{os.getenv('SLS_LAMBDA_PREFIX')}-scheduler"
lambda_function_name = "{}-scheduler".format(os.getenv("SLS_LAMBDA_PREFIX"))
print(lambda_function_name)

# Run the Lambda command
Expand Down
8 changes: 4 additions & 4 deletions backend/src/xfd_django/xfd_api/api_methods/scan_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def list_scan_tasks(search_data: Optional[ScanTaskSearch], current_user):

# Determine the correct ordering based on the 'order' field
ordering_field = (
f"-{search_data.sort}"
"-{}".format(search_data.sort)
if search_data.order and search_data.order.upper() == "DESC"
else search_data.sort
else "{}".format(search_data.sort)
)

# Construct query based on filters
Expand Down Expand Up @@ -71,7 +71,7 @@ def list_scan_tasks(search_data: Optional[ScanTaskSearch], current_user):
for task in qs:
# Ensure scan is not None before accessing its properties
if task.scan is None:
print(f"Warning: ScanTask {task.id} has no scan associated.")
print("Warning: ScanTask {} has no scan associated.".format(task.id))
scan_data = None
else:
scan_data = {
Expand Down Expand Up @@ -177,7 +177,7 @@ def kill_scan_task(scan_task_id, current_user):
utc_now = datetime.now(timezone.utc)
scan_task.status = "failed"
scan_task.finishedAt = utc_now
scan_task.output = f"Manually stopped at {utc_now.isoformat()}"
scan_task.output = "Manually stopped at {}".format(utc_now.isoformat())
scan_task.save()

return {"statusCode": 200, "message": "ScanTask successfully marked as failed."}
Expand Down
Loading
Loading