File tree 3 files changed +47
-1
lines changed
3 files changed +47
-1
lines changed Original file line number Diff line number Diff line change 1
1
name : " Update Little Snitch rules"
2
2
on :
3
+ push :
4
+ branches :
5
+ - main
3
6
schedule :
4
7
- cron : ' 42 1 * * 2'
5
8
workflow_dispatch :
31
34
git config pull.rebase false
32
35
branch=automated-lsrules-update-$GITHUB_RUN_ID
33
36
git checkout -b $branch
34
- cd macos/little_snitch && python3 update_microsoft.py && cd ../..
37
+ cd macos/little_snitch
38
+ python3 update_crl.py
39
+ python3 update_icloud.py
40
+ python3 update_microsoft.py
41
+ cd ../..
35
42
message='Automated lsrules update'
36
43
# Add / update and commit
37
44
git add macos/little_snitch/rules/*.lsrules
Original file line number Diff line number Diff line change
1
+ gcs-asia-00002.content-storage-download.googleapis.com
2
+ gcs-asia-00002.content-storage-upload.googleapis.com
3
+ gcs-eu-00002.content-storage-upload.googleapis.com
4
+ gcs-us-00002.content-storage-download.googleapis.com
5
+ gcs-us-00003.content-storage-download.googleapis.com
6
+ eu-irl-00001.s3.dualstack.eu-west-1.amazonaws.com
7
+ us-ore-00001.s3.dualstack.us-west-2.amazonaws.com
Original file line number Diff line number Diff line change
1
+
2
+ import json
3
+
4
+ from helpers import create_rule
5
+
6
+ lsrules = {
7
+ "name" : "iCloud Storage" ,
8
+ "description" : "Storage accounts for iCloud services" ,
9
+ "rules" : []
10
+ }
11
+
12
+ processes = [
13
+ "identifier.APPLE/com.apple.cloudd" ,
14
+ "identifier.APPLE/com.apple.imtransferservices.IMTransferAgent" ,
15
+ "identifier.APPLE/com.apple.nsurlsessiond" ,
16
+ ]
17
+
18
+ with open ('icloud-storage-hosts.txt' , 'r' ) as crlf :
19
+ icloud_storage_host = crlf .read ().splitlines ()
20
+
21
+ for process in processes :
22
+ for protocol in ["tcp" , "udp" ]:
23
+ rule = create_rule (
24
+ process ,
25
+ 443 ,
26
+ protocol = protocol ,
27
+ dest_host = icloud_storage_host ,
28
+ )
29
+ lsrules ['rules' ].append (rule )
30
+
31
+ with open ("rules/icloud_storage.lsrules" , "w" ) as of :
32
+ of .write (json .dumps (lsrules , indent = 4 ))
You can’t perform that action at this time.
0 commit comments