repo stringlengths 6 47 | file_url stringlengths 77 269 | file_path stringlengths 5 186 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-07 08:35:43 2026-01-07 08:55:24 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/report/report-configuration.go | pkg/report/report-configuration.go | package report
type ChaptersToShowHide string
const (
RiskRulesCheckedByThreagile ChaptersToShowHide = "RiskRulesCheckedByThreagile"
AssetRegister ChaptersToShowHide = "AssetRegister"
)
type ReportConfiguation struct {
HideChapter map[ChaptersToShowHide]bool
}
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/report/adocReport.go | pkg/report/adocReport.go | package report
import (
"fmt"
"image"
"io"
"log"
"os"
"path/filepath"
"regexp"
"sort"
"strconv"
"strings"
"time"
"github.com/threagile/threagile/pkg/types"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
type adocReport struct {
targetDirectory string
model *types.Model
mainFile ... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | true |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/report/risk-item.go | pkg/report/risk-item.go | package report
import "github.com/threagile/threagile/pkg/types"
type RiskItem struct {
Columns []string
Status types.RiskStatus
Severity types.RiskSeverity
}
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/report/excel-style.go | pkg/report/excel-style.go | package report
import (
"fmt"
"strings"
"github.com/threagile/threagile/pkg/types"
"github.com/xuri/excelize/v2"
)
type ExcelStyles struct {
severityCriticalBold int
severityCriticalCenter int
severityHighBold int
severityHighCenter int
severityElevatedBold int
severityElevatedCenter int
sev... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/report/excel.go | pkg/report/excel.go | package report
import (
"fmt"
"sort"
"strconv"
"strings"
"unicode/utf8"
"github.com/shopspring/decimal"
"github.com/threagile/threagile/pkg/types"
"github.com/xuri/excelize/v2"
)
func WriteRisksExcelToFile(parsedModel *types.Model, filename string, config reportConfigReader) error {
columns := new(ExcelColu... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/report/report-helper.go | pkg/report/report-helper.go | package report
import (
"sort"
"github.com/threagile/threagile/pkg/types"
)
func filteredByRiskStatus(parsedModel *types.Model, status types.RiskStatus) []*types.Risk {
filteredRisks := make([]*types.Risk, 0)
for _, risks := range parsedModel.GeneratedRisksByCategoryWithCurrentStatus() {
for _, risk := range r... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/report/generate.go | pkg/report/generate.go | package report
import (
"crypto/sha256"
"encoding/hex"
"errors"
"fmt"
"io"
"os"
"path/filepath"
"github.com/threagile/threagile/pkg/model"
"github.com/threagile/threagile/pkg/types"
)
type GenerateCommands struct {
DataFlowDiagram bool
DataAssetDiagram bool
RisksJSON bool
TechnicalAsset... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/report/colors.go | pkg/report/colors.go | package report
import (
"encoding/hex"
"github.com/jung-kurt/gofpdf"
)
const (
Amber = "#AF780E"
Green = "#008000"
Blue = "#000080"
DarkBlue = "#000060"
Black = "#000000"
Gray = "#444444"
LightGray = "#666666... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/report/report.go | pkg/report/report.go | package report
import (
"fmt"
"image"
"log"
"os"
"path/filepath"
"regexp"
"sort"
"strconv"
"strings"
"time"
"unicode/utf8"
"github.com/jung-kurt/gofpdf"
"github.com/jung-kurt/gofpdf/contrib/gofpdi"
"github.com/threagile/threagile/pkg/types"
"github.com/wcharczuk/go-chart"
"github.com/wcharczuk/go-char... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | true |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/report/json.go | pkg/report/json.go | package report
import (
"encoding/json"
"fmt"
"os"
"github.com/threagile/threagile/pkg/types"
)
func WriteRisksJSON(parsedModel *types.Model, filename string) error {
jsonBytes, err := json.Marshal(parsedModel.AllRisks())
if err != nil {
return fmt.Errorf("failed to marshal risks to JSON: %w", err)
}
err =... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/report/risk-group.go | pkg/report/risk-group.go | package report
import (
"fmt"
"github.com/mpvl/unique"
"github.com/xuri/excelize/v2"
"sort"
)
type RiskGroup struct {
Groups map[string]*RiskGroup
Items []RiskItem
}
func (what *RiskGroup) Init(riskItems []RiskItem) *RiskGroup {
*what = RiskGroup{
Groups: make(map[string]*RiskGroup),
Items: riskItems,
... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/risks.go | pkg/risks/risks.go | package risks
import (
"embed"
"fmt"
"github.com/threagile/threagile/pkg/risks/script"
"io/fs"
"github.com/threagile/threagile/pkg/risks/builtin"
"github.com/threagile/threagile/pkg/types"
)
func GetBuiltInRiskRules() types.RiskRules {
rules := make(types.RiskRules)
for _, rule := range []types.RiskRule{
b... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/scripts/accidental_secret_leak_test.go | pkg/risks/scripts/accidental_secret_leak_test.go | package scripts
import (
_ "embed"
"testing"
"github.com/stretchr/testify/assert"
"github.com/threagile/threagile/pkg/risks/script"
"github.com/threagile/threagile/pkg/types"
)
// TODO: fix when there are no technical assets in scope
// func TestAccidentalSecretLeakRuleGenerateRisksEmptyModelNotRisksCreated(t *... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/method.go | pkg/risks/script/method.go | package script
type Method struct {
Name string
Parameters []Variable
}
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/script.go | pkg/risks/script/script.go | package script
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
"github.com/threagile/threagile/pkg/risks/script/expressions"
"github.com/threagile/threagile/pkg/risks/script/statements"
"strings"
"github.com/threagile/threagile/pkg/types"
"gopkg.in/yaml.v3"
)
type Script struct {
id ... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/variable.go | pkg/risks/script/variable.go | package script
import (
"github.com/threagile/threagile/pkg/risks/script/common"
)
type Variable struct {
Name string
Expression common.Expression
}
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/risk-rule.go | pkg/risks/script/risk-rule.go | package script
import (
"fmt"
"io/fs"
"path/filepath"
"strings"
"github.com/threagile/threagile/pkg/input"
"github.com/threagile/threagile/pkg/types"
"gopkg.in/yaml.v3"
)
type RiskRule struct {
types.RiskRule
category types.RiskCategory
supportedTags []string
script *Script
}
func (what *Risk... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/property/greater-or-equal.go | pkg/risks/script/property/greater-or-equal.go | package property
type GreaterOrEqual struct {
negated bool
}
func NewGreaterOrEqual() *GreaterOrEqual {
return new(GreaterOrEqual)
}
func (what *GreaterOrEqual) Path() {
}
func (what *GreaterOrEqual) Negate() {
what.negated = !what.negated
}
func (what *GreaterOrEqual) Negated() bool {
return what.negated
}
f... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/property/item-with-path.go | pkg/risks/script/property/item-with-path.go | package property
type ItemWithPath interface {
Item
Path()
}
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/property/less-or-equal.go | pkg/risks/script/property/less-or-equal.go | package property
type LessOrEqual struct {
negated bool
}
func NewLessOrEqual() *LessOrEqual {
return new(LessOrEqual)
}
func (what *LessOrEqual) Path() {
}
func (what *LessOrEqual) Negate() {
what.negated = !what.negated
}
func (what *LessOrEqual) Negated() bool {
return what.negated
}
func (what *LessOrEqua... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/property/blank.go | pkg/risks/script/property/blank.go | package property
/*
this is a property for a value that should not be printed as part of the history, such as structured values
*/
type Blank struct {
}
func NewBlank() *Blank {
return new(Blank)
}
func (what *Blank) Negate() {
}
func (what *Blank) Negated() bool {
return false
}
func (what *Blank) Text() []st... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/property/texter.go | pkg/risks/script/property/texter.go | package property
type Texter interface {
Text() []string
}
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/property/equal.go | pkg/risks/script/property/equal.go | package property
type Equal struct {
negated bool
}
func NewEqual() *Equal {
return new(Equal)
}
func (what *Equal) Path() {
}
func (what *Equal) Negate() {
what.negated = !what.negated
}
func (what *Equal) Negated() bool {
return what.negated
}
func (what *Equal) Text() []string {
if what.negated {
return... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/property/greater.go | pkg/risks/script/property/greater.go | package property
type Greater struct {
negated bool
}
func NewGreater() *Greater {
return new(Greater)
}
func (what *Greater) Path() {
}
func (what *Greater) Negate() {
what.negated = !what.negated
}
func (what *Greater) Negated() bool {
return what.negated
}
func (what *Greater) Text() []string {
if what.ne... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/property/less.go | pkg/risks/script/property/less.go | package property
type Less struct {
negated bool
}
func NewLess() *Less {
return new(Less)
}
func (what *Less) Path() {
}
func (what *Less) Negate() {
what.negated = !what.negated
}
func (what *Less) Negated() bool {
return what.negated
}
func (what *Less) Text() []string {
if what.negated {
return []strin... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/property/value.go | pkg/risks/script/property/value.go | package property
import (
"fmt"
)
type Value struct {
value any
negated bool
}
func NewValue(value any) *Value {
return &Value{value: value}
}
func (what *Value) Negate() {
what.negated = !what.negated
}
func (what *Value) Negated() bool {
return what.negated
}
func (what *Value) Text() []string {
text :... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/property/true.go | pkg/risks/script/property/true.go | package property
type True struct {
negated bool
}
func NewTrue() *True {
return new(True)
}
func (what *True) Negate() {
what.negated = !what.negated
}
func (what *True) Negated() bool {
return what.negated
}
func (what *True) Text() []string {
if what.negated {
return []string{"false"}
}
return []strin... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/property/false.go | pkg/risks/script/property/false.go | package property
type False struct {
negated bool
}
func NewFalse() *False {
return new(False)
}
func (what *False) Value() any {
return what.negated
}
func (what *False) Negate() {
what.negated = !what.negated
}
func (what *False) Negated() bool {
return what.negated
}
func (what *False) Text() []string {
... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/property/item.go | pkg/risks/script/property/item.go | package property
type Item interface {
Negate()
Negated() bool
Text() []string
}
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/property/not-equal.go | pkg/risks/script/property/not-equal.go | package property
type NotEqual struct {
negated bool
}
func NewNotEqual() *NotEqual {
return new(NotEqual)
}
func (what *NotEqual) Path() {
}
func (what *NotEqual) Negate() {
what.negated = !what.negated
}
func (what *NotEqual) Negated() bool {
return what.negated
}
func (what *NotEqual) Text() []string {
if... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/statements/assign-statement.go | pkg/risks/script/statements/assign-statement.go | package statements
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
"github.com/threagile/threagile/pkg/risks/script/expressions"
)
type AssignStatement struct {
literal string
items map[string]common.Expression
}
func (what *AssignStatement) Parse(script any) (common.Statement, any, er... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/statements/if-statement.go | pkg/risks/script/statements/if-statement.go | package statements
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
"github.com/threagile/threagile/pkg/risks/script/expressions"
)
type IfStatement struct {
literal string
expression common.BoolExpression
yesPath common.Statement
noPath common.Statement
}
func (what *IfStatem... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/statements/explain-statement.go | pkg/risks/script/statements/explain-statement.go | package statements
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
"github.com/threagile/threagile/pkg/risks/script/expressions"
)
type ExplainStatement struct {
literal string
expression common.StringExpression
}
func (what *ExplainStatement) Parse(script any) (common.Statement, any,... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/statements/return-statement.go | pkg/risks/script/statements/return-statement.go | package statements
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
"github.com/threagile/threagile/pkg/risks/script/expressions"
)
type ReturnStatement struct {
literal string
expression common.Expression
}
func (what *ReturnStatement) Parse(script any) (common.Statement, any, error) ... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/statements/statement-list.go | pkg/risks/script/statements/statement-list.go | package statements
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type StatementList struct {
literal string
statements []common.Statement
}
func (what *StatementList) Parse(script any) (common.Statement, any, error) {
what.literal = common.ToLiteral(script)
switch castScript := ... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/statements/defer-statement.go | pkg/risks/script/statements/defer-statement.go | package statements
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type DeferStatement struct {
literal string
statements []common.Statement
}
func (what *DeferStatement) Parse(script any) (common.Statement, any, error) {
what.literal = common.ToLiteral(script)
switch castScript :... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/statements/loop-statement.go | pkg/risks/script/statements/loop-statement.go | package statements
import (
"fmt"
"github.com/shopspring/decimal"
"github.com/threagile/threagile/pkg/risks/script/common"
"github.com/threagile/threagile/pkg/risks/script/expressions"
)
type LoopStatement struct {
literal string
in common.ValueExpression
item string
index string
body common.Sta... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/statements/statement.go | pkg/risks/script/statements/statement.go | package statements
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type Statement struct {
}
func (what *Statement) Parse(name string, body any) (common.Statement, any, error) {
switch name {
case common.Assign:
statement, errorScript, parseError := new(AssignStatement).Parse(body)
... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/statements/method-statement.go | pkg/risks/script/statements/method-statement.go | package statements
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type MethodStatement struct {
literal string
parameters []string
body common.Statement
}
func (what *MethodStatement) Parse(script any) (common.Statement, any, error) {
what.literal = common.ToLiteral(script)
... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/any-expression.go | pkg/risks/script/expressions/any-expression.go | package expressions
import (
"fmt"
"github.com/shopspring/decimal"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type AnyExpression struct {
literal string
in common.ValueExpression
item string
index string
expression common.BoolExpression
}
func (what *AnyExpression) Parse... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/array-expression.go | pkg/risks/script/expressions/array-expression.go | package expressions
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type ArrayExpression struct {
literal string
expressions common.ExpressionList
}
func (what *ArrayExpression) ParseArray(script any) (common.ArrayExpression, any, error) {
what.literal = common.ToLiteral(script)
... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/greater-expression.go | pkg/risks/script/expressions/greater-expression.go | package expressions
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type GreaterExpression struct {
literal string
first common.ValueExpression
second common.ValueExpression
as common.StringExpression
}
func (what *GreaterExpression) ParseBool(script any) (common.BoolExpressio... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/value-expression.go | pkg/risks/script/expressions/value-expression.go | package expressions
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
"regexp"
"strconv"
"strings"
"github.com/shopspring/decimal"
)
type ValueExpression struct {
literal string
value any
}
func (what *ValueExpression) ParseArray(script any) (common.ArrayExpression, any, error) {
wh... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/equal-or-less-expression.go | pkg/risks/script/expressions/equal-or-less-expression.go | package expressions
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type EqualOrLessExpression struct {
literal string
first common.ValueExpression
second common.ValueExpression
as string
}
func (what *EqualOrLessExpression) ParseBool(script any) (common.BoolExpression, any, e... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/or-expression.go | pkg/risks/script/expressions/or-expression.go | package expressions
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type OrExpression struct {
literal string
expressions []common.BoolExpression
}
func (what *OrExpression) ParseBool(script any) (common.BoolExpression, any, error) {
what.literal = common.ToLiteral(script)
item, ... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/expression-list.go | pkg/risks/script/expressions/expression-list.go | package expressions
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type ExpressionList struct {
literal string
expressions []common.Expression
}
func (what *ExpressionList) ParseExpression(script map[string]any) (common.Expression, any, error) {
for key, value := range script {
... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/equal-or-greater-expression.go | pkg/risks/script/expressions/equal-or-greater-expression.go | package expressions
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type EqualOrGreaterExpression struct {
literal string
first common.ValueExpression
second common.ValueExpression
as string
}
func (what *EqualOrGreaterExpression) ParseBool(script any) (common.BoolExpression, ... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/contains-expression.go | pkg/risks/script/expressions/contains-expression.go | package expressions
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type ContainsExpression struct {
literal string
item common.ValueExpression
in common.ValueExpression
as string
}
func (what *ContainsExpression) ParseBool(script any) (common.BoolExpression, any, error) ... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/false-expression.go | pkg/risks/script/expressions/false-expression.go | package expressions
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type FalseExpression struct {
literal string
expression common.BoolExpression
}
func (what *FalseExpression) ParseBool(script any) (common.BoolExpression, any, error) {
what.literal = common.ToLiteral(script)
item... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/less-expression.go | pkg/risks/script/expressions/less-expression.go | package expressions
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type LessExpression struct {
literal string
first common.ValueExpression
second common.ValueExpression
as string
}
func (what *LessExpression) ParseBool(script any) (common.BoolExpression, any, error) {
what.... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/equal-expression.go | pkg/risks/script/expressions/equal-expression.go | package expressions
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type EqualExpression struct {
literal string
first common.ValueExpression
second common.ValueExpression
as string
}
func (what *EqualExpression) ParseBool(script any) (common.BoolExpression, any, error) {
wha... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/not-equal-expression.go | pkg/risks/script/expressions/not-equal-expression.go | package expressions
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type NotEqualExpression struct {
literal string
first common.ValueExpression
second common.ValueExpression
as string
}
func (what *NotEqualExpression) ParseBool(script any) (common.BoolExpression, any, error) ... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/and-expression.go | pkg/risks/script/expressions/and-expression.go | package expressions
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type AndExpression struct {
literal string
expressions []common.BoolExpression
}
func (what *AndExpression) ParseBool(script any) (common.BoolExpression, any, error) {
what.literal = common.ToLiteral(script)
item... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/count-expression.go | pkg/risks/script/expressions/count-expression.go | package expressions
import (
"fmt"
"github.com/shopspring/decimal"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type CountExpression struct {
literal string
in common.ValueExpression
item string
index string
expression common.BoolExpression
}
func (what *CountExpression) ... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/true-expression.go | pkg/risks/script/expressions/true-expression.go | package expressions
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type TrueExpression struct {
literal string
expression common.BoolExpression
}
func (what *TrueExpression) ParseBool(script any) (common.BoolExpression, any, error) {
what.literal = common.ToLiteral(script)
item, ... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/expressions/all-expression.go | pkg/risks/script/expressions/all-expression.go | package expressions
import (
"fmt"
"github.com/shopspring/decimal"
"github.com/threagile/threagile/pkg/risks/script/common"
)
type AllExpression struct {
literal string
in common.ValueExpression
item string
index string
expression common.BoolExpression
}
func (what *AllExpression) Parse... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/key-words.go | pkg/risks/script/common/key-words.go | package common
const (
Risk = "risk"
Data = "data"
ID = "id"
Match = "match"
Utils = "utils"
Assign = "assign"
Loop = "loop"
Do = "do"
Return = "return"
In = "in"
Item = "item"
Index = "index"
Parameter = "parameter"
Parameters = "parameters"
As = "as"
First ... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/event.go | pkg/risks/script/common/event.go | package common
import (
"strings"
)
type Event struct {
Origin *Path
Property *Property
Events []*Event
}
func NewEvent(property *Property, path *Path) *Event {
return &Event{
Property: property,
Origin: path,
}
}
func NewEventFrom(property *Property, firstValue Value, value ...Value) *Event {
var ... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/array-expression.go | pkg/risks/script/common/array-expression.go | package common
type ArrayExpression interface {
ParseArray(script any) (ArrayExpression, any, error)
ParseAny(script any) (Expression, any, error)
EvalArray(scope *Scope) (*ArrayValue, string, error)
EvalAny(scope *Scope) (Value, string, error)
Literal() string
}
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/literal.go | pkg/risks/script/common/literal.go | package common
import (
"fmt"
"gopkg.in/yaml.v3"
)
func ToLiteral(script any) string {
switch script.(type) {
case []any, map[string]any:
data, marshalError := yaml.Marshal(script)
if marshalError != nil {
return fmt.Sprintf("%v", script)
}
return string(data)
default:
return fmt.Sprintf("%v", sc... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/string-expression.go | pkg/risks/script/common/string-expression.go | package common
type StringExpression interface {
ParseString(script any) (StringExpression, any, error)
ParseAny(script any) (Expression, any, error)
EvalString(scope *Scope) (*StringValue, string, error)
EvalAny(scope *Scope) (Value, string, error)
Literal() string
}
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/value-expression.go | pkg/risks/script/common/value-expression.go | package common
type ValueExpression interface {
ParseArray(script any) (ArrayExpression, any, error)
ParseBool(script any) (BoolExpression, any, error)
ParseDecimal(script any) (DecimalExpression, any, error)
ParseString(script any) (StringExpression, any, error)
ParseAny(script any) (Expression, any, error)
Eva... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/path.go | pkg/risks/script/common/path.go | package common
import (
"fmt"
"strings"
)
type Path struct {
Path []string
}
func NewPath(path ...string) *Path {
return new(Path).SetPath(path...)
}
func EmptyPath() *Path {
return new(Path)
}
func (what *Path) Copy() *Path {
if what == nil {
return what
}
return &Path{
Path: what.Path[:],
}
}
func... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/bool-value.go | pkg/risks/script/common/bool-value.go | package common
import (
"fmt"
)
type BoolValue struct {
value bool
name Path
event *Event
}
func (what BoolValue) Value() any {
return what.value
}
func (what BoolValue) Name() Path {
return what.name
}
func (what BoolValue) SetName(name ...string) {
what.name.SetPath(name...)
}
func (what BoolValue) Even... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/string-value.go | pkg/risks/script/common/string-value.go | package common
import (
"fmt"
)
type StringValue struct {
value string
name Path
event *Event
}
func (what StringValue) Value() any {
return what.value
}
func (what StringValue) Name() Path {
return what.name
}
func (what StringValue) SetName(name ...string) {
what.name.SetPath(name...)
}
func (what Strin... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/cast.go | pkg/risks/script/common/cast.go | package common
import (
"fmt"
"github.com/shopspring/decimal"
"github.com/threagile/threagile/pkg/types"
)
const (
authentication = "authentication"
authorization = "authorization"
confidentiality = "confidentiality"
criticality = "criticality"
integrity = "integrity"
availability = "availab... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/built-in.go | pkg/risks/script/common/built-in.go | package common
import (
"fmt"
"github.com/shopspring/decimal"
"github.com/threagile/threagile/pkg/types"
)
const (
calculateSeverity = "calculate_severity"
)
var (
callers = map[string]builtInFunc{
calculateSeverity: calculateSeverityFunc,
}
)
type builtInFunc func(parameters []Value) (Value, error)
func I... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/explain-statement.go | pkg/risks/script/common/explain-statement.go | package common
type ExplainStatement interface {
Statement
Eval(scope *Scope) string
}
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/expression-list.go | pkg/risks/script/common/expression-list.go | package common
type ExpressionList interface {
ParseExpression(script map[string]any) (Expression, any, error)
ParseArray(script any) (ExpressionList, any, error)
ParseAny(script any) (Expression, any, error)
EvalAny(scope *Scope) (Value, string, error)
Expressions() []Expression
Literal() string
}
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/array-value.go | pkg/risks/script/common/array-value.go | package common
import (
"fmt"
)
type ArrayValue struct {
value []Value
name Path
event *Event
}
func (what ArrayValue) Value() any {
return what.value
}
func (what ArrayValue) Name() Path {
return what.name
}
func (what ArrayValue) SetName(name ...string) {
what.name.SetPath(name...)
}
func (what ArrayVal... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/history.go | pkg/risks/script/common/history.go | package common
import (
"strings"
)
type History []*Event
func NewHistory(item *Event) History {
return new(History).New(item)
}
func (what History) New(item *Event) History {
if item != nil {
return append(History{item}, what...)
}
return what
}
func (what History) String() string {
return strings.Join(w... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/expression.go | pkg/risks/script/common/expression.go | package common
type Expression interface {
ParseAny(script any) (Expression, any, error)
EvalAny(scope *Scope) (Value, string, error)
Literal() string
}
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/value.go | pkg/risks/script/common/value.go | package common
type Value interface {
PlainValue() any
Value() any
Name() Path
SetName(name ...string)
Event() *Event
Text() []string
}
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/decimal-expression.go | pkg/risks/script/common/decimal-expression.go | package common
type DecimalExpression interface {
ParseDecimal(script any) (DecimalExpression, any, error)
ParseAny(script any) (Expression, any, error)
EvalDecimal(scope *Scope) (*DecimalValue, string, error)
EvalAny(scope *Scope) (Value, string, error)
Literal() string
}
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/property.go | pkg/risks/script/common/property.go | package common
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/property"
)
type Property struct {
Property property.Item
Path *Path
}
func NewBlankProperty() *Property {
return &Property{
Property: property.NewBlank(),
}
}
func NewEqualProperty(value Value) *Property {
var path *Path
i... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/decimal-value.go | pkg/risks/script/common/decimal-value.go | package common
import (
"fmt"
"github.com/shopspring/decimal"
)
type DecimalValue struct {
value decimal.Decimal
name Path
event *Event
}
func (what DecimalValue) Value() any {
return what.value
}
func (what DecimalValue) Name() Path {
return what.name
}
func (what DecimalValue) SetName(name ...string) {
... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/bool-expression.go | pkg/risks/script/common/bool-expression.go | package common
type BoolExpression interface {
ParseBool(script any) (BoolExpression, any, error)
ParseAny(script any) (Expression, any, error)
EvalBool(scope *Scope) (*BoolValue, string, error)
EvalAny(scope *Scope) (Value, string, error)
Literal() string
}
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/compare.go | pkg/risks/script/common/compare.go | package common
import (
"fmt"
"github.com/threagile/threagile/pkg/risks/script/property"
)
func Compare(first Value, second Value, as string) (*Event, error) {
firstValue := first
secondValue := second
if len(as) > 0 {
var castError error
firstValue, castError = CastValue(firstValue, as)
if castError != ni... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/any-value.go | pkg/risks/script/common/any-value.go | package common
import (
"fmt"
"github.com/shopspring/decimal"
)
type AnyValue struct {
value any
name Path
event *Event
}
func (what AnyValue) Value() any {
return what.value
}
func (what AnyValue) Name() Path {
return what.name
}
func (what AnyValue) SetName(name ...string) {
what.name.SetPath(name...)
}... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/statement.go | pkg/risks/script/common/statement.go | package common
type Statement interface {
Run(scope *Scope) (string, error)
Literal() string
}
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/values.go | pkg/risks/script/common/values.go | package common
import "fmt"
type Values map[string]Value
func (what Values) Copy() (Values, error) {
values := make(Values, 0)
for name, value := range what {
switch castValue := value.(type) {
case *AnyValue:
values[name] = SomeValue(castValue.Value(), castValue.Event())
case *ArrayValue:
values[name... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/scope.go | pkg/risks/script/common/scope.go | package common
import (
"gopkg.in/yaml.v3"
"strings"
"github.com/threagile/threagile/pkg/types"
)
type Scope struct {
Parent *Scope
Category *types.RiskCategory
Args []Value
Vars map[string]Value
Model map[string]any
Risk map[string]any
Methods map[string]Statement
D... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/script/common/value-list.go | pkg/risks/script/common/value-list.go | package common
type ValueList []Value
| go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/code_backdooring_rule.go | pkg/risks/builtin/code_backdooring_rule.go | package builtin
import (
"github.com/threagile/threagile/pkg/types"
)
type CodeBackdooringRule struct{}
func NewCodeBackdooringRule() *CodeBackdooringRule {
return &CodeBackdooringRule{}
}
func (*CodeBackdooringRule) Category() *types.RiskCategory {
return &types.RiskCategory{
ID: "code-backdooring",
Titl... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/untrusted_deserialization_rule.go | pkg/risks/builtin/untrusted_deserialization_rule.go | package builtin
import (
"github.com/threagile/threagile/pkg/types"
)
type UntrustedDeserializationRule struct{}
func NewUntrustedDeserializationRule() *UntrustedDeserializationRule {
return &UntrustedDeserializationRule{}
}
func (*UntrustedDeserializationRule) Category() *types.RiskCategory {
return &types.Risk... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/push_instead_of_pull_deployment_rule_test.go | pkg/risks/builtin/push_instead_of_pull_deployment_rule_test.go | package builtin
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/threagile/threagile/pkg/types"
)
func TestPushInsteadPullDeploymentRuleGenerateRisksEmptyModelNotRisksCreated(t *testing.T) {
rule := NewPushInsteadPullDeploymentRule()
risks, err := rule.GenerateRisks(&types.Model{})
assert.... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/container_platform_escape_rule.go | pkg/risks/builtin/container_platform_escape_rule.go | package builtin
import (
"github.com/threagile/threagile/pkg/types"
)
type ContainerPlatformEscapeRule struct{}
func NewContainerPlatformEscapeRule() *ContainerPlatformEscapeRule {
return &ContainerPlatformEscapeRule{}
}
func (*ContainerPlatformEscapeRule) Category() *types.RiskCategory {
return &types.RiskCateg... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/ldap_injection_rule.go | pkg/risks/builtin/ldap_injection_rule.go | package builtin
import (
"github.com/threagile/threagile/pkg/types"
)
type LdapInjectionRule struct{}
func NewLdapInjectionRule() *LdapInjectionRule {
return &LdapInjectionRule{}
}
func (*LdapInjectionRule) Category() *types.RiskCategory {
return &types.RiskCategory{
ID: "ldap-injection",
Title: "LDAP-Inj... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/cross_site_scripting_rule_test.go | pkg/risks/builtin/cross_site_scripting_rule_test.go | package builtin
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/threagile/threagile/pkg/types"
)
func TestCrossSiteScriptingRuleGenerateRisksEmptyModelNotRisksCreated(t *testing.T) {
rule := NewCrossSiteScriptingRule()
risks, err := rule.GenerateRisks(&types.Model{})
assert.Nil(t, err)
a... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/missing_authentication_second_factor_rule_test.go | pkg/risks/builtin/missing_authentication_second_factor_rule_test.go | package builtin
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/threagile/threagile/pkg/types"
)
func TestMissingAuthenticationSecondFactorRuleGenerateRisksEmptyModelNoRisksCreated(t *testing.T) {
rule := NewMissingAuthenticationSecondFactorRule(NewMissingAuthenticationRule())
risks, err :=... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/missing_file_validation_rule_test.go | pkg/risks/builtin/missing_file_validation_rule_test.go | package builtin
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/threagile/threagile/pkg/types"
)
func TestMissingFileValidationRuleGenerateRisksEmptyModelNoRisksCreated(t *testing.T) {
rule := NewMissingFileValidationRule()
risks, err := rule.GenerateRisks(&types.Model{})
assert.Nil(t, er... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/helpers.go | pkg/risks/builtin/helpers.go | package builtin
import (
"strings"
"github.com/threagile/threagile/pkg/types"
)
func isAcrossTrustBoundaryNetworkOnly(parsedModel *types.Model, communicationLink *types.CommunicationLink) bool {
isAcrossNetworkTrustBoundary := func(
trustBoundaryOfSourceAsset *types.TrustBoundary, trustBoundaryOfTargetAsset *t... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/wrong_communication_link_content_rule.go | pkg/risks/builtin/wrong_communication_link_content_rule.go | package builtin
import (
"github.com/threagile/threagile/pkg/types"
)
type WrongCommunicationLinkContentRule struct{}
func NewWrongCommunicationLinkContentRule() *WrongCommunicationLinkContentRule {
return &WrongCommunicationLinkContentRule{}
}
func (*WrongCommunicationLinkContentRule) Category() *types.RiskCateg... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/missing_identity_store_rule_test.go | pkg/risks/builtin/missing_identity_store_rule_test.go | package builtin
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
"github.com/threagile/threagile/pkg/types"
)
func TestMissingIdentityStoreRuleGenerateRisksEmptyModelNotRisksCreated(t *testing.T) {
rule := NewMissingIdentityStoreRule()
risks, err := rule.GenerateRisks(&types.Model{})
assert.Nil... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/untrusted_deserialization_rule_test.go | pkg/risks/builtin/untrusted_deserialization_rule_test.go | package builtin
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
"github.com/threagile/threagile/pkg/types"
)
func TestUntrustedDeserializationRuleGenerateRisksEmptyModelNotRisksCreated(t *testing.T) {
rule := NewUntrustedDeserializationRule()
risks, err := rule.GenerateRisks(&types.Model{})
as... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/missing_authentication_rule.go | pkg/risks/builtin/missing_authentication_rule.go | package builtin
import (
"github.com/threagile/threagile/pkg/types"
)
type MissingAuthenticationRule struct{}
func NewMissingAuthenticationRule() *MissingAuthenticationRule {
return &MissingAuthenticationRule{}
}
func (*MissingAuthenticationRule) Category() *types.RiskCategory {
return &types.RiskCategory{
ID:... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/container_baseimage_backdooring_rule.go | pkg/risks/builtin/container_baseimage_backdooring_rule.go | package builtin
import (
"github.com/threagile/threagile/pkg/types"
)
type ContainerBaseImageBackdooringRule struct{}
func NewContainerBaseImageBackdooringRule() *ContainerBaseImageBackdooringRule {
return &ContainerBaseImageBackdooringRule{}
}
func (*ContainerBaseImageBackdooringRule) Category() *types.RiskCateg... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/accidental_secret_leak_rule_test.go | pkg/risks/builtin/accidental_secret_leak_rule_test.go | package builtin
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/threagile/threagile/pkg/types"
)
func TestAccidentalSecretLeakRuleGenerateRisksEmptyModelNotRisksCreated(t *testing.T) {
rule := NewAccidentalSecretLeakRule()
risks, err := rule.GenerateRisks(&types.Model{})
assert.Nil(t, err... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/mixed_targets_on_shared_runtime_rule.go | pkg/risks/builtin/mixed_targets_on_shared_runtime_rule.go | package builtin
import (
"sort"
"github.com/threagile/threagile/pkg/types"
)
type MixedTargetsOnSharedRuntimeRule struct{}
func NewMixedTargetsOnSharedRuntimeRule() *MixedTargetsOnSharedRuntimeRule {
return &MixedTargetsOnSharedRuntimeRule{}
}
func (*MixedTargetsOnSharedRuntimeRule) Category() *types.RiskCatego... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Threagile/threagile | https://github.com/Threagile/threagile/blob/293892c9c3a6bb287f66b4b048d2fb1fae2d3676/pkg/risks/builtin/unguarded_direct_datastore_access_rule_test.go | pkg/risks/builtin/unguarded_direct_datastore_access_rule_test.go | package builtin
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/threagile/threagile/pkg/types"
)
func TestUnguardedDirectDatastoreAccessRuleGenerateRisksEmptyModelNotRisksCreated(t *testing.T) {
rule := NewUnguardedDirectDatastoreAccessRule()
risks, err := rule.GenerateRisks(&types.Model{})... | go | MIT | 293892c9c3a6bb287f66b4b048d2fb1fae2d3676 | 2026-01-07T10:38:05.901794Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.