Skip to content

Commit

Permalink
fix(irs-api):[TRI-667] Mitigate KICS finding Objects should not accep…
Browse files Browse the repository at this point in the history
…t 'additionalProperties' if it is possible
  • Loading branch information
ds-jhartmann authored and ds-ext-abugajewski committed Oct 10, 2022
1 parent f151035 commit dc7b5be
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 37 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/kics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:
edc4c9ac9ee139c0d7947410439b66e3c6290cb97a37d97a7519d3d5e56a5a84,\
7f3e9461a3abdb7a281fdc736fb0827e69e9278ccd6b929bd32fc2d84336f68c,\
10e4fff1f26f0a765423e35a7d8952363a6e8961a58e20b3017cd7818745eb36"
# Exclude accepted queries from the build
exclude_queries: "9f88c88d-824d-4d9a-b985-e22977046042"

# Upload findings to GitHub Advanced Security Dashboard
- name: Upload SARIF file for GitHub Advanced Security Dashboard
Expand Down
27 changes: 0 additions & 27 deletions api/irs-v1.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -510,15 +510,13 @@ components:
schemas:
AdministrativeInformation:
type: object
additionalProperties: false
properties:
revision:
type: string
version:
type: string
AssetAdministrationShellDescriptor:
type: object
additionalProperties: false
description: AAS shells.
properties:
administration:
Expand All @@ -543,7 +541,6 @@ components:
$ref: '#/components/schemas/SubmodelDescriptor'
AsyncFetchedItems:
type: object
additionalProperties: false
description: Statistics of job execution.
properties:
completed:
Expand All @@ -566,7 +563,6 @@ components:
minimum: 0
Bpn:
type: object
additionalProperties: false
description: Collection of bpn mappings
properties:
manufacturerId:
Expand All @@ -575,15 +571,13 @@ components:
type: string
Endpoint:
type: object
additionalProperties: false
properties:
interface:
type: string
protocolInformation:
$ref: '#/components/schemas/ProtocolInformation'
ErrorResponse:
type: object
additionalProperties: false
description: Error response.
properties:
errors:
Expand Down Expand Up @@ -669,7 +663,6 @@ components:
- 511 NETWORK_AUTHENTICATION_REQUIRED
GlobalAssetIdentification:
type: object
additionalProperties: false
description: CATENA-X global asset id in the format urn:uuid:uuid4.
properties:
globalAssetId:
Expand All @@ -680,7 +673,6 @@ components:
minLength: 45
IdentifierKeyValuePair:
type: object
additionalProperties: false
properties:
key:
type: string
Expand All @@ -692,7 +684,6 @@ components:
type: string
Job:
type: object
additionalProperties: false
description: Executable unit with meta information and item graph result.
properties:
createdOn:
Expand Down Expand Up @@ -740,7 +731,6 @@ components:
- jobState
JobErrorDetails:
type: object
additionalProperties: false
description: Job error details.
properties:
errorDetail:
Expand All @@ -757,14 +747,12 @@ components:
description: Datetime error occurs.
JobHandle:
type: object
additionalProperties: false
properties:
jobId:
type: string
format: uuid
JobParameter:
type: object
additionalProperties: false
description: Job parameter of job processing.
properties:
aspects:
Expand Down Expand Up @@ -809,7 +797,6 @@ components:
- downward
JobStatusResult:
type: object
additionalProperties: false
properties:
jobId:
type: string
Expand All @@ -826,7 +813,6 @@ components:
- ERROR
Jobs:
type: object
additionalProperties: false
description: Container for a job with item graph.
properties:
bpns:
Expand Down Expand Up @@ -860,15 +846,13 @@ components:
$ref: '#/components/schemas/Tombstone'
LangString:
type: object
additionalProperties: false
properties:
language:
type: string
text:
type: string
LinkedItem:
type: object
additionalProperties: false
description: Set of child parts the parent object is assembled by (one structural
level down).
properties:
Expand All @@ -892,15 +876,13 @@ components:
$ref: '#/components/schemas/Quantity'
MeasurementUnit:
type: object
additionalProperties: false
properties:
datatypeURI:
type: string
lexicalValue:
type: string
ProcessingError:
type: object
additionalProperties: false
properties:
errorDetail:
type: string
Expand All @@ -914,7 +896,6 @@ components:
minimum: 0
ProtocolInformation:
type: object
additionalProperties: false
properties:
endpointAddress:
type: string
Expand All @@ -930,7 +911,6 @@ components:
type: string
Quantity:
type: object
additionalProperties: false
description: Quantity component.
properties:
measurementUnit:
Expand All @@ -942,15 +922,13 @@ components:
minimum: 0
Reference:
type: object
additionalProperties: false
properties:
value:
type: array
items:
type: string
RegisterJob:
type: object
additionalProperties: false
description: The requested job definition.
properties:
aspects:
Expand Down Expand Up @@ -1011,7 +989,6 @@ components:
- globalAssetId
Relationship:
type: object
additionalProperties: false
description: Relationships between parent and child items.
properties:
aspectType:
Expand All @@ -1022,7 +999,6 @@ components:
$ref: '#/components/schemas/LinkedItem'
Submodel:
type: object
additionalProperties: false
description: Collection of requested Submodels
properties:
aspectType:
Expand All @@ -1035,7 +1011,6 @@ components:
type: object
SubmodelDescriptor:
type: object
additionalProperties: false
properties:
administration:
$ref: '#/components/schemas/AdministrativeInformation'
Expand All @@ -1055,14 +1030,12 @@ components:
$ref: '#/components/schemas/Reference'
Summary:
type: object
additionalProperties: false
description: Summary of the job with statistics of the job processing.
properties:
asyncFetchedItems:
$ref: '#/components/schemas/AsyncFetchedItems'
Tombstone:
type: object
additionalProperties: false
description: Collection of not resolvable endpoints as tombstones. Including
cause of error and endpoint URL.
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,4 @@ public OpenApiCustomiser customizer() {
};
}

/**
* Sets additionalProperties to false for every schema in components.
*
* @return the customizer
*/
@Bean
public OpenApiCustomiser openApiAdditionalPropertiesCustomizer() {
return openApi -> openApi.getComponents().getSchemas().values().forEach(s -> s.setAdditionalProperties(false));
}

}

0 comments on commit dc7b5be

Please sign in to comment.