Skip to content

Commit

Permalink
Merge pull request #1 from luigigubello/enforcing-schema-requirements
Browse files Browse the repository at this point in the history
Enforcing schema requirements
  • Loading branch information
luigigubello authored Jan 18, 2022
2 parents 59023bc + d86132f commit 29447a5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/security-insights-minimal-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ security-contacts:
contribution-policy:
accepts-pull-requests: true
vulnerability-reporting:
accepts-vulnerability-reports: true
accepts-vulnerability-reports: false
2 changes: 1 addition & 1 deletion examples/security-insights-sample.yml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ contribution-policy:
vulnerability-reporting:
accepts-vulnerability-reports: true
email-contact: security@something.com
more-information: https://foo.bar/reporting.html
security-policy: https://foo.bar/reporting.html
bug-bounty-available: true
bug-bounty-url: https://foo.bar/bugs.html
security-testing:
Expand Down
17 changes: 16 additions & 1 deletion security-insights-schema-1.0.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ properties:
threat-model-created:
$id: '#/properties/security-artifacts/properties/threat-model/properties/threat-model-created'
type: boolean
if:
properties:
threat-model-created:
const: true
then:
required:
- evidence-url
required:
- threat-model-created
type: object
Expand Down Expand Up @@ -263,14 +270,22 @@ properties:
$id: '#/properties/vulnerability-reporting/properties/email-contact'
type: string
pattern: '^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$'
more-information:
security-policy:
$id: '#/properties/vulnerability-reporting/properties/more-information'
type: string
pattern: 'https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)'
pgp-key:
$id: '#/properties/vulnerability-reporting/properties/pgp-key'
type: string
pattern: '^(-----BEGIN PGP PUBLIC KEY BLOCK-----).*([a-zA-Z0-9//\n\/\.\:\+\ \=]+).*(-----END PGP PUBLIC KEY BLOCK-----)$'
if:
properties:
accepts-vulnerability-reports:
const: true
then:
required:
- email-contact
- security-policy
required:
- accepts-vulnerability-reports
type: object
Expand Down

0 comments on commit 29447a5

Please # to comment.