{"id":14975619,"url":"https://github.com/cme-pro/mongoose-audit","last_synced_at":"2026-01-19T16:32:24.469Z","repository":{"id":34979455,"uuid":"192651594","full_name":"cme-pro/mongoose-audit","owner":"cme-pro","description":"Mongoose plugin to store audit information like userAgent, ip, country, etc...","archived":false,"fork":false,"pushed_at":"2023-07-18T21:58:04.000Z","size":99,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-27T18:38:36.863Z","etag":null,"topics":["mongoose","mongoose-plugin","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cme-pro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-19T03:26:30.000Z","updated_at":"2022-03-08T10:49:32.000Z","dependencies_parsed_at":"2024-09-18T17:40:54.308Z","dependency_job_id":null,"html_url":"https://github.com/cme-pro/mongoose-audit","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.2857142857142857,"last_synced_commit":"cab562415a13d28b1a66e3d725167e9011c56f25"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cme-pro/mongoose-audit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cme-pro%2Fmongoose-audit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cme-pro%2Fmongoose-audit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cme-pro%2Fmongoose-audit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cme-pro%2Fmongoose-audit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cme-pro","download_url":"https://codeload.github.com/cme-pro/mongoose-audit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cme-pro%2Fmongoose-audit/sbom","scorecard":{"id":294106,"data":{"date":"2025-08-11","repo":{"name":"github.com/cme-pro/mongoose-audit","commit":"cab562415a13d28b1a66e3d725167e9011c56f25"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/5 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-f825-f98c-gj3g","Warn: Project is vulnerable to: GHSA-h8hf-x3f4-xwgp","Warn: Project is vulnerable to: GHSA-9m93-w8w6-76hh","Warn: Project is vulnerable to: GHSA-m7xq-9374-9rvx","Warn: Project is vulnerable to: GHSA-vg7j-7cwx-8wgw","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T19:02:29.096Z","repository_id":34979455,"created_at":"2025-08-17T19:02:29.096Z","updated_at":"2025-08-17T19:02:29.096Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28574334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T16:29:19.148Z","status":"ssl_error","status_checked_at":"2026-01-19T16:29:17.772Z","response_time":67,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mongoose","mongoose-plugin","nodejs"],"created_at":"2024-09-24T13:52:17.730Z","updated_at":"2026-01-19T16:32:24.452Z","avatar_url":"https://github.com/cme-pro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm][npm]][npm-url]\n[![node][node]][node-url]\n[![downloads][downloads]][downloads-url]\n\n# mongoose-audit\n\nMongoose plugin to store audit information like userAgent, ip, country, etc...\n\nThis plugin simply adds the following fields: \n- createdBy\n- updatedBy \n- deletedBy \n- createdFrom\n- updatedFrom\n- deletedFrom\n\nWhere: \n1. createdBy, updatedBy and deletedBy are a user id, \n2. createdFrom, updatedFrom and deletedFrom have the following structure:\n   - userAgent\n   - ip\n   - country\n   - continent\n   - region\n   - city\n   - zip\n   - lat\n   - lng\n   - tz\n\nNote: deletedBy and deletedFrom are only useful if combined with [mongoose-delete plugin](https://www.npmjs.com/package/mongoose-delete).\n\n## Installation\n\n```sh\n$ npm install mongoose-audit --save\n```\n\n## Overview\n\n### Adding plugin to the schema\n\n```js\nBlogPost.plugin(mongooseAudit, { userModel: 'Author' });\n```\n\n### Plugin options\n\n* userModel - optional (default is \"User\"). The mongoose Model managing users. Used to populate the field).\n\n## Usage\n\nOn create:\n```js\n    const post = new BlogPost({});\n    post.createdBy = currentUserId;\n    post.createdFrom = {{ ip, userAgent, country };\n    await post.save();\n```\n\nOn update:\n```js\n    post.set();\n    post.updatedBy = currentUserId;\n    post.updatedFrom = {{ ip, userAgent, country };\n    await post.save();\n```\n\nOn delete (only useful if combined with [mongoose-delete plugin](https://www.npmjs.com/package/mongoose-delete))\n```js\n    post.deletedBy = currentUserId;\n    post.deletedFrom = {{ ip, userAgent, country };\n    await post.save();\n    await post.delete();\n```\n\n\n[npm]: https://img.shields.io/npm/v/@cme-pro/mongoose-audit.svg\n[npm-url]: https://npmjs.com/package/@cme-pro/mongoose-audit\n[node]: https://img.shields.io/node/v/@cme-pro/mongoose-audit.svg\n[node-url]: https://nodejs.org\n[tests]: http://img.shields.io/travis/webpack-contrib/@cme-pro/mongoose-audit.svg\n[tests-url]: https://travis-ci.org/webpack-contrib/@cme-pro/mongoose-audit\n[downloads]: https://img.shields.io/npm/dt/@cme-pro/mongoose-audit.svg\n[downloads-url]: https://npmjs.com/package/@cme-pro/mongoose-audit\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcme-pro%2Fmongoose-audit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcme-pro%2Fmongoose-audit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcme-pro%2Fmongoose-audit/lists"}