Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

atna-audit

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atna-audit

Assists in the creation of ATNA audit trail messages for IHE profiles.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
145
decreased by-63.01%
Maintainers
4
Weekly downloads
 
Created
Source

Build Status codecov.io

ATNA Audit Trail library

Assists in the creation of ATNA audit trail messages for IHE profiles.

Install with:

$ npm install --save atna-audit

Use the simple convenience function as follows:

var audit = atna.construct.userLoginAudit(atna.OUTCOME_SUCCESS, 'openhim', 'x.x.x.x', 'testUser', 'testRole', '123');
var syslog = atna.construct.wrapInSyslog(audit);

Or construct your own custom audits like this:

var eventID = new atna.construct.Code(110114, 'UserAuthenticated', 'DCM');
var typeCode = new atna.construct.Code(110122, 'Login', 'DCM');
var eIdent = new atna.construct.EventIdentification(atna.EVENT_ACTION_EXECUTE, new Date(), atna.OUTCOME_SUCCESS, eventID, typeCode);
var sysRoleCode = new atna.construct.Code(110150, 'Application', 'DCM');
var sysParticipant = new atna.construct.ActiveParticipant(sysname, '', true, sysIp, atna.NET_AP_TYPE_IP, [sysRoleCode]);
var userRoleCodeDef = new atna.construct.Code(userRole, userRole, userRoleCode);
var userParticipant = new atna.construct.ActiveParticipant(username, '', true, null, null, [userRoleCodeDef]);
var sourceTypeCode = new atna.construct.Code(atna.AUDIT_SRC_TYPE_UI, '', '');
var sourceIdent = new atna.construct.AuditSourceIdentification(null, sysname, sourceTypeCode);
var audit = new atna.construct.AuditMessage(eIdent, [sysParticipant, userParticipant], null, [sourceIdent]);
var xml = audit.toXML();

Sending an Audit to an ATNA supported server

Connection Details

var connDetails = {
  interface: 'udp|tls|tcp', // specify the interface to use when sending the audit
  host: 'localhost', // specify the host 
  port: 5050, // specify the port 
  options: { // when interface type is 'tls', you need to supply the certificate details
    key: fs.readFileSync('./path/to/key.pem').toString(), 
    cert: fs.readFileSync('./path/to/cert.pem').toString(),
    ca: fs.readFileSync('./path/to/cert.pem').toString(),
  }
}

Sending the Audit

atna.send.sendAuditEvent(msg, connDetail, function (err) {
  // handle errors if needed
})

Testing

To test the code you will need xmllint and trang on your PATH. sudo apt-get install libxml2-utils trang

Then run npm test

Keywords

FAQs

Package last updated on 03 Apr 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc