From 300e730d9ccdaf6a4f49b30de956f776a77a8407 Mon Sep 17 00:00:00 2001 From: Joe Gasiorek Date: Sun, 7 Jul 2024 09:54:15 -0700 Subject: [PATCH 01/20] Fix OWASP test --- .github/actions/run-server/action.yml | 1 + .github/workflows/owasp-daily-scan.yml | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/actions/run-server/action.yml b/.github/actions/run-server/action.yml index 0672abd89..01abf490d 100644 --- a/.github/actions/run-server/action.yml +++ b/.github/actions/run-server/action.yml @@ -18,6 +18,7 @@ runs: DATABASE_URL: ${{ inputs.database_url }} SECRET_KEY_BASE: not-actually-secret run: bundle exec rails server & + working-directory: app - name: "Wait for startup" shell: bash diff --git a/.github/workflows/owasp-daily-scan.yml b/.github/workflows/owasp-daily-scan.yml index 67aed27eb..95367a38f 100644 --- a/.github/workflows/owasp-daily-scan.yml +++ b/.github/workflows/owasp-daily-scan.yml @@ -1,10 +1,12 @@ name: OWASP ZAP daily scan on: - schedule: - # cron format: 'minute hour dayofmonth month dayofweek' - # this will run at noon UTC every day (7am EST / 8am EDT) - - cron: '0 12 * * *' + pull_request: + branches: [ main ] + # schedule: + # # cron format: 'minute hour dayofmonth month dayofweek' + # # this will run at noon UTC every day (7am EST / 8am EDT) + # - cron: '0 12 * * *' jobs: owasp-scan: @@ -31,6 +33,8 @@ jobs: - id: setup uses: ./.github/actions/setup-project + with: + rails_env: test - uses: ./.github/actions/run-server with: @@ -41,5 +45,5 @@ jobs: with: target: 'http://localhost:3000/' fail_action: true - rules_file_name: 'zap.conf' + rules_file_name: 'app/zap.conf' cmd_options: '-I' From 929a2d2bd008fda160cf1a6fa827593d8e0335a9 Mon Sep 17 00:00:00 2001 From: Joe Gasiorek Date: Mon, 8 Jul 2024 08:33:27 -0700 Subject: [PATCH 02/20] include csrf --- app/app/views/cbv/employer_searches/show.html.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/app/views/cbv/employer_searches/show.html.erb b/app/app/views/cbv/employer_searches/show.html.erb index e5c68d5e2..020507931 100644 --- a/app/app/views/cbv/employer_searches/show.html.erb +++ b/app/app/views/cbv/employer_searches/show.html.erb @@ -8,6 +8,7 @@

<%= t(".directed_to_login_portal") %>

<%= form_with url: cbv_flow_employer_search_path, method: :get, class: "usa-search usa-search--big margin-top-4", html: { role: "search" }, data: { turbo_frame: "employers", turbo_action: "advance" } do |f| %> + <%= hidden_field_tag :authenticity_token, form_authenticity_token -%> <%= f.label :query, "Search for your employer", class: "usa-sr-only" %> <%= f.text_field :query, value: @query, class: "usa-input", type: "search", data: { "cbv-employer-search-target": "searchTerms" } %>