Skip to content

Commit 06e77a0

Browse files
authored
add iCloud storage
1 parent 6ddb82b commit 06e77a0

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

.github/workflows/little_snitch.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: "Update Little Snitch rules"
22
on:
3+
push:
4+
branches:
5+
- main
36
schedule:
47
- cron: '42 1 * * 2'
58
workflow_dispatch:
@@ -31,7 +34,11 @@ jobs:
3134
git config pull.rebase false
3235
branch=automated-lsrules-update-$GITHUB_RUN_ID
3336
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 ../..
3542
message='Automated lsrules update'
3643
# Add / update and commit
3744
git add macos/little_snitch/rules/*.lsrules
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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

macos/little_snitch/update_icloud.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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))

0 commit comments

Comments
 (0)