Skip to content

Commit 81e8f2c

Browse files
committedDec 19, 2024
Update README.md etc
1 parent ce1b231 commit 81e8f2c

File tree

3 files changed

+73
-55
lines changed

3 files changed

+73
-55
lines changed
 

‎README.md

+23-30
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,27 @@ See also this: [sefinek/Cloudflare-WAF-To-AbuseIPDB](https://github.com/sefinek/
1010
1111

1212
## 📋 Requirements
13-
- Node.js + npm
14-
- Git
15-
16-
17-
## 🧪 Tested operating systems
18-
- **Ubuntu Server:** 20.04 & 22.04
19-
20-
*If the distribution you're using to run this tool isn't listed here but works correctly, please create a new [Issue](https://github.com/sefinek/UFW-AbuseIPDB-Reporter/issues) or submit a [Pull request](https://github.com/sefinek/UFW-AbuseIPDB-Reporter/pulls).*
13+
- [Node.js + npm](https://nodejs.org)
14+
- [Git](https://git-scm.com)
2115

2216

2317
## 📥 Installation
24-
### curl
25-
```bash
26-
bash <(curl -s https://raw.githubusercontent.com/sefinek/UFW-AbuseIPDB-Reporter/main/install.sh)
27-
```
28-
29-
### wget
3018
```bash
31-
bash <(wget -qO- https://raw.githubusercontent.com/sefinek/UFW-AbuseIPDB-Reporter/main/install.sh)
19+
cd ~
20+
git clone https://github.com/sefinek/UFW-AbuseIPDB-Reporter.git
21+
cd UFW-AbuseIPDB-Reporter
22+
npm install
23+
cp default.config.js config.js
24+
sudo chmod 644 /var/log/ufw.log
25+
node .
26+
^C
27+
npm uninstall corepack -g
28+
npm install pm2 -g
29+
pm2 startup
30+
[Wklej komendę wygenerowana przez pm2 startup]
31+
pm2 save
3232
```
3333

34-
The installation script will automatically download and configure the tool on your machine. During the installation process, you will be prompted to provide an [AbuseIPDB API token](https://www.abuseipdb.com/account/api).
35-
3634

3735
## 🖥️ Usage
3836
After successful installation, the script will run continuously in the background, monitoring UFW logs and automatically reporting malicious IP addresses.
@@ -41,25 +39,20 @@ The tool requires no additional user action after installation. However, it's wo
4139
Servers open to the world are constantly scanned by bots, usually looking for vulnerabilities or other security gaps.
4240
So don't be surprised if the next day, the number of reports to AbuseIPDB exceeds a thousand.
4341

44-
### 🔍 Checking service status
45-
```bash
46-
sudo systemctl status abuseipdb-ufw.service
47-
```
48-
49-
To see the current logs generated by the process, use the command:
42+
### 🔍 Checking logs
5043
```bash
51-
journalctl -u abuseipdb-ufw.service -f
44+
pm2 logs ufw-abuseipdb
5245
```
5346

5447
### 📄 Example report
5548
```
56-
Blocked by UFW (TCP on 80)
57-
Source port: 28586
58-
TTL: 116
59-
Packet length: 48
60-
TOS: 0x08
49+
Blocked by UFW on vserver1 [80/tcp]
50+
Source port: 23639
51+
TTL: 247
52+
Packet length: 40
53+
TOS: 0x00
6154
62-
This report (for 46.174.191.31) was generated by:
55+
This report (for 45.156.129.52) was generated by:
6356
https://github.com/sefinek/UFW-AbuseIPDB-Reporter
6457
```
6558

‎ecosystem.config.js

+26-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1-
module.exports = {};
1+
module.exports = {
2+
apps: [{
3+
name: 'ufw-abuseipdb',
4+
script: './index.js',
5+
6+
// Logging configuration
7+
log_date_format: 'HH:mm:ss.SSS DD.MM.YYYY',
8+
merge_logs: true,
9+
log_file: '/var/log/ufw-abuseipdb/combined.log',
10+
out_file: '/var/log/ufw-abuseipdb/out.log',
11+
error_file: '/var/log/ufw-abuseipdb/error.log',
12+
13+
// Application restart policy settings
14+
wait_ready: true,
15+
autorestart: true,
16+
max_restarts: 10,
17+
min_uptime: 20000,
18+
restart_delay: 5000,
19+
exp_backoff_restart_delay: 3000,
20+
21+
// Environment variables configuration
22+
env: {
23+
NODE_ENV: 'production',
24+
},
25+
}],
26+
};

‎eslint.config.mjs

+24-24
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,42 @@ export default [
1212
},
1313
},
1414
rules: {
15-
'arrow-spacing': [1, { before: true, after: true }],
16-
'comma-dangle': [1, { arrays: 'always-multiline', objects: 'always-multiline' }],
17-
'comma-spacing': 1,
15+
'arrow-spacing': ['warn', { before: true, after: true }],
16+
'comma-dangle': ['warn', { arrays: 'always-multiline', objects: 'always-multiline' }],
17+
'comma-spacing': 'warn',
1818
'comma-style': 'error',
1919
'curly': ['error', 'multi-line', 'consistent'],
2020
'dot-location': ['error', 'property'],
2121
'handle-callback-err': 'off',
22-
'indent': [1, 'tab'],
23-
'keyword-spacing': 1,
22+
'indent': ['warn', 'tab'],
23+
'keyword-spacing': 'warn',
2424
'max-nested-callbacks': ['error', { max: 4 }],
2525
'max-statements-per-line': ['error', { max: 2 }],
2626
'no-console': 'off',
27-
'no-empty': 1,
28-
'no-empty-function': 1,
27+
'no-empty': 'warn',
28+
'no-empty-function': 'warn',
2929
'no-floating-decimal': 'error',
30-
'no-lonely-if': 1,
31-
'no-multi-spaces': 1,
32-
'no-multiple-empty-lines': [1, { max: 3, maxEOF: 1, maxBOF: 0 }],
30+
'no-lonely-if': 'warn',
31+
'no-multi-spaces': 'warn',
32+
'no-multiple-empty-lines': ['warn', { max: 3, maxEOF: 1, maxBOF: 0 }],
3333
'no-shadow': ['error', { allow: ['err', 'resolve', 'reject'] }],
34-
'no-trailing-spaces': 1,
35-
'no-unreachable': 1,
36-
'no-unused-vars': 1,
34+
'no-trailing-spaces': 'warn',
35+
'no-unreachable': 'warn',
36+
'no-unused-vars': 'warn',
3737
'no-use-before-define': ['error', { functions: false, classes: true }],
3838
'no-var': 'error',
39-
'object-curly-spacing': [1, 'always'],
39+
'object-curly-spacing': ['warn', 'always'],
4040
'prefer-const': 'error',
41-
'quotes': [1, 'single'],
42-
'semi': [1, 'always'],
43-
'sort-vars': 1,
44-
'space-before-blocks': 1,
45-
'space-before-function-paren': [1, { anonymous: 'never', named: 'never', asyncArrow: 'always' }],
46-
'space-in-parens': 1,
47-
'space-infix-ops': 1,
48-
'space-unary-ops': 1,
49-
'spaced-comment': 1,
50-
'wrap-regex': 1,
41+
'quotes': ['warn', 'single'],
42+
'semi': ['warn', 'always'],
43+
'sort-vars': 'warn',
44+
'space-before-blocks': 'warn',
45+
'space-before-function-paren': ['warn', { anonymous: 'never', named: 'never', asyncArrow: 'always' }],
46+
'space-in-parens': 'warn',
47+
'space-infix-ops': 'warn',
48+
'space-unary-ops': 'warn',
49+
'spaced-comment': 'warn',
50+
'wrap-regex': 'warn',
5151
'yoda': 'error',
5252
},
5353
ignores: ['node_modules', '*min.js', '*bundle*', 'build/*', 'dist/*'],

0 commit comments

Comments
 (0)
Please sign in to comment.