diff --git a/.github/workflows/build-codeql.yaml b/.github/workflows/build-codeql.yaml index cdc638ea..c6d11f1e 100644 --- a/.github/workflows/build-codeql.yaml +++ b/.github/workflows/build-codeql.yaml @@ -134,7 +134,7 @@ jobs: inlineScript: | Update-AzConfig -DisplayBreakingChangeWarning $false $context = New-AzStorageContext -StorageAccountName "$env:ACCOUNT_NAME" -UseConnectedAccount -EnableFileBackupRequestIntent - Set-AzStorageFileContent -ShareName "$env:SHARE_NAME" -Source "diffdetailedfunctiontestresults.xlsx" -Path "health-diffdetailedfunctiontestresults.xlsx" -Context $context + Set-AzStorageFileContent -ShareName "$env:SHARE_NAME" -Source "diffdetailedfunctiontestresults.xlsx" -Path "health-diffdetailedfunctiontestresults.xlsx" -Context $context -Force exit 1 @@ -214,7 +214,7 @@ jobs: azPSVersion: latest inlineScript: | $context = New-AzStorageContext -StorageAccountName "$env:ACCOUNT_NAME" -UseConnectedAccount -EnableFileBackupRequestIntent - Set-AzStorageFileContent -ShareName "$env:SHARE_NAME" -Source "diffdetailedfunctiontestresults.xlsx" -Path "version-diffdetailedfunctiontestresults.xlsx" -Context $context + Set-AzStorageFileContent -ShareName "$env:SHARE_NAME" -Source "diffdetailedfunctiontestresults.xlsx" -Path "version-diffdetailedfunctiontestresults.xlsx" -Context $context -Force exit 1 - name: Save Latest Version if: ${{ hashFiles('diffdetailedfunctiontestresults.xlsx') == '' }} # Only if there were no differences diff --git a/src/qlpack.yml b/src/qlpack.yml index b0d094ee..9a18ca9e 100644 --- a/src/qlpack.yml +++ b/src/qlpack.yml @@ -2,7 +2,7 @@ # Licensed under the MIT license. name: microsoft/windows-drivers -version: 1.6.0 +version: 1.7.0 dependencies: codeql/cpp-all: ^4.2.0 microsoft/cpp-queries: ^0.0.4 diff --git a/src/windows-driver-suites/mustfix.qls b/src/windows-driver-suites/mustfix.qls index 454840ab..bb71ff33 100644 --- a/src/windows-driver-suites/mustfix.qls +++ b/src/windows-driver-suites/mustfix.qls @@ -14,7 +14,30 @@ - include: query path: - Likely Bugs/Arithmetic/BadAdditionOverflowCheck.ql + - Likely Bugs/Format/WrongNumberOfFormatArguments.ql - Likely Bugs/Memory Management/PointerOverflow.ql + - Likely Bugs/Memory Management/SuspiciousCallToStrncat.ql + - Likely Bugs/OO/UnsafeUseOfThis.ql + - Likely Bugs/Protocols/TlsSettingsMisconfiguration.ql + - Likely Bugs/Protocols/UseOfDeprecatedHardcodedProtocol.ql - Likely Bugs/Underspecified Functions/TooFewArguments.ql + - Microsoft/Likely Bugs/Conversion/BadOverflowGuard.ql + - Microsoft/Likely Bugs/Drivers/IncorrectUsageOfRtlCompareMemory.ql + - Microsoft/Security/Cryptography/BannedEncryption.ql + - Microsoft/Security/Cryptography/BannedModesCAPI.ql + - Microsoft/Security/Cryptography/BannedModesCNG.ql + - Microsoft/Security/Cryptography/HardcodedIVCNG.ql + - Microsoft/Security/MemoryAccess/EnumIndex/UncheckedBoundsEnumAsIndex.ql + - Security/CWE/CWE-078/ExecTainted.ql + - Security/CWE/CWE-114/UncontrolledProcessOperation.ql + - Security/CWE/CWE-120/BadlyBoundedWrite.ql + - Security/CWE/CWE-120/OverrunWrite.ql + - Security/CWE/CWE-131/NoSpaceForZeroTerminator.ql + - Security/CWE/CWE-170/ImproperNullTerminationTainted.ql - Security/CWE/CWE-190/ComparisonWithWiderType.ql - - Security/CWE/CWE-253/HResultBooleanConversion.ql \ No newline at end of file + - Security/CWE/CWE-253/HResultBooleanConversion.ql + - Security/CWE/CWE-327/OpenSslHeartbleed.ql + - Security/CWE/CWE-676/DangerousFunctionOverflow.ql + - Security/CWE/CWE-676/DangerousUseOfCin.ql + - Security/CWE/CWE-704/WcharCharConversion.ql + - Security/CWE/CWE-732/UnsafeDaclSecurityDescriptor.ql \ No newline at end of file diff --git a/src/windows-driver-suites/recommended.qls b/src/windows-driver-suites/recommended.qls index 4f95808f..93beaa10 100644 --- a/src/windows-driver-suites/recommended.qls +++ b/src/windows-driver-suites/recommended.qls @@ -3,31 +3,77 @@ - description: Recommended and required queries for Windows Drivers. - import: windows-driver-suites/mustfix.qls +- queries: . + from: microsoft/windows-drivers +- include: + query path: + - drivers/general/queries/AnnotationSyntax/AnnotationSyntax.ql + - drivers/general/queries/CurrentFunctionTypeNotCorrect/CurrentFunctionTypeNotCorrect.ql + - drivers/general/queries/DefaultPoolTag/DefaultPoolTag.ql + - drivers/general/queries/DriverEntrySaveBuffer/DriverEntrySaveBuffer.ql + - drivers/general/queries/ExaminedValue/ExaminedValue.ql + - drivers/general/queries/ExtendedDeprecatedApis/ExtendedDeprecatedApis.ql + - drivers/general/queries/IRPStackEntryCopy/IRPStackEntryCopy.ql + - drivers/general/queries/ImportantFunctionCallOptimizedOut/ImportantFunctionCallOptimizedOut.ql + - drivers/general/queries/ImproperNotOperatorOnZero/ImproperNotOperatorOnZero.ql + - drivers/general/queries/InvalidFunctionClassTypedef/InvalidFunctionClassTypedef.ql + - drivers/general/queries/InvalidFunctionPointerAnnotation/InvalidFunctionPointerAnnotation.ql + - drivers/general/queries/IoInitializeTimerCall/IoInitializeTimerCall.ql + - drivers/general/queries/IrqlAnnotationIssue/IrqlAnnotationIssue.ql + - drivers/general/queries/IrqlCancelRoutine/IrqlCancelRoutine.ql + - drivers/general/queries/IrqlFloatStateMismatch/IrqlFloatStateMismatch.ql + - drivers/general/queries/IrqlNotSaved/IrqlNotSaved.ql + - drivers/general/queries/IrqlNotUsed/IrqlNotUsed.ql + - drivers/general/queries/IrqlSetTooHigh/IrqlSetTooHigh.ql + - drivers/general/queries/IrqlSetTooLow/IrqlSetTooLow.ql + - drivers/general/queries/IrqlTooHigh/IrqlTooHigh.ql + - drivers/general/queries/IrqlTooLow/IrqlTooLow.ql + - drivers/general/queries/KeSetEventPageable/KeSetEventPageable.ql + - drivers/general/queries/MultithreadedAVCondition/MultithreadedAVCondition.ql + - drivers/general/queries/NtstatusExplicitCast/NtstatusExplicitCast.ql + - drivers/general/queries/NtstatusExplicitCast2/NtstatusExplicitCast2.ql + - drivers/general/queries/NtstatusExplicitCast3/NtstatusExplicitCast3.ql + - drivers/general/queries/NullCharacterPointerAssignment/NullCharacterPointerAssignment.ql + - drivers/general/queries/OperandAssignment/OperandAssignment.ql + - drivers/general/queries/PointerVariableSize/PointerVariableSize.ql + - drivers/general/queries/PoolTagIntegral/PoolTagIntegral.ql + - drivers/general/queries/RoleTypeCorrectlyUsed/RoleTypeCorrectlyUsed.ql + - drivers/general/queries/RoutineFunctionTypeNotExpected/RoutineFunctionTypeNotExpected.ql + - drivers/general/queries/StrSafe/StrSafe.ql + - drivers/general/queries/StrictTypeMatch/StrictTypeMatch.ql + - drivers/wdm/queries/IllegalFieldAccess/IllegalFieldAccess.ql + - drivers/wdm/queries/IllegalFieldAccess2/IllegalFieldAccess2.ql + - drivers/wdm/queries/IllegalFieldWrite/IllegalFieldWrite.ql + - drivers/wdm/queries/InitNotCleared/InitNotCleared.ql + - drivers/wdm/queries/KeWaitLocal/KeWaitLocal.ql + - drivers/wdm/queries/MultiplePagedCode/MultiplePagedCode.ql + - drivers/wdm/queries/ObReferenceMode/ObReferenceMode.ql + - drivers/wdm/queries/OpaqueMdlUse/OpaqueMdlUse.ql + - drivers/wdm/queries/OpaqueMdlWrite/OpaqueMdlWrite.ql + - drivers/wdm/queries/PendingStatusError/PendingStatusError.ql + - drivers/wdm/queries/WrongDispatchTableAssignment/WrongDispatchTableAssignment.ql + - microsoft/Likely Bugs/Boundary Violations/PaddingByteInformationDisclosure.ql + - microsoft/Likely Bugs/Conversion/BadOverflowGuard.ql + - microsoft/Likely Bugs/Conversion/InfiniteLoop.ql + - microsoft/Likely Bugs/Memory Management/UseAfterFree/UseAfterFree.ql + - microsoft/Likely Bugs/UninitializedPtrField.ql + - microsoft/Security/Crytpography/HardcodedIVCNG.ql - queries: . from: microsoft/cpp-queries version: 0.0.4 - include: query path: - - Likely Bugs/Format/WrongNumberOfFormatArguments.ql - - Likely Bugs/Memory Management/SuspiciousCallToStrncat.ql - - Likely Bugs/OO/UnsafeUseOfThis.ql - - Likely Bugs/Protocols/TlsSettingsMisconfiguration.ql - - Likely Bugs/Protocols/UseOfDeprecatedHardcodedProtocol.ql - - Microsoft/Likely Bugs/Conversion/BadOverflowGuard.ql - - Microsoft/Likely Bugs/Drivers/IncorrectUsageOfRtlCompareMemory.ql - - Microsoft/Security/Cryptography/BannedEncryption.ql - - Microsoft/Security/Cryptography/BannedModesCAPI.ql - - Microsoft/Security/Cryptography/BannedModesCNG.ql - - Microsoft/Security/Cryptography/HardcodedIVCNG.ql - - Microsoft/Security/MemoryAccess/EnumIndex/UncheckedBoundsEnumAsIndex.ql - - Security/CWE/CWE-078/ExecTainted.ql - - Security/CWE/CWE-114/UncontrolledProcessOperation.ql - - Security/CWE/CWE-120/BadlyBoundedWrite.ql - - Security/CWE/CWE-120/OverrunWrite.ql - - Security/CWE/CWE-131/NoSpaceForZeroTerminator.ql - - Security/CWE/CWE-170/ImproperNullTerminationTainted.ql - - Security/CWE/CWE-327/OpenSslHeartbleed.ql - - Security/CWE/CWE-676/DangerousFunctionOverflow.ql - - Security/CWE/CWE-676/DangerousUseOfCin.ql - - Security/CWE/CWE-704/WcharCharConversion.ql - - Security/CWE/CWE-732/UnsafeDaclSecurityDescriptor.ql + - Best Practices/Likely Errors/OffsetUseBeforeRangeCheck.ql + - Likely Bugs/Arithmetic/IntMultToLong.ql + - Likely Bugs/Arithmetic/SignedOverflowCheck.ql + - Likely Bugs/Conversion/CastArrayPointerArithmetic.ql + - Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.ql + - Likely Bugs/Memory Management/SuspiciousSizeof.ql + - Likely Bugs/Memory Management/UninitializedLocal.ql + - Security/CWE/CWE-121/UnterminatedVarargsCall.ql + - Security/CWE/CWE-457/ConditionallyUninitializedVariable.ql + - Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql + - Security/CWE/CWE-468/IncorrectPointerScaling.ql + - Security/CWE/CWE-468/IncorrectPointerScalingVoid.ql + - Security/CWE/CWE-676/PotentiallyDangerousFunction.ql + - Security/CWE/CWE-119/OverflowBuffer.ql \ No newline at end of file diff --git a/suites/windows_driver_mustfix.qls b/suites/windows_driver_mustfix.qls new file mode 100644 index 00000000..51c6eb7c --- /dev/null +++ b/suites/windows_driver_mustfix.qls @@ -0,0 +1,5 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT license. + +- description: This suite is deprecated, please use the suite file below. +- import: windows-driver-suites/mustfix.qls \ No newline at end of file diff --git a/suites/windows_driver_recommended.qls b/suites/windows_driver_recommended.qls new file mode 100644 index 00000000..102c17c1 --- /dev/null +++ b/suites/windows_driver_recommended.qls @@ -0,0 +1,5 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT license. + +- description: This suite is deprecated, please use the suite file below. +- import: windows-driver-suites/recommended.qls \ No newline at end of file