You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/codeql/codeql-language-guides/customizing-library-models-for-go.rst
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,15 +107,15 @@ The remaining values are used to define the ``access path``, the ``kind``, and t
107
107
- The eighth value ``sql-injection`` is the kind of the sink. The sink kind is used to define the queries where the sink is in scope. In this case - the SQL injection queries.
108
108
- The ninth value ``manual`` is the provenance of the sink, which is used to identify the origin of the sink.
109
109
110
-
Example: Taint source from the ``net`` package
111
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112
-
This example shows how the Go query pack models the return value from the ``Listen`` method as a ``remote`` source.
113
-
This is the ``Listen`` function which is located in the ``net`` package.
110
+
Example: Taint source from the ``net/http`` package
Since we are adding a new source, we need to add a tuple to the ``sourceModel`` extensible predicate.
136
136
The first five values identify the function to be modeled as a source.
137
137
138
-
- The first value ``net`` is the package name.
139
-
- The second value ``""`` is left blank, since the function is not a method of a type.
140
-
- The third value ``False`` is a flag that indicates whether or not the source also applies to all overrides of the method.
141
-
- The fourth value ``Listen`` is the function name.
138
+
- The first value ``net/http`` is the package name.
139
+
- The second value ``Request`` is the type name, since the function is a method of the ``Request`` type.
140
+
- The third value ``True`` is a flag that indicates whether or not the source also applies to all overrides of the method.
141
+
- The fourth value ``FormValue`` is the function name.
142
142
- The fifth value ``""`` is the function input type signature. For Go it should always be an empty string. It is needed for other languages where multiple functions or methods may have the same name and they need to be distinguished by the number and types of the arguments.
143
143
144
144
The sixth value should be left empty and is out of scope for this documentation.
0 commit comments