bunny2fmc 1.0.8__py3-none-any.whl → 1.3.21__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- README.md +119 -0
- bunny2fmc/__init__.py +1 -1
- bunny2fmc/cli.py +760 -120
- bunny2fmc/config.py +152 -1
- bunny2fmc/setup_helper.py +31 -0
- bunny2fmc/sync_engine.py +262 -56
- bunny2fmc-1.3.21.dist-info/METADATA +152 -0
- bunny2fmc-1.3.21.dist-info/RECORD +15 -0
- {bunny2fmc-1.0.8.dist-info → bunny2fmc-1.3.21.dist-info}/WHEEL +1 -1
- guide/INSTALL.md +208 -0
- install.sh +54 -0
- requirements.txt +3 -0
- bunny2fmc-1.0.8.dist-info/METADATA +0 -176
- bunny2fmc-1.0.8.dist-info/RECORD +0 -10
- {bunny2fmc-1.0.8.dist-info → bunny2fmc-1.3.21.dist-info}/entry_points.txt +0 -0
- {bunny2fmc-1.0.8.dist-info → bunny2fmc-1.3.21.dist-info}/licenses/LICENSE +0 -0
- {bunny2fmc-1.0.8.dist-info → bunny2fmc-1.3.21.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bunny2fmc
|
|
3
|
+
Version: 1.3.21
|
|
4
|
+
Summary: Sync BunnyCDN edge IPs to Cisco FMC Dynamic Objects with secure credential management and scheduling
|
|
5
|
+
Author: Kasper Elsborg -Wingmen
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/wingmen/bunny-sync-fmc
|
|
8
|
+
Project-URL: Repository, https://github.com/wingmen/bunny-sync-fmc
|
|
9
|
+
Keywords: bunny,bunnyCDN,cisco,fmc,firewall,security,automation,dynamic-objects
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: System Administrators
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Topic :: System :: Networking :: Firewalls
|
|
20
|
+
Requires-Python: >=3.8
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: wingpy>=0.3.0
|
|
24
|
+
Requires-Dist: requests>=2.25.0
|
|
25
|
+
Requires-Dist: python-dotenv>=0.19.0
|
|
26
|
+
Requires-Dist: keyring>=23.0.0
|
|
27
|
+
Requires-Dist: keyrings.alt>=5.0
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
30
|
+
Requires-Dist: black>=22.0; extra == "dev"
|
|
31
|
+
Requires-Dist: flake8>=4.0; extra == "dev"
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
|
|
34
|
+
# bunny2fmc
|
|
35
|
+
|
|
36
|
+
Automatically sync BunnyCDN IP ranges to Cisco FMC Dynamic Objects.
|
|
37
|
+
|
|
38
|
+
## Quick Install
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
sudo apt install pipx
|
|
42
|
+
pipx install bunny2fmc
|
|
43
|
+
bunny2fmc --setup
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
That's it! Answer the setup questions and you're done.
|
|
47
|
+
|
|
48
|
+
During `bunny2fmc --setup` you'll be asked for:
|
|
49
|
+
- FMC hostname/IP
|
|
50
|
+
- FMC username/password (stored in OS keyring)
|
|
51
|
+
- Dynamic Object name
|
|
52
|
+
- IPv6 enable (y/n)
|
|
53
|
+
- Sync interval (minutes)
|
|
54
|
+
- Bunny IPv4 API URL (default: https://bunnycdn.com/api/system/edgeserverlist)
|
|
55
|
+
- Bunny IPv6 API URL (default: https://bunnycdn.com/api/system/edgeserverlist/ipv6)
|
|
56
|
+
|
|
57
|
+
## What it does
|
|
58
|
+
|
|
59
|
+
**bunny2fmc** fetches the latest BunnyCDN edge server IP addresses and updates a Dynamic Object in Cisco FMC. No deployment needed - changes are immediate.
|
|
60
|
+
|
|
61
|
+
### Features
|
|
62
|
+
|
|
63
|
+
- 🔄 **Automatic sync** - Fetch latest IPs from BunnyCDN API
|
|
64
|
+
- ⚙️ **Configurable endpoints** - Override Bunny IPv4/IPv6 API URLs when needed
|
|
65
|
+
- 🔐 **Secure credentials** - Stored in OS keyring
|
|
66
|
+
- ⏰ **Scheduled execution** - Run via cron (daily/hourly/custom)
|
|
67
|
+
- 📊 **Smart updates** - Only changes what's needed
|
|
68
|
+
- 📝 **Logging** - Track all sync activity
|
|
69
|
+
|
|
70
|
+
## Prerequisites
|
|
71
|
+
|
|
72
|
+
Before running `bunny2fmc --setup`, create a dedicated API user in FMC:
|
|
73
|
+
|
|
74
|
+
1. **FMC → System → Users → Add User**
|
|
75
|
+
2. Settings:
|
|
76
|
+
- Username: `bunny2fmc_sync`
|
|
77
|
+
- Password: [choose strong password - save it!]
|
|
78
|
+
- Role: **Network Admin** (or Maintenance User)
|
|
79
|
+
- Authentication: **Local**
|
|
80
|
+
3. Click **Save**
|
|
81
|
+
|
|
82
|
+
**Important:** Don't use your admin account - API login logs out the web UI session!
|
|
83
|
+
|
|
84
|
+
## Commands
|
|
85
|
+
|
|
86
|
+
| Command | Description |
|
|
87
|
+
|---------|-------------|
|
|
88
|
+
| `bunny2fmc --setup` | Interactive configuration |
|
|
89
|
+
| `bunny2fmc --run` | Run sync now |
|
|
90
|
+
| `bunny2fmc --start` | Start scheduled sync (cron) |
|
|
91
|
+
| `bunny2fmc --stop` | Stop scheduled sync |
|
|
92
|
+
| `bunny2fmc --config` | Show configuration |
|
|
93
|
+
| `bunny2fmc --logs` | View recent logs |
|
|
94
|
+
| `bunny2fmc --logs follow` | Follow logs in real-time |
|
|
95
|
+
| `bunny2fmc --clear` | Remove all config and credentials |
|
|
96
|
+
| `bunny2fmc --help` | Show all commands |
|
|
97
|
+
|
|
98
|
+
## File Locations
|
|
99
|
+
|
|
100
|
+
All files are stored in `~/bunny2fmc/`:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
~/bunny2fmc/
|
|
104
|
+
├── config.json # Configuration
|
|
105
|
+
├── logs/ # Log files
|
|
106
|
+
└── guide/ # Documentation
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Troubleshooting
|
|
110
|
+
|
|
111
|
+
**pipx not found:**
|
|
112
|
+
```bash
|
|
113
|
+
pipx ensurepath
|
|
114
|
+
source ~/.bashrc
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**bunny2fmc not found:**
|
|
118
|
+
```bash
|
|
119
|
+
export PATH="$PATH:$HOME/.local/bin"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Can't connect to FMC:**
|
|
123
|
+
- Check firewall allows port 443
|
|
124
|
+
- Verify FMC hostname/IP is correct
|
|
125
|
+
- Test: `curl -k https://fmc.company.com/api/fmc_platform/v1/info`
|
|
126
|
+
|
|
127
|
+
**Upgrade:**
|
|
128
|
+
```bash
|
|
129
|
+
pipx upgrade bunny2fmc
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Uninstall:**
|
|
133
|
+
```bash
|
|
134
|
+
pipx uninstall bunny2fmc
|
|
135
|
+
rm -rf ~/bunny2fmc/
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Requirements
|
|
139
|
+
|
|
140
|
+
- Linux (Ubuntu/Debian recommended)
|
|
141
|
+
- Python 3.8+
|
|
142
|
+
- Cisco FMC with API access
|
|
143
|
+
- Network access to FMC and internet
|
|
144
|
+
|
|
145
|
+
## Links
|
|
146
|
+
|
|
147
|
+
- **PyPI:** https://pypi.org/project/bunny2fmc/
|
|
148
|
+
- **GitHub:** https://github.com/IronKeyVault/Bunny_Sync_FMC
|
|
149
|
+
|
|
150
|
+
## License
|
|
151
|
+
|
|
152
|
+
MIT License - see LICENSE file.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
README.md,sha256=tnUKuLBglDo8JYVwHo41G4sifMML4FJHI6Ooq-3w3fM,3000
|
|
2
|
+
install.sh,sha256=BUmABEByBiPIMClnTsIdlLXcxPvmlsZZeDfR7i3Wq1E,1344
|
|
3
|
+
requirements.txt,sha256=te4vBKcMGbV2dXiUeibHgFvguvTPiyhvDSbajOMVkEc,30
|
|
4
|
+
bunny2fmc/__init__.py,sha256=eWPc6iHJTxcyB9GSsBbdoZYfdEAtpnHE0h4SsOoZP7c,134
|
|
5
|
+
bunny2fmc/cli.py,sha256=W1AyU4Lc0IMj7PWykyT0mF2Vq3OQO_mMvox5NKayq-A,29376
|
|
6
|
+
bunny2fmc/config.py,sha256=pvYQtJYuSexEbf8FaA-ywGsIbf0Fbkv7ibwWfgtSMsM,10225
|
|
7
|
+
bunny2fmc/setup_helper.py,sha256=DXt8DUI2J4RWjDsaIkJqajevr9gttDMbUQ0FejxfaBc,1038
|
|
8
|
+
bunny2fmc/sync_engine.py,sha256=PZY8PiLQjX59jK4pimWPymNx_aTJpNomcV5c4u22oKs,11379
|
|
9
|
+
bunny2fmc-1.3.21.dist-info/licenses/LICENSE,sha256=2_vaDeZJ15RDU_6C1r5IJ7urPUt4hHeMrUd92xwWcwQ,1080
|
|
10
|
+
guide/INSTALL.md,sha256=GS_8SL3Z7sOmG0fA8Glrv4-06PBqD0ECqIDm6URWuvo,5034
|
|
11
|
+
bunny2fmc-1.3.21.dist-info/METADATA,sha256=r0plpm3_uoI0WiFYA1QKR1dBy7tVgvkO21IJZEohnm0,4329
|
|
12
|
+
bunny2fmc-1.3.21.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
13
|
+
bunny2fmc-1.3.21.dist-info/entry_points.txt,sha256=ZjZFEAAugvnna7HHbYcfivJGJway3qgM-S-B2lf9akI,49
|
|
14
|
+
bunny2fmc-1.3.21.dist-info/top_level.txt,sha256=7a2i3_fKlFFNKUmSEDFbwXI_CXPEcUsrIisHNLEAXtM,10
|
|
15
|
+
bunny2fmc-1.3.21.dist-info/RECORD,,
|
guide/INSTALL.md
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# bunny2fmc - Installation Guide
|
|
2
|
+
|
|
3
|
+
## Quick Install (3 commands)
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
sudo apt install pipx
|
|
7
|
+
pipx install bunny2fmc
|
|
8
|
+
bunny2fmc --setup
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Before You Start
|
|
14
|
+
|
|
15
|
+
### Server Requirements
|
|
16
|
+
|
|
17
|
+
- [ ] Linux server (Ubuntu/Debian recommended)
|
|
18
|
+
- [ ] Python 3.8+ installed
|
|
19
|
+
- [ ] sudo access
|
|
20
|
+
- [ ] cron available
|
|
21
|
+
- [ ] Network access to FMC and internet
|
|
22
|
+
|
|
23
|
+
### Cisco FMC Setup (IMPORTANT!)
|
|
24
|
+
|
|
25
|
+
Create a **dedicated API user** in FMC before installation:
|
|
26
|
+
|
|
27
|
+
1. **System → Users → Add User**
|
|
28
|
+
2. Fill in:
|
|
29
|
+
- Username: `bunny2fmc_sync`
|
|
30
|
+
- Password: [choose strong password - save it!]
|
|
31
|
+
- Role: **Network Admin** (or Maintenance User)
|
|
32
|
+
- Authentication: **Local**
|
|
33
|
+
3. Click **Save**
|
|
34
|
+
|
|
35
|
+
**IMPORTANT:** Don't use your admin account - API login logs out the web UI session!
|
|
36
|
+
|
|
37
|
+
### Have Ready for Setup
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
FMC Hostname: [e.g., fmc.company.com]
|
|
41
|
+
FMC Username: bunny2fmc_sync
|
|
42
|
+
FMC Password: [the password you chose]
|
|
43
|
+
Dynamic Object Name: BunnyCDN_Dynamic
|
|
44
|
+
Sync Interval: [in minutes]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Detailed Installation
|
|
50
|
+
|
|
51
|
+
### 1. Install pipx
|
|
52
|
+
|
|
53
|
+
**Ubuntu/Debian:**
|
|
54
|
+
```bash
|
|
55
|
+
sudo apt install pipx
|
|
56
|
+
pipx ensurepath
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**macOS:**
|
|
60
|
+
```bash
|
|
61
|
+
brew install pipx
|
|
62
|
+
pipx ensurepath
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Open a new terminal after `ensurepath`.
|
|
66
|
+
|
|
67
|
+
### 2. Install bunny2fmc
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pipx install bunny2fmc
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 3. Run Setup
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
bunny2fmc --setup
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
You will be asked:
|
|
80
|
+
- **FMC IP/hostname** - e.g., `192.168.1.100` or `fmc.company.com`
|
|
81
|
+
- **FMC username** - use `bunny2fmc_sync`
|
|
82
|
+
- **FMC password** - stored securely in OS keyring
|
|
83
|
+
- **Dynamic Object name** - e.g., `BunnyCDN_Dynamic`
|
|
84
|
+
- **IPv6** - y/n (default: n)
|
|
85
|
+
- **Sync interval** - enter minutes between syncs
|
|
86
|
+
- **Bunny IPv4 API URL** - default: https://bunnycdn.com/api/system/edgeserverlist
|
|
87
|
+
- **Bunny IPv6 API URL** - default: https://bunnycdn.com/api/system/edgeserverlist/ipv6
|
|
88
|
+
- **Enable scheduled sync** - y/n (enables automatic cron job)
|
|
89
|
+
|
|
90
|
+
### 4. Test
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
bunny2fmc --run # Run sync now
|
|
94
|
+
bunny2fmc --logs # See what happened
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Using the Dynamic Object
|
|
100
|
+
|
|
101
|
+
Once bunny2fmc creates and syncs the Dynamic Object with BunnyCDN IP addresses, you can use it in firewall rules.
|
|
102
|
+
|
|
103
|
+
### Adding to Access Rules
|
|
104
|
+
|
|
105
|
+
1. **FMC → Policies → Access Control**
|
|
106
|
+
2. Create or edit an access rule
|
|
107
|
+
3. In the rule definition, add the Dynamic Object:
|
|
108
|
+
- **Source** - Leave as "Any" or specify your network
|
|
109
|
+
- **Destination** - Click "Add" → select your Dynamic Object (e.g., `BunnyCDN_Dynamic`)
|
|
110
|
+
- **Service/Port** - HTTP (80), HTTPS (443), or custom
|
|
111
|
+
- **Protocol** - TCP
|
|
112
|
+
|
|
113
|
+
### 5-Tuple Matching
|
|
114
|
+
|
|
115
|
+
The firewall rule matches traffic using these 5 components:
|
|
116
|
+
|
|
117
|
+
| Component | Example | Purpose |
|
|
118
|
+
|-----------|---------|---------|
|
|
119
|
+
| **Source IP** | Internal network (Any) | Where traffic originates |
|
|
120
|
+
| **Destination IP** | BunnyCDN_Dynamic | Where traffic goes (Dynamic Object) |
|
|
121
|
+
| **Source Port** | Any | Which port traffic leaves from |
|
|
122
|
+
| **Destination Port** | 80, 443 | Which port traffic reaches |
|
|
123
|
+
| **Protocol** | TCP | Transport protocol (TCP/UDP) |
|
|
124
|
+
|
|
125
|
+
### Example Rule
|
|
126
|
+
|
|
127
|
+
**Allow internal users to BunnyCDN:**
|
|
128
|
+
- Source: `Internal-Networks` (or Any)
|
|
129
|
+
- Destination: `BunnyCDN_Dynamic` (your Dynamic Object)
|
|
130
|
+
- Service: `HTTPS` (port 443, TCP)
|
|
131
|
+
- Action: **Allow**
|
|
132
|
+
|
|
133
|
+
The Dynamic Object will automatically update every time bunny2fmc syncs, keeping your rules current with BunnyCDN's latest edge servers without manual changes.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## File Locations
|
|
138
|
+
|
|
139
|
+
Everything is stored in `~/bunny2fmc/`:
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
~/bunny2fmc/
|
|
143
|
+
├── config.json # Configuration
|
|
144
|
+
├── logs/ # Log files
|
|
145
|
+
└── guide/ # Documentation
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Commands
|
|
151
|
+
|
|
152
|
+
| Command | Description |
|
|
153
|
+
|---------|-------------|
|
|
154
|
+
| `bunny2fmc --setup` | Interactive configuration |
|
|
155
|
+
| `bunny2fmc --run` | Run sync now |
|
|
156
|
+
| `bunny2fmc --start` | Start cron job |
|
|
157
|
+
| `bunny2fmc --stop` | Stop cron job |
|
|
158
|
+
| `bunny2fmc --status` | Show cron job status and last sync time |
|
|
159
|
+
| `bunny2fmc --config` | Show configuration |
|
|
160
|
+
| `bunny2fmc --logs` | View logs |
|
|
161
|
+
| `bunny2fmc --help` | All commands |
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Troubleshooting
|
|
166
|
+
|
|
167
|
+
**pipx not found:**
|
|
168
|
+
```bash
|
|
169
|
+
pipx ensurepath
|
|
170
|
+
source ~/.bashrc
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**bunny2fmc not found:**
|
|
174
|
+
```bash
|
|
175
|
+
export PATH="$PATH:$HOME/.local/bin"
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**Can't connect to FMC:**
|
|
179
|
+
- Check firewall allows port 443
|
|
180
|
+
- Check FMC hostname/IP is correct
|
|
181
|
+
- Test: `curl -k https://fmc.company.com/api/fmc_platform/v1/info`
|
|
182
|
+
|
|
183
|
+
**Dynamic Object not created:**
|
|
184
|
+
- Check cron is running: `crontab -l`
|
|
185
|
+
- Check logs: `bunny2fmc --logs`
|
|
186
|
+
- Run manually: `bunny2fmc --run`
|
|
187
|
+
|
|
188
|
+
**Upgrade:**
|
|
189
|
+
```bash
|
|
190
|
+
pipx upgrade bunny2fmc
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**Uninstall:**
|
|
194
|
+
```bash
|
|
195
|
+
pipx uninstall bunny2fmc
|
|
196
|
+
rm -rf ~/bunny2fmc/
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Version History
|
|
202
|
+
|
|
203
|
+
### v1.3.20 (January 2026)
|
|
204
|
+
- **Configurable Bunny API endpoints**: Can now override IPv4/IPv6 API URLs during setup
|
|
205
|
+
- **Improved input handling**: Fixed backspace/delete key issues in setup prompts
|
|
206
|
+
- **Enhanced setup**: Added Bunny API URL configuration with sensible defaults
|
|
207
|
+
- Default IPv4 URL: `https://bunnycdn.com/api/system/edgeserverlist`
|
|
208
|
+
- Default IPv6 URL: `https://bunnycdn.com/api/system/edgeserverlist/ipv6`
|
install.sh
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# bunny2fmc Installation Script for Linux/macOS
|
|
3
|
+
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
echo "========================================="
|
|
7
|
+
echo "bunny2fmc Installation Script"
|
|
8
|
+
echo "========================================="
|
|
9
|
+
echo ""
|
|
10
|
+
|
|
11
|
+
# Check if Python is installed
|
|
12
|
+
if ! command -v python3 &> /dev/null; then
|
|
13
|
+
echo "❌ Error: Python 3 is not installed"
|
|
14
|
+
echo "Please install Python 3.8 or later and try again"
|
|
15
|
+
exit 1
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
PYTHON_VERSION=$(python3 --version | cut -d' ' -f2)
|
|
19
|
+
echo "✓ Found Python $PYTHON_VERSION"
|
|
20
|
+
echo ""
|
|
21
|
+
|
|
22
|
+
# Create virtual environment
|
|
23
|
+
echo "Creating virtual environment..."
|
|
24
|
+
python3 -m venv venv
|
|
25
|
+
echo "✓ Virtual environment created"
|
|
26
|
+
echo ""
|
|
27
|
+
|
|
28
|
+
# Activate virtual environment
|
|
29
|
+
echo "Activating virtual environment..."
|
|
30
|
+
source venv/bin/activate
|
|
31
|
+
echo "✓ Virtual environment activated"
|
|
32
|
+
echo ""
|
|
33
|
+
|
|
34
|
+
# Install bunny2fmc
|
|
35
|
+
echo "Installing bunny2fmc and dependencies..."
|
|
36
|
+
pip install --upgrade pip
|
|
37
|
+
pip install bunny2fmc
|
|
38
|
+
echo "✓ Installation complete"
|
|
39
|
+
echo ""
|
|
40
|
+
|
|
41
|
+
echo "========================================="
|
|
42
|
+
echo "Installation Successful!"
|
|
43
|
+
echo "========================================="
|
|
44
|
+
echo ""
|
|
45
|
+
echo "Next steps:"
|
|
46
|
+
echo "1. Activate the virtual environment:"
|
|
47
|
+
echo " source venv/bin/activate"
|
|
48
|
+
echo ""
|
|
49
|
+
echo "2. Run the setup wizard:"
|
|
50
|
+
echo " bunny2fmc --setup"
|
|
51
|
+
echo ""
|
|
52
|
+
echo "3. View help and available commands:"
|
|
53
|
+
echo " bunny2fmc --help"
|
|
54
|
+
echo ""
|
requirements.txt
ADDED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: bunny2fmc
|
|
3
|
-
Version: 1.0.8
|
|
4
|
-
Summary: Sync BunnyCDN edge IPs to Cisco FMC Dynamic Objects with secure credential management and scheduling
|
|
5
|
-
Author: Kasper Elsborg -Wingmen
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/wingmen/bunny-sync-fmc
|
|
8
|
-
Project-URL: Repository, https://github.com/wingmen/bunny-sync-fmc
|
|
9
|
-
Keywords: bunny,fmc,cisco,edge-server,dynamic-object
|
|
10
|
-
Classifier: Development Status :: 4 - Beta
|
|
11
|
-
Classifier: Environment :: Console
|
|
12
|
-
Classifier: Intended Audience :: System Administrators
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
-
Classifier: Topic :: System :: Networking :: Firewalls
|
|
20
|
-
Requires-Python: >=3.8
|
|
21
|
-
Description-Content-Type: text/markdown
|
|
22
|
-
License-File: LICENSE
|
|
23
|
-
Requires-Dist: wingpy>=0.3.0
|
|
24
|
-
Requires-Dist: requests>=2.25.0
|
|
25
|
-
Requires-Dist: python-dotenv>=0.19.0
|
|
26
|
-
Requires-Dist: keyring>=23.0.0
|
|
27
|
-
Requires-Dist: keyrings.alt>=5.0
|
|
28
|
-
Provides-Extra: dev
|
|
29
|
-
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
30
|
-
Requires-Dist: black>=22.0; extra == "dev"
|
|
31
|
-
Requires-Dist: flake8>=4.0; extra == "dev"
|
|
32
|
-
Dynamic: license-file
|
|
33
|
-
|
|
34
|
-
# 🐰 bunny2fmc
|
|
35
|
-
|
|
36
|
-
Synkroniserer BunnyCDN edge server IP-adresser til en Cisco FMC Dynamic Object med sikker credential-gempling og automatisk scheduling.
|
|
37
|
-
|
|
38
|
-
## Hvad gør scriptet?
|
|
39
|
-
|
|
40
|
-
1. Henter aktuelle IPv4 (og evt. IPv6) adresser fra BunnyCDN's API
|
|
41
|
-
2. Opretter/finder Dynamic Object på FMC
|
|
42
|
-
3. Sammenligner nuværende mappings med Bunny's liste
|
|
43
|
-
4. Tilføjer nye og fjerner forældede IP'er
|
|
44
|
-
5. Ingen deploy nødvendig - Dynamic Objects opdateres on-the-fly
|
|
45
|
-
6. **Sikker gempling**: Credentials gemmesto i OS Keyring (Windows Credential Manager / Linux Secret Service)
|
|
46
|
-
7. **Automatisk scheduling**: Konfigurer interval ved første setup, køres via cron
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## Installation
|
|
51
|
-
|
|
52
|
-
### Option 1: Fra PyPI (Anbefalet)
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
# Opret virtual environment
|
|
56
|
-
python3 -m venv venv
|
|
57
|
-
|
|
58
|
-
# Aktivér venv (VIGTIG - skal gøres før hver brug!)
|
|
59
|
-
source venv/bin/activate # Linux/macOS
|
|
60
|
-
# eller
|
|
61
|
-
venv\Scripts\activate # Windows
|
|
62
|
-
|
|
63
|
-
# Installer bunny2fmc
|
|
64
|
-
pip install bunny2fmc
|
|
65
|
-
|
|
66
|
-
# Verificer installation
|
|
67
|
-
bunny2fmc --version
|
|
68
|
-
bunny2fmc --help
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Option 2: Fra source (Local development)
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
# Clone repository
|
|
75
|
-
cd /path/to/Bunny_Sync_FMC
|
|
76
|
-
|
|
77
|
-
# Opret virtual environment
|
|
78
|
-
python3 -m venv venv
|
|
79
|
-
|
|
80
|
-
# Aktivér venv (VIGTIG!)
|
|
81
|
-
source venv/bin/activate # Linux/macOS
|
|
82
|
-
# eller
|
|
83
|
-
venv\Scripts\activate # Windows
|
|
84
|
-
|
|
85
|
-
# Installer som development package
|
|
86
|
-
pip install -e .
|
|
87
|
-
|
|
88
|
-
# Verificer installation
|
|
89
|
-
bunny2fmc --version
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### ⚠️ VIGTIG: Aktivér venv før brug
|
|
93
|
-
|
|
94
|
-
**Du SKAL aktivere venv før du kan bruge bunny2fmc!**
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
# Linux/macOS
|
|
98
|
-
source venv/bin/activate
|
|
99
|
-
|
|
100
|
-
# Windows
|
|
101
|
-
venv\Scripts\activate
|
|
102
|
-
|
|
103
|
-
# Nu kan du bruge kommandoen:
|
|
104
|
-
bunny2fmc --help
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
Når venv er aktiveret, vises `(venv)` i din prompt
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## Distribution Strategy
|
|
111
|
-
|
|
112
|
-
### Repository Struktur
|
|
113
|
-
|
|
114
|
-
- **Privat GitHub** (`https://github.com/IronKeyVault/Bunny_Sync_FMC`):
|
|
115
|
-
- Source of truth for alt udvikling
|
|
116
|
-
- Indeholder hele kodebase (gamle scripts, notes, configs)
|
|
117
|
-
- Kun for interne team medlemmer
|
|
118
|
-
|
|
119
|
-
- **PyPI** (`https://pypi.org/project/bunny2fmc`):
|
|
120
|
-
- Public distribution punkt
|
|
121
|
-
- Alle brugere kan installere med: `pip install bunny2fmc`
|
|
122
|
-
- Synkroniseret fra privat repo
|
|
123
|
-
|
|
124
|
-
### Release Workflow
|
|
125
|
-
|
|
126
|
-
Når du er klar til at udgive en ny version:
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
./release.sh
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
Scriptet vil:
|
|
133
|
-
1. Spørge for nyt versionsnummer (f.eks. 1.0.2)
|
|
134
|
-
2. Opdatere `pyproject.toml` og `bunny2fmc/__init__.py`
|
|
135
|
-
3. Committe og pushe til GitHub
|
|
136
|
-
4. Bygge pakken
|
|
137
|
-
5. Uploade til PyPI
|
|
138
|
-
|
|
139
|
-
**Eksempel:**
|
|
140
|
-
```
|
|
141
|
-
./release.sh
|
|
142
|
-
Enter new version (e.g., 1.0.2): 1.0.2
|
|
143
|
-
✓ Release v1.0.2 complete
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## Hvornår kan jeg slette den gamle public repo?
|
|
149
|
-
|
|
150
|
-
Du kan slette `https://github.com/IronKeyVault/bunny2fmc` når:
|
|
151
|
-
|
|
152
|
-
1. ✅ **PyPI har den seneste version**
|
|
153
|
-
- Verificer på https://pypi.org/project/bunny2fmc/
|
|
154
|
-
- Alle nye releases går direkte til PyPI via `release.sh`
|
|
155
|
-
|
|
156
|
-
2. ✅ **Ingen users refererer til det**
|
|
157
|
-
- Hvis andre har installeringer fra Git URL, skal de updateres til:
|
|
158
|
-
- `pip install bunny2fmc` (fra PyPI i stedet)
|
|
159
|
-
|
|
160
|
-
3. ✅ **Du er sikker på at PyPI er det eneste public distribution point**
|
|
161
|
-
- Alt udvikling fortsætter i privat repo
|
|
162
|
-
- Releases håndteres via `./release.sh`
|
|
163
|
-
|
|
164
|
-
### Sletning
|
|
165
|
-
|
|
166
|
-
Når du er 100% sikker, kan du slette repoet:
|
|
167
|
-
|
|
168
|
-
1. Gå til https://github.com/IronKeyVault/bunny2fmc
|
|
169
|
-
2. Settings → Danger Zone → Delete Repository
|
|
170
|
-
3. Bekræft ved at skrive repo-navnet
|
|
171
|
-
|
|
172
|
-
**Efter sletning:**
|
|
173
|
-
- Alt udvikling/history ligger stadig på privat repo
|
|
174
|
-
- Alle brugere bruger PyPI (bedst praksis)
|
|
175
|
-
- Enklere repository-management
|
|
176
|
-
|
bunny2fmc-1.0.8.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
bunny2fmc/__init__.py,sha256=fVsHsYtI5haE_NeyaMKlYiaAROUctiIYibLRdvIyPTg,133
|
|
2
|
-
bunny2fmc/cli.py,sha256=p8Mhve3L9_6xEtu2712LLp7S3nC8hfyXJBc-wmC7UtY,10111
|
|
3
|
-
bunny2fmc/config.py,sha256=rvpkAGZv2NaRChXyO9u4dnQl5wnvExToMvlCIJZMlpQ,4803
|
|
4
|
-
bunny2fmc/sync_engine.py,sha256=zCAJ0LrKgHQ6zOWHVOfTvvlHgNkILYyFq0ftdPC3Pt4,7024
|
|
5
|
-
bunny2fmc-1.0.8.dist-info/licenses/LICENSE,sha256=2_vaDeZJ15RDU_6C1r5IJ7urPUt4hHeMrUd92xwWcwQ,1080
|
|
6
|
-
bunny2fmc-1.0.8.dist-info/METADATA,sha256=EQXJepPA3AAa1Q38W-o_DPQx7fcTVUH0vC4_BpB05d8,4766
|
|
7
|
-
bunny2fmc-1.0.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
-
bunny2fmc-1.0.8.dist-info/entry_points.txt,sha256=ZjZFEAAugvnna7HHbYcfivJGJway3qgM-S-B2lf9akI,49
|
|
9
|
-
bunny2fmc-1.0.8.dist-info/top_level.txt,sha256=7a2i3_fKlFFNKUmSEDFbwXI_CXPEcUsrIisHNLEAXtM,10
|
|
10
|
-
bunny2fmc-1.0.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|