Skip to content

Commit

Permalink
fix: require elevate=true for STIG benchmark import (#1340)
Browse files Browse the repository at this point in the history
  • Loading branch information
cd-rite authored Jul 30, 2024
1 parent 0e343a7 commit 3abac96
Show file tree
Hide file tree
Showing 3 changed files with 329 additions and 121 deletions.
3 changes: 3 additions & 0 deletions api/source/controllers/STIG.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ const parsers = require('../utils/parsers.js')
const STIGService = require(`../service/STIGService`)

module.exports.importBenchmark = async function importManualBenchmark (req, res, next) {
if ( !req.query.elevate ) {
next(new SmError.PrivilegeError())
}
try {
const extension = req.file.originalname.substring(req.file.originalname.lastIndexOf(".")+1)
const clobber = req.query.clobber ?? false
Expand Down
1 change: 1 addition & 0 deletions api/source/specification/stig-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3104,6 +3104,7 @@ paths:
schema:
type: boolean
default: false
- $ref: '#/components/parameters/ElevateQuery'
requestBody:
required: true
content:
Expand Down
Loading

0 comments on commit 3abac96

Please sign in to comment.