@fsg-vault/agent 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/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ const commander_1 = require("commander");
|
|
|
5
5
|
const child_process_1 = require("child_process");
|
|
6
6
|
const program = new commander_1.Command();
|
|
7
7
|
program
|
|
8
|
-
.version('1.0.
|
|
8
|
+
.version('1.0.8')
|
|
9
9
|
.description('FSG-Vault Agent: Secure Environment Injection')
|
|
10
10
|
.requiredOption('-k, --key <string>', 'Master Key to decrypt the vault')
|
|
11
11
|
.requiredOption('-a, --api-key <string>', 'API Key to authenticate with the vault server')
|
|
@@ -17,10 +17,23 @@ program
|
|
|
17
17
|
program.parse(process.argv);
|
|
18
18
|
const options = program.opts();
|
|
19
19
|
const [command, ...args] = program.args;
|
|
20
|
+
const VERSION = '1.0.8';
|
|
21
|
+
const BANNER = String.raw `
|
|
22
|
+
________ ________ ________ ___ ___ ________ ___ ___ ___ _________
|
|
23
|
+
|\ _____\\ ____\|\ ____\ |\ \ / /|\ __ \|\ \|\ \|\ \ |\___ ___\
|
|
24
|
+
\ \ \__/\ \ \___|\ \ \___| \ \ \ / / | \ \|\ \ \ \\\ \ \ \\|___ \ \_|
|
|
25
|
+
\ \ __\\ \_____ \ \ \ ___ \ \ \/ / / \ \ __ \ \ \\\ \ \ \ \ \ \
|
|
26
|
+
\ \ \_| \|____|\ \ \ \|\ \ \ \ / / \ \ \ \ \ \ \\\ \ \ \____\ \ \
|
|
27
|
+
\ \__\ ____\_\ \ \_______\ \ \__/ / \ \__\ \__\ \_______\ \_______\ \__\
|
|
28
|
+
\|__| |\_________\|_______| \|__|/ \|__|\|__|\|_______|\|_______|\|__|
|
|
29
|
+
\|_________|
|
|
30
|
+
v${VERSION}
|
|
31
|
+
`;
|
|
20
32
|
async function run() {
|
|
21
|
-
|
|
33
|
+
process.stdout.write('\x1Bc'); // Clear screen
|
|
34
|
+
console.log('\x1b[36m%s\x1b[0m', BANNER);
|
|
35
|
+
console.log('\x1b[33m[1/3]\x1b[0m Connecting to Vault Server...');
|
|
22
36
|
// 1. Fetch Ciphertext from Backend API
|
|
23
|
-
console.log('[fsg-vault] Fetching Ciphertext from Server...');
|
|
24
37
|
let ciphertext = '';
|
|
25
38
|
let iv = '';
|
|
26
39
|
try {
|
|
@@ -40,10 +53,11 @@ async function run() {
|
|
|
40
53
|
iv = data.iv;
|
|
41
54
|
}
|
|
42
55
|
catch (err) {
|
|
43
|
-
console.error('[
|
|
56
|
+
console.error('\x1b[31m[ERROR]\x1b[0m Failed to fetch payload:', err.message);
|
|
44
57
|
process.exit(1);
|
|
45
58
|
}
|
|
46
|
-
console.log('[
|
|
59
|
+
console.log('\x1b[32m[2/3]\x1b[0m Payload retrieved successfully.');
|
|
60
|
+
console.log('\x1b[34m[3/3]\x1b[0m Injecting Secure Memory Proxy...');
|
|
47
61
|
if (command === 'node') {
|
|
48
62
|
const child = (0, child_process_1.spawn)(process.execPath, [
|
|
49
63
|
'--require', __dirname + '/proxy-register.js',
|
package/dist/proxy-register.js
CHANGED
|
@@ -18,7 +18,7 @@ const masterKey = process.env.FSG_MASTER_KEY;
|
|
|
18
18
|
const ciphertext = process.env.FSG_CIPHERTEXT;
|
|
19
19
|
const iv = process.env.FSG_IV;
|
|
20
20
|
if (!masterKey || !ciphertext || !iv) {
|
|
21
|
-
|
|
21
|
+
// Silent fail or minimal log for security
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
24
|
try {
|
|
@@ -30,10 +30,11 @@ else {
|
|
|
30
30
|
delete process.env.FSG_MASTER_KEY;
|
|
31
31
|
delete process.env.FSG_CIPHERTEXT;
|
|
32
32
|
delete process.env.FSG_IV;
|
|
33
|
-
console.log('[
|
|
33
|
+
console.log('\x1b[35m%s\x1b[0m', '🛡️ Secure Memory Vault Active');
|
|
34
|
+
console.log('\x1b[90m%s\x1b[0m', '------------------------------------------------');
|
|
34
35
|
}
|
|
35
36
|
catch (err) {
|
|
36
|
-
console.error('[
|
|
37
|
+
console.error('\x1b[31m[ERROR]\x1b[0m Decryption failed! Invalid Master Key.');
|
|
37
38
|
process.exit(1);
|
|
38
39
|
}
|
|
39
40
|
}
|
package/package.json
CHANGED
|
Binary file
|