Skip to content

Commit

Permalink
Updating TSFI printing, printing to file now, tsfi to sf mapping impr…
Browse files Browse the repository at this point in the history
…oved
  • Loading branch information
konradweiss committed Jun 14, 2024
1 parent 6394508 commit 62e8ccb
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import de.fraunhofer.aisec.codyze.specificationLanguage.cpg.native.queries.CPGQu
import de.fraunhofer.aisec.codyze.specificationLanguage.cpg.native.queries.ExampleQuery
import io.github.detekt.sarif4k.Run
import io.github.oshai.kotlinlogging.KotlinLogging
import java.io.FileOutputStream
import java.io.PrintStream


private val logger = KotlinLogging.logger {}

Check warning

Code scanning / detekt

Reports consecutive blank lines Warning

Needless blank line(s)

Check warning on line 13 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/CPGQueryExecutor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/CPGQueryExecutor.kt#L13

Added line #L13 was not covered by tests
Expand All @@ -31,7 +33,9 @@ class CPGQueryExecutor(private val configuration: CPGQueryConfiguration, private
}
val informationExtractor = TSFIInformationExtractor()
informationExtractor.extractInformation(backend.cpg)

Check warning on line 35 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/CPGQueryExecutor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/CPGQueryExecutor.kt#L34-L35

Added lines #L34 - L35 were not covered by tests
informationExtractor.printInformation(XMLFormatter(),System.out)

informationExtractor.printInformation(XMLFormatter(),
PrintStream(FileOutputStream("sf.xml")), PrintStream(FileOutputStream("tsfi.xml")))

Check warning on line 38 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/CPGQueryExecutor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/CPGQueryExecutor.kt#L37-L38

Added lines #L37 - L38 were not covered by tests

val cpgQuerySarifBuilder = CPGQuerySarifBuilder(queries = queries, backend = backend)
return cpgQuerySarifBuilder.buildRun(findings = findings)

Check warning on line 41 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/CPGQueryExecutor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/CPGQueryExecutor.kt#L40-L41

Added lines #L40 - L41 were not covered by tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,22 @@ open abstract class InformationExtractor {
*/
public abstract fun extractInformation(result: TranslationResult);

