Skip to content

Commit

Permalink
Merge pull request #2 from RemakingEden/add-nuclei-to-pipeline
Browse files Browse the repository at this point in the history
Add Nuclei DAST scanning to pipeline
  • Loading branch information
RemakingEden committed Aug 2, 2023
2 parents 75ee5cc + a1ae696 commit f5e8c78
Show file tree
Hide file tree
Showing 5 changed files with 4,266 additions and 1,998 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ on:
jobs:
DAST:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: remakingeden
PGDATA: /data/remakingeden
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
Expand All @@ -20,5 +34,9 @@ jobs:
${{ runner.os }}-node-
- name: Install npm packages
run: npm ci
- name: Start server
run: npm run start:ci &
- name: Run Nuclei
run: echo "Nuclei is not yet setup"
uses: projectdiscovery/nuclei-action@main
with:
target: http://localhost:3000/api/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ See the package.json for all available commands
```bash
# Set up the database

# Create the sb
# Create the db
npm run db:create

# Set up the tables
Expand Down
90 changes: 90 additions & 0 deletions bin/www
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/usr/bin/env node

/**
* Module dependencies.
*/

var app = require('../app');
var debug = require('debug')('node-sequelize:server');
var http = require('http');

/**
* Get port from environment and store in Express.
*/

var port = normalizePort(process.env.PORT || '3000');
app.set('port', port);

/**
* Create HTTP server.
*/

var server = http.createServer(app);

/**
* Listen on provided port, on all network interfaces.
*/

server.listen(port);
server.on('error', onError);
server.on('listening', onListening);

/**
* Normalize a port into a number, string, or false.
*/

function normalizePort(val) {
var port = parseInt(val, 10);

if (isNaN(port)) {
// named pipe
return val;
}

if (port >= 0) {
// port number
return port;
}

return false;
}

/**
* Event listener for HTTP server "error" event.
*/

function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}

var bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;

// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
process.exit(1);
break;
default:
throw error;
}
}

/**
* Event listener for HTTP server "listening" event.
*/

function onListening() {
var addr = server.address();
var bind = typeof addr === 'string'
? 'pipe ' + addr
: 'port ' + addr.port;
debug('Listening on ' + bind);
}
Loading

0 comments on commit f5e8c78

Please sign in to comment.