Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
azure-arm-iothub
Advanced tools
This project provides a Node.js package that makes it easy to manage Microsoft Azure Iot Hub Resources.Right now it supports:
npm install azure-arm-iothub
var msRestAzure = require('ms-rest-azure');
var IoTHubClient = require('azure-arm-iothub');
// Interactive Login
msRestAzure.interactiveLogin(function(err, credentials)
{
var client = new IoTHubClient(credentials, 'your-subscription-id');
client.iotHubResource.listBySubscription(function (err, result, request, response)
{
if (err)
{
console.log(err);
}
console.log(result);
});
});
var operationInputs =
{
name: resourceName
};
client.iotHubResource.checkNameAvailability(resourceName, operationInputs, function (err, result, request, response)
{
if (err)
{
console.log(err);
}
console.log(result);
}
var iotHubCreateParams =
{
name: resourceName,
location: location,
subscriptionid: subscriptionId,
resourcegroup: resourceGroupName,
sku:
{
name: 'S1',
capacity: 2
},
properties:
{
enableFileUploadNotifications: false,
ipFilterRules: [
{
filterName: "ipfilterrule",
action: "accept",
ipMask: "0.0.0.0/0"
}
],
operationsMonitoringProperties:
{
events:
{
"C2DCommands": "Error",
"DeviceTelemetry": "Error",
"DeviceIdentityOperations": "Error",
"Connections": "Error, Information"
}
},
"features": "None",
}
}
client.iotHubResource.createOrUpdate(resourceGroupName, resourceName, iotHubCreateParams, function (err, result, request, response)
{
if (err)
{
console.log(err);
}
console.log(result);
});
var iotHubUpdateParams =
{
name: resourceName,
location: location,
subscriptionid: subscriptionId,
resourcegroup: resourceGroupName,
sku:
{
name: 'S1',
capacity: 3
},
properties:
{
enableFileUploadNotifications: false,
ipFilterRules: [
{
filterName: "ipfilterrule2",
action: "reject",
ipMask: "192.168.0.0/10"
}
],
operationsMonitoringProperties:
{
events:
{
"C2DCommands": "Error",
"DeviceTelemetry": "Error",
"DeviceIdentityOperations": "Error",
"Connections": "Error, Information"
}
},
"features": "None",
}
}
client.iotHubResource.createOrUpdate(resourceGroupName, resourceName, iotHubUpdateParams, function (err, result, request, response)
{
if (err)
{
console.log(err);
}
console.log(result);
});
client.iotHubResource.get(resourceGroupName, resourceName, function (err, result, request, response)
{
if (err)
{
console.log(err);
}
console.log(result);
});
client.iotHubResource.deleteMethod(resourceGroupName, resourceName, function (err, result, request, response)
{
if (err)
{
console.log(err);
}
console.log(result);
});
client.iotHubResource.listByResourceGroup(resourceGroupName, function (err, result, request, response)
{
if (err)
{
console.log(err);
}
console.log(result);
});
client.iotHubResource.getQuotaMetrics(resourceGroupName, resourceName, function (err, result, request, response)
{
if (err)
{
console.log(err);
}
console.log(result);
});
client.iotHubResource.getValidSkus(resourceGroupName, resourceName, function (err, result, request, response)
{
if (err)
{
console.log(err);
}
console.log(result);
});
client.iotHubResource.listKeys(resourceGroupName, resourceName, function (err, result, request, response)
{
if (err)
{
console.log(err);
}
console.log(result);
});
client.iotHubResource.getKeysForKeyName(resourceGroupName, resourceName, 'iothubowner', function (err, result, request, response)
{
if (err)
{
console.log(err);
}
console.log(result);
});
client.iotHubResource.listEventHubConsumerGroups(resourceGroupName, resourceName, 'events', function (err, result, request, response)
{
if (err)
{
console.log(err);
}
console.log(result);
});
client.iotHubResource.createEventHubConsumerGroup(resourceGroupName, resourceName, eventsEndpointName, consumerGroupName, function (err, result, request, response)
{
if (err)
{
console.log(err);
}
console.log(result);
});
client.iotHubResource.getEventHubConsumerGroup(resourceGroupName, resourceName, eventsEndpointName, consumerGroupName, function (err, result, request, response)
{
if (err)
{
console.log(err);
}
console.log(result);
});
client.iotHubResource.deleteEventHubConsumerGroup(resourceGroupName, resourceName, eventsEndpointName, consumerGroupName, function (err, result, request, response)
{
if (err)
{
console.log(err);
}
console.log(result);
});
FAQs
IotHubClient Library with typescript type definitions for node
The npm package azure-arm-iothub receives a total of 9,151 weekly downloads. As such, azure-arm-iothub popularity was classified as popular.
We found that azure-arm-iothub demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.