{"id":28316509,"url":"https://github.com/lcfhershell/bladesec","last_synced_at":"2026-02-11T12:04:44.618Z","repository":{"id":256616287,"uuid":"855940385","full_name":"LcfherShell/BladeSec","owner":"LcfherShell","description":"Module Keamanan tambahan untuk framework NestJS","archived":false,"fork":false,"pushed_at":"2024-09-11T18:30:51.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-24T10:57:48.597Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LcfherShell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-09-11T17:54:10.000Z","updated_at":"2024-09-11T18:30:54.000Z","dependencies_parsed_at":"2024-09-12T03:54:47.442Z","dependency_job_id":"83e69ff6-6cc7-42e8-ad89-72899d039474","html_url":"https://github.com/LcfherShell/BladeSec","commit_stats":null,"previous_names":["lcfhershell/bladesec"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/LcfherShell/BladeSec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LcfherShell%2FBladeSec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LcfherShell%2FBladeSec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LcfherShell%2FBladeSec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LcfherShell%2FBladeSec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LcfherShell","download_url":"https://codeload.github.com/LcfherShell/BladeSec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LcfherShell%2FBladeSec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29332713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"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":[],"created_at":"2025-05-25T02:11:49.498Z","updated_at":"2026-02-11T12:04:44.604Z","avatar_url":"https://github.com/LcfherShell.png","language":null,"readme":"\u003cimg src=\"https://repository-images.githubusercontent.com/855940385/0277f0c7-bd8c-45be-988a-540bdbfc5577\" alt=\"BladeSec\" style=\"max-width: 100%; height: auto;\" /\u003e\n\n---\n\n# BladeSec - Security Module for NestJS\n\n**BladeSec** is an add-on security module for [NestJS](https://nestjs.com/) that provides enhanced security features for websites. It helps developers safeguard their applications against common web security vulnerabilities and ensure robust security practices are in place.\n\n## Features\n\n- **Rate Limiting**: Prevent brute-force attacks by limiting the number of requests from a single IP.\n- **IP Whitelisting/Blacklisting**: Allow or block specific IP addresses from accessing the site.\n- **Content Security Policy (CSP)**: Mitigate cross-site scripting (XSS) attacks by enforcing CSP headers.\n- **Cross-Origin Resource Sharing (CORS) Configuration**: Securely configure CORS policies for the application.\n- **Session Management**: Protect session integrity with secure cookie management and session expiration.\n- **Security Headers**: Automatically apply essential security headers (X-XSS-Protection, Strict-Transport-Security, etc.).\n- **Request Sanitization**: Ensure inputs are sanitized to prevent injection attacks.\n- **Logging and Monitoring**: Track and log suspicious activities for analysis and alerting.\n\n## Installation\n\nTo install BladeSec, use npm or yarn:\n\n```bash\nnpm install bladsec\n# or\nyarn add bladsec\n```\n\n## Usage\n\nOnce installed, BladeSec can be easily integrated into your NestJS application by importing the module into your `AppModule` or any other specific module.\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { BladeSecModule } from 'bladsec';\n\n@Module({\n  imports: [\n    BladeSecModule.forRoot({\n      rateLimit: {\n        windowMs: 15 * 60 * 1000, // 15 minutes\n        maxRequests: 100, // limit each IP to 100 requests per window\n      },\n      ipWhitelist: ['192.168.0.1'],\n      corsOptions: {\n        origin: 'https://your-domain.com',\n        methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',\n      },\n      sessionOptions: {\n        secret: 'your-session-secret',\n        cookie: { secure: true },\n      },\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n### Configuration\n\nBladeSec can be configured to fit your application's specific security needs. Below is an example of how to pass configuration options when initializing the module:\n\n```typescript\nBladeSecModule.forRoot({\n  rateLimit: {\n    windowMs: 15 * 60 * 1000,\n    maxRequests: 100,\n  },\n  corsOptions: {\n    origin: 'https://your-domain.com',\n    methods: ['GET', 'POST', 'PUT'],\n  },\n  contentSecurityPolicy: {\n    directives: {\n      defaultSrc: [\"'self'\"],\n      scriptSrc: [\"'self'\", 'https://trusted.cdn.com'],\n    },\n  },\n  sessionOptions: {\n    secret: 'your-session-secret',\n    resave: false,\n    saveUninitialized: false,\n    cookie: { secure: true, httpOnly: true },\n  },\n});\n```\n\n### Rate Limiting\n\nBladeSec offers easy rate limiting, which helps prevent denial-of-service (DoS) and brute force attacks. Configure the rate limiting feature in your security options:\n\n```typescript\nrateLimit: {\n  windowMs: 15 * 60 * 1000, // 15-minute window\n  maxRequests: 100, // limit each IP to 100 requests per window\n  message: 'Too many requests, please try again later.',\n}\n```\n\n### IP Whitelisting and Blacklisting\n\nControl which IPs can access your application by using the whitelisting or blacklisting feature:\n\n```typescript\nipWhitelist: ['192.168.0.1', '127.0.0.1'],\nipBlacklist: ['203.0.113.0'],\n```\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more details.\n\n---\n\nFeel free to adjust or add more details to fit your actual BladeSec module specifics.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flcfhershell%2Fbladesec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flcfhershell%2Fbladesec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flcfhershell%2Fbladesec/lists"}