
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@nesgaurd/nesgaurd-js
Advanced tools
Protect your website from malicious script modifications and supply chain attacks with NESGuard SRI monitoring
A JavaScript client for adding Subresource Integrity (SRI) protection to your web applications, providing real-time script tampering detection and enhanced security against supply chain attacks.
NESGuard is a comprehensive Subresource Integrity (SRI) monitoring platform that protects your website from malicious script modifications, supply chain attacks, and third-party script compromises. This package is the JavaScript client that integrates with the NESGuard monitoring service.
Before using this package, you need to:
npm install @nesgaurd/nesgaurd-js
Or include via CDN:
<script src="https://cdn.jsdelivr.net/npm/@nesgaurd/nesgaurd-js/dist/nesgaurd.min.js"></script>
import NESGuard from '@nesgaurd/nesgaurd-js';
// Initialize NESGuard client
const nesguard = new NESGuard({
agencyId: 'your-agency-id', // Get this from your NESGuard dashboard
apiUrl: 'https://nesgaurd.com/api' // Optional, defaults to production API
});
// Setup script monitoring
nesguard.setup();
NESGuard JS includes advanced security measures:
The NESGuard platform provides:
Visit nesgaurd.com/dashboard after setting up your account to access these features.
When initializing NESGuard, you can provide several configuration options:
const nesguard = new NESGuard({
agencyId: 'your-agency-id', // Required: Your unique agency identifier
apiUrl: 'https://nesgaurd.com/api', // Optional: API endpoint for NESGuard service
scripts: [ // Optional: Additional scripts to monitor
'https://example.com/script.js',
'/local/script.js'
],
autoDetect: true, // Optional: Auto-detect scripts on page (default: true)
interval: 900000, // Optional: Monitoring interval in ms (default: 15min)
onDetection: (event) => { // Optional: Callback when integrity violation detected
console.error('Script integrity violation:', event);
}
});
setup()Sets up SRI protection by scanning the page for scripts and registering them with the NESGuard service.
nesguard.setup();
addScript(url, options)Manually add a script to monitor.
nesguard.addScript('https://example.com/script.js', {
interval: 60000, // Check every minute
critical: true // Mark as critical script
});
removeScript(url)Stop monitoring a specific script.
nesguard.removeScript('https://example.com/script.js');
checkScript(url)Force an immediate integrity check of a script.
nesguard.checkScript('https://example.com/script.js')
.then(result => {
console.log('Script integrity status:', result.isValid);
});
NESGuard includes a setup wizard to help you configure which scripts to monitor:
import { NESGuardWizard } from '@nesgaurd/nesgaurd-js';
// Launch the setup wizard
NESGuardWizard.launch({
agencyId: 'your-agency-id',
onComplete: (config) => {
// Save configuration and initialize NESGuard
localStorage.setItem('nesguard-config', JSON.stringify(config));
const nesguard = new NESGuard(config);
nesguard.setup();
}
});
When using the CDN version, the code is already built, bundled, and obfuscated:
<!-- Include the script -->
<script src="https://cdn.jsdelivr.net/npm/@nesgaurd/nesgaurd-js/dist/nesgaurd.min.js"></script>
<!-- Use it in your code -->
<script>
document.addEventListener('DOMContentLoaded', () => {
// Initialize NESGuard
const nesguard = new NESGuard({
agencyId: 'your-agency-id'
});
// Setup protection
nesguard.setup()
.then(() => {
console.log('NESGuard protection active');
});
});
</script>
// In your Drupal theme's JavaScript
import NESGuard from '@nesgaurd/nesgaurd-js';
document.addEventListener('DOMContentLoaded', () => {
const agencyId = drupalSettings.nesguard?.agencyId;
if (agencyId) {
const nesguard = new NESGuard({
agencyId,
apiUrl: drupalSettings.nesguard?.apiUrl || 'https://nesgaurd.com/api'
});
nesguard.setup();
}
});
// In your WordPress theme or plugin
document.addEventListener('DOMContentLoaded', () => {
if (typeof nesguardSettings !== 'undefined') {
const nesguard = new NESGuard({
agencyId: nesguardSettings.agencyId,
apiUrl: nesguardSettings.apiUrl || 'https://nesgaurd.com/api'
});
nesguard.setup();
}
});
For real-time notifications:
import { NESGuardSocket } from '@nesgaurd/nesgaurd-js';
const socket = new NESGuardSocket({
agencyId: 'your-agency-id',
token: 'your-jwt-token' // Get this from your authentication system
});
socket.connect();
socket.on('threat', (data) => {
console.error('Threat detected:', data);
});
MIT
FAQs
Protect your website from malicious script modifications and supply chain attacks with NESGuard SRI monitoring
We found that @nesgaurd/nesgaurd-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.