public fun printInformation(formatter: Formatter, printer: PrintStream){
printer.print(formatInformation(formatter))
public fun printInformation(formatter: Formatter, printerF1: PrintStream, printerF2:PrintStream){
printerF1.print(formatSFInformation(formatter))
printerF2.print(formatTSFIInformation(formatter))
}

Check warning on line 22 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/InformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/InformationExtractor.kt#L20-L22

Added lines #L20 - L22 were not covered by tests

/**
* The extractor specific information needs to be given to the formatter in a key, value base fashion. The
* implementation of this function can nest key values, generated lists etc.
*/
protected abstract fun formatInformation(formatter: Formatter):String;
protected abstract fun formatTSFIInformation(formatter: Formatter):String;

/**
* The extractor specific information needs to be given to the formatter in a key, value base fashion. The
* implementation of this function can nest key values, generated lists etc.
*
*/
protected abstract fun formatSFInformation(formatter: Formatter):String;

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import de.fraunhofer.aisec.cpg.graph.statements.expressions.CallExpression
import de.fraunhofer.aisec.cpg.graph.statements.expressions.Literal
import de.fraunhofer.aisec.cpg.graph.statements.expressions.MemberExpression
import de.fraunhofer.aisec.cpg.graph.statements.expressions.Reference
import io.github.oshai.kotlinlogging.KotlinLogging
import org.xml.sax.InputSource
import java.io.StringReader
import java.io.StringWriter
Expand All @@ -20,10 +21,14 @@ import javax.xml.transform.stream.StreamResult

class TSFIInformationExtractor: InformationExtractor() {

private val logger = KotlinLogging.logger {}

Check warning on line 24 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L24

Added line #L24 was not covered by tests

val securityFunctionMap: MutableMap<Name, SecurityFunction> = mutableMapOf()

Check warning on line 26 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L26

Added line #L26 was not covered by tests

val securityBehavior: MutableSet<String> = mutableSetOf()

Check warning on line 28 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L28

Added line #L28 was not covered by tests

val tsfiDeclarations: MutableList<TSFI> = mutableListOf<TSFI>()

Check warning on line 30 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L30

Added line #L30 was not covered by tests

/**
* Reverse map to more efficiently find SFs related to an appearance of an action.
*/
Expand All @@ -43,7 +48,7 @@ class TSFIInformationExtractor: InformationExtractor() {
for (sf in sfs){

Check warning

Code scanning / detekt

Reports spaces around curly braces Warning

Missing spacing before "{"
if (!securityFunctionMap.contains(sf.name)){

Check warning

Code scanning / detekt

Reports spaces around curly braces Warning

Missing spacing before "{"
securityFunctionMap.put(sf.name, SecurityFunction(sf.name,(sf.comment?:"").trimIndent().trim().replace("\n",""),
mutableSetOf(), mutableSetOf(), mutableSetOf(), mutableSetOf()))
mutableSetOf(), mutableSetOf(), mutableSetOf()))

Check warning on line 51 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L51

Added line #L51 was not covered by tests
}
}

Expand Down Expand Up @@ -99,6 +104,9 @@ class TSFIInformationExtractor: InformationExtractor() {
}

val tsfis = annotatedNode.filter { it.annotations.any {it.name.lastPartsMatch(Name("TSFI")) } }
var preSF = 0
var postSF = 0
var identifiedSF = 0

Check warning on line 109 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L106-L109

Added lines #L106 - L109 were not covered by tests

for (tsfi in tsfis){

Check warning

Code scanning / detekt

Reports spaces around curly braces Warning

Missing spacing before "{"
val tsfiSFs: MutableSet<Name> = mutableSetOf()
Expand All @@ -116,32 +124,38 @@ class TSFIInformationExtractor: InformationExtractor() {

tsfiAnnotation.members.forEach {

Check warning on line 125 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L125

Added line #L125 was not covered by tests
if(it.value is MemberExpression){
behavior = Name(it.value.toString())
behavior = Name(it.value?.code.toString()?:it.name.toString())
}else{
tsfiSFs.addAll(it.value.allChildren<MemberExpression>().map { Name(it.toString()) }.toMutableSet())
tsfiSFs.addAll(it.value.allChildren<MemberExpression>().map { Name(it.code.toString()) }.toMutableSet())

Check warning on line 129 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L129

Added line #L129 was not covered by tests
}

if(tsfiSFs.isEmpty()){
val calls = annotationExtendedNode.flatMap { reachableCalls(it) }
calls.forEach { call ->
actionsToSFReverseMap.keys.forEach { actionKey ->
if(call.name.toString().startsWith(actionKey.toString())){
tsfiSFs.addAll(actionsToSFReverseMap[actionKey]?.map { it.name }?: setOf())
}
}

if(tsfiSFs.isEmpty()){
val calls = annotationExtendedNode.flatMap { reachableCalls(it) }
calls.forEach { call ->
actionsToSFReverseMap.keys.forEach { actionKey ->

Check warning on line 137 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L135-L137

Added lines #L135 - L137 were not covered by tests
if(call.name.toString().startsWith(actionKey.toString())){
tsfiSFs.addAll(actionsToSFReverseMap[actionKey]?.map { it.name }?: setOf())
}
}
if(tsfiSFs.isEmpty()){
// TODO Here we could investigate why we do not find the SF for it.
}
}

}
val description = annotationExtendedNode.map { it.comment?:"" }.joinToString("\n")
val tsfiDeclaration = TSFI(description, behavior?:Name(""), annotationExtendedNode)
tsfiSFs.forEach {
securityFunctionMap[it]?.tsfis?.add(tsfiDeclaration)
if(tsfiSFs.isEmpty()){
// TODO Here we could investigate why we do not find the SF for it.
}else{
postSF++

Check warning on line 146 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L146

Added line #L146 was not covered by tests
}
}else{
preSF++

Check warning on line 149 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L149

Added line #L149 was not covered by tests
}

val description = annotationExtendedNode.map { it.comment?:"" }.joinToString("").trimIndent().trim().replace("\n","")
val tsfiDeclaration = TSFI(description, behavior?:Name(""), annotationExtendedNode,
tsfiSFs.flatMap { tsfiSFName ->
securityFunctionMap.entries.filter { it.key.toString().substringAfterLast(".") == tsfiSFName.toString().substringAfterLast(".") }.map { it.value } }.toMutableSet())
tsfiDeclarations.add(tsfiDeclaration)

Check warning on line 156 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L154-L156

Added lines #L154 - L156 were not covered by tests
}
logger.info { "TSFI: ${tsfiDeclarations.size}: $preSF security functions explicitly specified, $postSF security functions identified through analysis." }

Check warning on line 158 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L158

Added line #L158 was not covered by tests

}

Expand All @@ -166,7 +180,7 @@ class TSFIInformationExtractor: InformationExtractor() {
}


override fun formatInformation(formatter: Formatter): String {
override fun formatSFInformation(formatter: Formatter): String {
var xml = ""

Check warning on line 184 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L184

Added line #L184 was not covered by tests

for (sf in securityFunctionMap.values){

Check warning

Code scanning / detekt

Reports spaces around curly braces Warning

Missing spacing before "{"
Expand Down Expand Up @@ -194,6 +208,46 @@ class TSFIInformationExtractor: InformationExtractor() {
return prettyPrint(formatter.format("security-specification", xml, mapOf()),2,true)

Check warning on line 208 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L208

Added line #L208 was not covered by tests
}

override fun formatTSFIInformation(formatter: Formatter): String {
var xml = ""
var id = 0

Check warning on line 213 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L212-L213

Added lines #L212 - L213 were not covered by tests
for (tsfi in tsfiDeclarations){
var tsfiContent = formatter.format("description", tsfi.description, mapOf())

Check warning on line 215 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L215

Added line #L215 was not covered by tests

var parametersContent = ""

Check warning on line 217 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L217

Added line #L217 was not covered by tests

if(parametersContent.isEmpty()) parametersContent = " "
tsfiContent += formatter.format("parameters", parametersContent, mapOf())

Check warning on line 220 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L220

Added line #L220 was not covered by tests

var errorsContent = ""

Check warning on line 222 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L222

Added line #L222 was not covered by tests

if(errorsContent.isEmpty()) errorsContent = " "
tsfiContent += formatter.format("errors", errorsContent, mapOf())

Check warning on line 225 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L225

Added line #L225 was not covered by tests


var afContent = ""

Check warning on line 228 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L228

Added line #L228 was not covered by tests
for(sf in tsfi.sf){
afContent += formatter.format("ref", "", mapOf("target" to replaceSFName(sf.name.toString())))

Check warning on line 230 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L230

Added line #L230 was not covered by tests
}
if(afContent.isEmpty()) afContent = " "

tsfiContent += formatter.format("security-functions", afContent, mapOf())

Check warning on line 234 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L234

Added line #L234 was not covered by tests


var actionsContent = ""

Check warning on line 237 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L237

Added line #L237 was not covered by tests
if(actionsContent.isEmpty()) actionsContent = " "

tsfiContent += formatter.format("actions", actionsContent, mapOf())

Check warning on line 240 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L240

Added line #L240 was not covered by tests


xml += formatter.format("tsfi", tsfiContent, mapOf("id" to "tsfi$id", "security" to tsfi.securityBehavior.localName.substringAfterLast(".").lowercase()))
id++

Check warning on line 244 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L243-L244

Added lines #L243 - L244 were not covered by tests
}


return prettyPrint(formatter.format("functional-specification", xml, mapOf()),2,true)

Check warning on line 248 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L248

Added line #L248 was not covered by tests
}

private fun replaceSFName(name:String): String{

Check warning

Code scanning / detekt

Reports spaces around curly braces Warning

Missing spacing before "{"
var sfname = name.substringAfterLast("de.fraunhofer.aisec.codyze.").replace(".TOEDefinitions.SecurityFunction","")
return sfname.lowercase()

Check warning on line 253 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L252-L253

Added lines #L252 - L253 were not covered by tests
Expand Down Expand Up @@ -222,7 +276,7 @@ class TSFIInformationExtractor: InformationExtractor() {
* In contrast to the annotation the data class does not contain the security function.When the TSFIs are parsed, the
* associated security functions are either provided in the annotation or identified through static code analysis.
*/
data class TSFI(val description: String, val securityBehavior:Name, val functions:Set<Node>)
data class TSFI(val description: String, val securityBehavior:Name, val functions:Set<Node>, val sf:MutableSet<SecurityFunction>)

Check warning on line 279 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L279

Added line #L279 was not covered by tests

data class SecurityFunction(val name:Name, val description:String, val objectives:MutableSet<String>, val requirements: MutableSet<String>, val actions: MutableSet<Name>, val tsfis:MutableSet<TSFI>)
data class SecurityFunction(val name:Name, val description:String, val objectives:MutableSet<String>, val requirements: MutableSet<String>, val actions: MutableSet<Name>)

Check warning on line 281 in codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt

View check run for this annotation

Codecov / codecov/patch

codyze-specification-languages/cpg-native/src/main/kotlin/de/fraunhofer/aisec/codyze/specificationLanguage/cpg/native/TSFIInformationExtractor.kt#L281

Added line #L281 was not covered by tests
}

0 comments on commit 62e8ccb

Please sign in to comment.