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

Add Phishing Detection Embedded Data Update Workflow #3403

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 34 additions & 0 deletions .github/workflows/update_phishing_detection_data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Update Phishing Detection Datasets
on:
push:
jobs:
update_data:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: duckduckgo/macos-browser
path: macos/
token: ${{ secrets.DAX_MACOS_BROWSER_PHISHING_AUTOMATION }}
- name: Execute Update Script
run: |
cd ./macos
REVISION="$(bash ./scripts/update_phishing_detection_data.sh | grep -oP 'Updated revision from \K\d+')"
echo "REVISION=$REVISION" >> $GITHUB_ENV
TEMPLATE="$(bash ./scripts/update_phishing_detection_data.sh pr-body)"
PR_BODY_MACOS="${TEMPLATE//\{\{revision\}\}/$REVISION}"
echo "PR_BODY_MACOS<<EOF" >> $GITHUB_ENV
echo "$PR_BODY_MACOS" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create PR for macOS
uses: peter-evans/create-pull-request@88bf0de51c7487d91e1abbb4899332e602c58bbf
id: create-pr
with:
path: macos/
add-paths: |
./DuckDuckGo/PhishingDetection/
commit-message: Update phishing detection data to revision ${{ env.REVISION }}
branch: update-phishing-protection-${{ env.REVISION }}
title: Update phishing protection datasets to ${{ env.REVISION }}
body: "${{ env.PR_BODY_MACOS }}"
6 changes: 3 additions & 3 deletions DuckDuckGo/PhishingDetection/PhishingDetection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ public class PhishingDetection: PhishingSiteDetecting {
private let hashPrefixDataSHA: String

private init(
revision: Int = 1653367,
revision: Int = 1682412,
filterSetURL: URL = Bundle.main.url(forResource: "filterSet", withExtension: "json")!,
filterSetDataSHA: String = "edd913cb0a579c2b163a01347531ed78976bfaf1d14b96a658c4a39d34a70ffc",
filterSetDataSHA: String = "c18cccf9dab535f88c1e4570a9bf2f6477b53614f6494de090393cdfea6bee67",
hashPrefixURL: URL = Bundle.main.url(forResource: "hashPrefixes", withExtension: "json")!,
hashPrefixDataSHA: String = "c61349d196c46db9155ca654a0d33368ee0f33766fcd63e5a20f1d5c92026dc5",
hashPrefixDataSHA: String = "f2a43e57eba01beb6ae6e69406d5a0b769015871f50e62ac0f2cd15afb3ae7a8",
detectionClient: PhishingDetectionAPIClient = PhishingDetectionAPIClient(),
dataProvider: PhishingDetectionDataProvider? = nil,
dataStore: PhishingDetectionDataSaving? = nil,
Expand Down
Loading
Loading