Skip to content

Commit 0d36ebc

Browse files
committed
feat(lib): Update framework support
1 parent 2eac762 commit 0d36ebc

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed

ql/lib/bicep.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ import codeql.Locations
22
import codeql.files.FileSystem
33
// AST
44
import codeql.bicep.AST
5+
// Frameworks
6+
import codeql.bicep.Frameworks

ql/lib/codeql/bicep/Frameworks.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import frameworks.Microsoft.Compute
2+
import frameworks.Microsoft.Network
3+
import frameworks.Microsoft.Storage

ql/lib/codeql/bicep/ast/Resources.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
private import AstNodes
2+
private import codeql.Locations
23
private import Expr
34
private import Idents
45
private import Literals
@@ -92,9 +93,11 @@ class Resource extends TResource {
9293
result = resource.getProperty(name)
9394
}
9495

95-
string toString() { result = "Resource[" + resource.getIdentifier().getName() + "]" }
96+
string toString() { result = resource.toString() }
9697

9798
string getAPrimaryQlClass() { result = "Resource" }
99+
100+
Location getLocation() { result = resource.getLocation() }
98101
}
99102

100103
cached

ql/lib/codeql/bicep/frameworks/Microsoft/Compute.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
private import bicep
2-
private import Network
32

43
/**
54
* A resource of type Microsoft.Compute/virtualMachines

ql/lib/codeql/bicep/frameworks/Microsoft/Storage.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ module Storage {
1414

1515
StorageAccountsProperties() { this = storageAccounts.getProperty("properties") }
1616

17+
/**
18+
* The property "supportsHttpsTrafficOnly" indicates whether the storage account
19+
* supports only HTTPS traffic. If this property is not set, it defaults to true.
20+
*/
1721
boolean getSupportsHttpsTrafficOnly() {
18-
result = this.getProperty("supportsHttpsTrafficOnly").(Boolean).getBool()
22+
exists(Boolean bl | bl = this.getProperty("supportsHttpsTrafficOnly") | result = bl.getBool())
1923
}
2024
}
2125

0 commit comments

Comments
 (0)