@lamalibre/create-portlama 1.0.7 → 1.0.9
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.
package/package.json
CHANGED
package/src/tasks/harden.js
CHANGED
|
@@ -59,7 +59,7 @@ export function hardenTasks(ctx, task) {
|
|
|
59
59
|
const isActive = stdout.includes('Status: active');
|
|
60
60
|
if (!isActive) return false;
|
|
61
61
|
|
|
62
|
-
const requiredPorts = ['22/tcp', '443/tcp', '9292/tcp'];
|
|
62
|
+
const requiredPorts = ['22/tcp', '80/tcp', '443/tcp', '9292/tcp'];
|
|
63
63
|
const allPresent = requiredPorts.every((port) => {
|
|
64
64
|
// Match lines like "22/tcp ALLOW Anywhere"
|
|
65
65
|
const regex = new RegExp(`^${port.replace('/', '\\/')}\\s+ALLOW`, 'm');
|
|
@@ -74,7 +74,7 @@ export function hardenTasks(ctx, task) {
|
|
|
74
74
|
return false;
|
|
75
75
|
},
|
|
76
76
|
task: async (_ctx, subtask) => {
|
|
77
|
-
const requiredPorts = ['22/tcp', '443/tcp', '9292/tcp'];
|
|
77
|
+
const requiredPorts = ['22/tcp', '80/tcp', '443/tcp', '9292/tcp'];
|
|
78
78
|
|
|
79
79
|
// Determine if UFW is currently active
|
|
80
80
|
let isActive = false;
|
|
@@ -106,13 +106,13 @@ export function hardenTasks(ctx, task) {
|
|
|
106
106
|
await execa('ufw', ['default', 'deny', 'incoming']);
|
|
107
107
|
await execa('ufw', ['default', 'allow', 'outgoing']);
|
|
108
108
|
|
|
109
|
-
subtask.output = 'Allowing ports 22, 443, 9292...';
|
|
109
|
+
subtask.output = 'Allowing ports 22, 80, 443, 9292...';
|
|
110
110
|
for (const port of requiredPorts) {
|
|
111
111
|
await execa('ufw', ['allow', port]);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
await execa('ufw', ['--force', 'enable']);
|
|
115
|
-
subtask.output = 'UFW enabled with ports 22
|
|
115
|
+
subtask.output = 'UFW enabled with ports 22, 80, 443, 9292 allowed';
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
118
|
rendererOptions: { persistentOutput: true },
|