-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev(REST): RHINENG-2752 add rules endpoint nested under profiles of s…
…ecurity_guides
- Loading branch information
1 parent
2efe0e0
commit 3afc5db
Showing
2 changed files
with
285 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# frozen_string_literal: true | ||
|
||
require './spec/api/v2/schemas/util' | ||
|
||
module Api | ||
module V2 | ||
module Schemas | ||
module Rules | ||
extend Api::V2::Schemas::Util | ||
|
||
RULE = { | ||
type: :object, | ||
required: %w[ref_id title rationale severity precedence], | ||
properties: { | ||
ref_id: { | ||
type: :string, | ||
examples: ['xccdf_org.ssgproject.content_rule_file_groupowner_etc_passwd'], | ||
description: 'Identificator for Rule' | ||
}, | ||
title: { | ||
type: :string, | ||
examples: ['Verify Group Who Owns passwd File'], | ||
description: 'Brief description of the Rule content' | ||
}, | ||
description: { | ||
type: :string, | ||
examples: ['To properly set the group owner of /etc/passwd, run the command: ' \ | ||
'$ sudo chgrp root /etc/passwd'], | ||
description: 'Longer description of the Rule content' | ||
}, | ||
remediation_issue_id: { | ||
type: :string, | ||
examples: ['ssg:rhel7|rht-ccp|xccdf_org.ssgproject.content_rule_file_groupowner_etc_passwd'], | ||
description: 'Identificator used to remediate issues tied to this rule' | ||
}, | ||
rationale: { | ||
type: :string, | ||
examples: ['The /etc/passwd file contains information about the users that are configured on the ' \ | ||
'system. Protection of this file is critical for system security.'], | ||
description: 'Reasoning for this rule to exist' | ||
}, | ||
severity: { | ||
type: :string, | ||
examples: ['medium'], | ||
description: 'Level of impact of this Rule' | ||
}, | ||
precedence: { | ||
type: :number, | ||
examples: ['828'], | ||
description: 'Number of Rule\'s position in the application order' | ||
} | ||
} | ||
}.freeze | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters