|
1 | 1 | # CoreLayer.Citrix.Adc.NodeBackup
|
2 | 2 |
|
3 | 3 |
|
4 |
| -## Introduction |
| 4 | +## 1. Introduction |
5 | 5 |
|
6 | 6 | This project allows you to automatically backup your Citrix ADC (formerly known as NetScaler) configuration to a filepath available to the client.
|
7 | 7 | Developed in .NetCore using C#, we provide a fully running application in several flavors:
|
8 | 8 | - Single-file executables for Linux, MacOS and Windows
|
9 | 9 | - Dotnet-dependent DLL
|
10 | 10 | - Linux container (https://hub.docker.com/r/corelayer/corelayer-citrix-adc-nodebackupservice)
|
11 | 11 |
|
12 |
| -## Prerequisites |
13 |
| -### Citrix ADC Configuration |
| 12 | +--- |
| 13 | +## 2. Configuration |
| 14 | +### 2.1. Prerequisites |
| 15 | +#### 2.1.1. Citrix ADC |
14 | 16 |
|
15 | 17 | For optimal security, create a separate user on Citrix ADC for backup purposes.
|
16 |
| -The command policy below limits the allowed commands to the absolute minimum: |
| 18 | +The command policy below limits the allowed commands to the absolute minimum. |
17 | 19 |
|
18 |
| -``` |
| 20 | +*Replace <username> and <password> with values of your own choosing.* |
| 21 | + |
| 22 | +```text |
19 | 23 | add system cmdPolicy corelayer_backup ALLOW "(^(show\\s+system\\s+backup)|(create|rm)\\s+system\\s+backup\\s+.*)|(^show\\ssystem\\sfile\\s[\\w\\.-]+\\s-fileLocation\\s\"/var/ns_sys_backup\")"
|
20 | 24 |
|
21 | 25 |
|
22 | 26 | add system user <username> <password> -externalAuth DISABLED -timeout 900 -allowedManagementInterface API
|
23 | 27 | bind system user backup corelayer_backup 0
|
24 | 28 | ```
|
25 | 29 |
|
26 |
| -## Running the application |
27 |
| -### Docker-compose |
28 |
| -#### Template configuration |
29 |
| -``` |
| 30 | +### 2.2. NodeBackup |
| 31 | +NodeBackup can be configured using the following options. |
| 32 | + |
| 33 | +Depending on your enviroment, you may choose to provide values for these parameters in one of the following ways: |
| 34 | + |
| 35 | +|Provider|Target| |
| 36 | +|---|---| |
| 37 | +|Configuration file|appsettings.json| |
| 38 | +|Environment variables|Environment variable per option| |
| 39 | +|Command-line parameters|Parameter per option| |
| 40 | + |
| 41 | +#### 2.2.1. Node Configuration: |
| 42 | + |
| 43 | +|Parameter|Value|Default|Description| |
| 44 | +|---|---|---|---| |
| 45 | +|Organization|CoreLayer|N/A|Organization Name| |
| 46 | +|Environment|Production|N/A|ADC Environment Name| |
| 47 | +|NodeName|nsprod|N/A|ADC Node Name| |
| 48 | +|NodeAddress|https://nsprod.prd.corelayer.local|N/A|ADC NSIP or URL| |
| 49 | +|Username|backup|N/A|Username| |
| 50 | +|Password|backup|N/A|Password| |
| 51 | +|CertificateValidation|Disabled|Enabled|Validate ADC SSL certificate (Disable for self-signed certificates| |
| 52 | + |
| 53 | +#### 2.2.2. Backup Configuration: |
| 54 | + |
| 55 | +|Parameter|Value|Default|Description| |
| 56 | +|---|---|---|---| |
| 57 | +|Start|00:00|N/A|Start time for backups (HH:MM)| |
| 58 | +|Interval|3600|3600|Interval in seconds, must be factor of 300 (5minutes)| |
| 59 | +|BasePath|/var/corelayer/adc/nodebackup|N/A|Base path to store backups| |
| 60 | +|CreateSubdirectoryForNode|true|true|Create a subdirectory for the node| |
| 61 | + |
| 62 | +#### 2.2.3. Prometheus Configuration: |
| 63 | + |
| 64 | +|Parameter|Value|Default|Description| |
| 65 | +|---|---|---|---| |
| 66 | +|Enable Metrics Server|true|true|Enable the Prometheus Metrics Endpoint| |
| 67 | +|Metrics Server Port|5000|5000|TCP Endpoint for the Metrics server| |
| 68 | +|Metrics Server Use https|false|true|Run the TCP Endpoint with https| |
| 69 | +|Metrics Name Prefix|corelayer|corelayer|Prefix for the metric names| |
| 70 | + |
| 71 | +## 3. Platforms |
| 72 | +### 3.1. Docker |
| 73 | +#### 3.1.1. Docker-compose |
| 74 | +##### 3.1.1.1. Template configuration |
| 75 | + |
| 76 | +- *Replace __nodename__ with the actual node name.* |
| 77 | +- *Replace the __hostport__ with the desired external port number.* |
| 78 | + |
| 79 | +```yaml |
30 | 80 | version: '3'
|
31 | 81 | services:
|
32 |
| - nsprod-nodebackup-service: |
| 82 | + nodename-nodebackup-service: |
33 | 83 | image: corelayer/corelayer-citrix-adc-nodebackupservice:dev-latest
|
34 |
| - container_name: nsprod-nodebackupservice |
| 84 | + container_name: nodename-nodebackupservice |
35 | 85 | environment:
|
36 | 86 | - Logging__LogLevel__Default=Information
|
37 |
| - - NodeBackupConfiguration__Node__OwnerName=Organization |
38 |
| - - NodeBackupConfiguration__Node__EnvironmentName=Environment |
39 |
| - - NodeBackupConfiguration__Node__NodeName=NodeName |
40 |
| - - NodeBackupConfiguration__Node__NodeAddress=(http|https)://(IP|URL) |
41 |
| - - NodeBackupConfiguration__Node__Username=Username |
42 |
| - - NodeBackupConfiguration__Node__Password=Password |
43 |
| - - NodeBackupConfiguration__Node__CertificateValidation=(Enabled|Disabled) |
44 |
| - - NodeBackupConfiguration__Backup__Start=(HH:mm) |
45 |
| - - NodeBackupConfiguration__Backup__Interval=1800 |
46 |
| - - NodeBackupConfiguration__Backup__BasePath=/var/corelayer/adc/nodebackup/ |
47 |
| - - NodeBackupConfiguration__Backup__CreateSubdirectoryForNode=(true | false) |
48 |
| - - NodeBackupConfiguration__Prometheus__EnableMetricsServer=(true | false) |
49 |
| - - NodeBackupConfiguration__Prometheus__NamePrefix=corelayer |
| 87 | + - NodeBackupConfiguration__Node__OwnerName= |
| 88 | + - NodeBackupConfiguration__Node__EnvironmentName= |
| 89 | + - NodeBackupConfiguration__Node__NodeName= |
| 90 | + - NodeBackupConfiguration__Node__NodeAddress= |
| 91 | + - NodeBackupConfiguration__Node__Username= |
| 92 | + - NodeBackupConfiguration__Node__Password= |
| 93 | + - NodeBackupConfiguration__Node__CertificateValidation= |
| 94 | + - NodeBackupConfiguration__Backup__Start= |
| 95 | + - NodeBackupConfiguration__Backup__Interval= |
| 96 | + - NodeBackupConfiguration__Backup__BasePath= |
| 97 | + - NodeBackupConfiguration__Backup__CreateSubdirectoryForNode= |
| 98 | + - NodeBackupConfiguration__Prometheus__MetricsServer__Enabled= |
| 99 | + - NodeBackupConfiguration__Prometheus__MetricsServer__Port=5000 |
| 100 | + - NodeBackupConfiguration__Prometheus__MetricsServer__UseHttps= |
| 101 | + - NodeBackupConfiguration__Prometheus__NamePrefix= |
50 | 102 | volumes:
|
51 | 103 | - $PWD:/var/corelayer/adc/nodebackup
|
| 104 | + ports: |
| 105 | + - "hostport:5000/tcp" |
52 | 106 | ```
|
53 | 107 |
|
54 |
| -#### Example |
55 |
| -Example values for the configuration |
56 |
| -- Organization: CoreLayer |
57 |
| -- Environment: Production |
58 |
| -- NodeName: nsprod |
59 |
| -- NodeAddress: https://nsprod.prd.corelayer.local |
60 |
| -- Username: backup |
61 |
| -- Password: backup |
62 |
| -- CertificateValidation: false |
63 |
| -- Start: 00:00 (Hours:Minutes) |
64 |
| -- Interval: 1800 (in seconds, must be factor of 300) |
65 |
| -- BasePath: /var/corelayer/adc/nodebackup |
66 |
| -- CreateSubdirectoryForNode: Enabled |
67 |
| -- EnableMetricsServer: true |
68 |
| -- NamePrefix: corelayer (metric names prefix) |
| 108 | +#### 2.3.2 Example |
69 | 109 |
|
70 |
| -``` |
| 110 | +```yaml |
71 | 111 | version: '3'
|
72 | 112 | services:
|
73 |
| - nsprod-nodebackup-service: |
| 113 | + <nodename>-nodebackup-service: |
74 | 114 | image: corelayer/corelayer-citrix-adc-nodebackupservice:dev-latest
|
75 |
| - container_name: nsprod-nodebackupservice |
| 115 | + container_name: <nodename>-nodebackupservice |
76 | 116 | environment:
|
77 | 117 | - Logging__LogLevel__Default=Information
|
78 | 118 | - NodeBackupConfiguration__Node__OwnerName=CoreLayer
|
79 | 119 | - NodeBackupConfiguration__Node__EnvironmentName=Production
|
80 |
| - - NodeBackupConfiguration__Node__NodeName=nsprod |
81 |
| - - NodeBackupConfiguration__Node__NodeAddress=https://nsprod.prd.corelayer.local |
| 120 | + - NodeBackupConfiguration__Node__NodeName=nsprod01 |
| 121 | + - NodeBackupConfiguration__Node__NodeAddress=https://nsprod01.corelayer.local |
82 | 122 | - NodeBackupConfiguration__Node__Username=backup
|
83 | 123 | - NodeBackupConfiguration__Node__Password=backup
|
84 |
| - - NodeBackupConfiguration__Node__CertificateValidation=disabled |
| 124 | + - NodeBackupConfiguration__Node__CertificateValidation=Enabled |
85 | 125 | - NodeBackupConfiguration__Backup__Start=00:00
|
86 |
| - - NodeBackupConfiguration__Backup__Interval=1800 |
87 |
| - - NodeBackupConfiguration__Backup__BasePath=/var/corelayer/adc/nodebackup/ |
| 126 | + - NodeBackupConfiguration__Backup__Interval=3600 |
| 127 | + - NodeBackupConfiguration__Backup__BasePath=/var/corelayer/adc/nodebackup |
88 | 128 | - NodeBackupConfiguration__Backup__CreateSubdirectoryForNode=true
|
89 |
| - - NodeBackupConfiguration__Prometheus__EnableMetricsServer=true |
| 129 | + - NodeBackupConfiguration__Prometheus__MetricsServer__Enabled=true |
| 130 | + - NodeBackupConfiguration__Prometheus__MetricsServer__Port=5000 |
| 131 | + - NodeBackupConfiguration__Prometheus__MetricsServer__UseHttps=false |
90 | 132 | - NodeBackupConfiguration__Prometheus__NamePrefix=corelayer
|
91 | 133 | volumes:
|
92 | 134 | - $PWD:/var/corelayer/adc/nodebackup
|
| 135 | + ports: |
| 136 | + - "5000:5000/tcp" |
93 | 137 | ```
|
0 commit comments