diff --git a/daemon/conman/connection.go b/daemon/conman/connection.go index fe9f671766..c4347a18fc 100644 --- a/daemon/conman/connection.go +++ b/daemon/conman/connection.go @@ -111,7 +111,7 @@ func newConnectionImpl(nfp *netfilter.Packet, c *Connection, protoType string) ( c.Process.ReadCmdline() c.Process.CWD = aevent.ProcDir audit.Lock.RUnlock() - // if the proc dir contains non alhpa-numeric chars the field is empty + // if the proc dir contains non alpha-numeric chars the field is empty if c.Process.CWD == "" { c.Process.ReadCwd() } diff --git a/daemon/core/system.go b/daemon/core/system.go index 835c71aed4..af76fbe257 100644 --- a/daemon/core/system.go +++ b/daemon/core/system.go @@ -179,7 +179,7 @@ func CheckSysRequirements() { ] ` - reqsFullfiled := true + reqsFulfilled := true dec := json.NewDecoder(strings.NewReader(reqsList)) for { var reqs []ReqsList @@ -206,7 +206,7 @@ func CheckSysRequirements() { if checkOk { fmt.Printf("\n\t* %s\t %s\n", log.Bold(log.Green(req.Item)), log.Bold(log.Green("✔"))) } else { - reqsFullfiled = false + reqsFulfilled = false fmt.Printf("\n\t* %s\t %s\n", log.Bold(log.Red(req.Item)), log.Bold(log.Red("✘"))) } fmt.Println() @@ -216,11 +216,11 @@ func CheckSysRequirements() { if IsTraceFSMounted() { fmt.Printf("\t* %s\t %s\n\n", log.Bold(log.Green("tracefs mount")), log.Bold(log.Green("✔"))) } else { - reqsFullfiled = false + reqsFulfilled = false fmt.Printf("\t* %s\t %s\n\n", log.Bold(log.Red("tracefs mount not found, needed for syscalls (mount -t tracefs none /sys/kernel/tracing/)")), log.Bold(log.Red("✘"))) } - if !reqsFullfiled { + if !reqsFulfilled { log.Raw("\n%sWARNING:%s Your kernel doesn't support some of the features OpenSnitch needs:\nRead more: https://github.com/evilsocket/opensnitch/issues/774\n", log.FG_WHITE+log.BG_YELLOW, log.RESET) } } diff --git a/daemon/dns/ebpfhook.go b/daemon/dns/ebpfhook.go index 8bd8622041..36f4881b51 100644 --- a/daemon/dns/ebpfhook.go +++ b/daemon/dns/ebpfhook.go @@ -131,7 +131,7 @@ func ListenerEbpf(ebpfModPath string) error { // libbcc resolves the offsets for us. without bcc the offset for uprobes must parsed from the elf files // some how 0 must be replaced with the offset of getaddrinfo bcc does this using bcc_resolve_symname - // Attaching to uprobe using perf open might be a better aproach requires https://github.com/iovisor/gobpf/pull/277 + // Attaching to uprobe using perf open might be a better approach requires https://github.com/iovisor/gobpf/pull/277 libcFile, err := findLibc() if err != nil { diff --git a/daemon/dns/systemd/monitor.go b/daemon/dns/systemd/monitor.go index 82fc7d8d68..2a81fac8b2 100644 --- a/daemon/dns/systemd/monitor.go +++ b/daemon/dns/systemd/monitor.go @@ -108,13 +108,13 @@ type ResolvedMonitor struct { // connection with the systemd-resolved unix socket: // /run/systemd/resolve/io.systemd.Resolve.Monitor Conn *varlink.Connection - // channel where all the DNS respones will be sent + // channel where all the DNS responses will be sent ChanResponse chan *MonitorResponse // error channel to signal any problem ChanConnError chan error - // callback that is emited when systemd-resolved resolves a domain name. + // callback that is emitted when systemd-resolved resolves a domain name. receiverCb resolvedCallback mu *sync.RWMutex connected bool diff --git a/daemon/firewall/config/config.go b/daemon/firewall/config/config.go index ca6a47e7ca..0057c569d5 100644 --- a/daemon/firewall/config/config.go +++ b/daemon/firewall/config/config.go @@ -196,7 +196,7 @@ func (c *Config) LoadDiskConfiguration(reload bool) error { return nil } -// loadConfigutation reads the system firewall rules from disk. +// loadConfiguration reads the system firewall rules from disk. // Then the rules are added based on the configuration defined. func (c *Config) loadConfiguration(rawConfig []byte) error { c.SysConfig.Lock() diff --git a/daemon/firewall/nftables/exprs/nat.go b/daemon/firewall/nftables/exprs/nat.go index 207eb381df..180374905c 100644 --- a/daemon/firewall/nftables/exprs/nat.go +++ b/daemon/firewall/nftables/exprs/nat.go @@ -141,7 +141,7 @@ func NewExprDNAT() *expr.NAT { // NewExprTproxy returns a new tproxy expression. // XXX: is "to x.x.x.x:1234" supported by google/nftables lib? or only "to :1234"? -// it creates an erronous rule. +// it creates an erroneous rule. func NewExprTproxy() *[]expr.Any { return &[]expr.Any{ &expr.TProxy{ diff --git a/daemon/log/loggers/remote.go b/daemon/log/loggers/remote.go index a2a3f429a4..77131f57e9 100644 --- a/daemon/log/loggers/remote.go +++ b/daemon/log/loggers/remote.go @@ -51,7 +51,7 @@ type Remote struct { // Name of the logger Name string - // channel used to write mesages + // channel used to write messages writerChan chan string Tag string diff --git a/daemon/netlink/procmon/procmon.go b/daemon/netlink/procmon/procmon.go index 15a5a63f49..161481d2a8 100644 --- a/daemon/netlink/procmon/procmon.go +++ b/daemon/netlink/procmon/procmon.go @@ -26,9 +26,9 @@ type ProcEvent struct { } // ProcEventsMonitor listens for process events from kernel. -// We listen for events via netlink, from the Process Events Conector: +// We listen for events via netlink, from the Process Events Connector: // https://lwn.net/Articles/157150/ -// The kernel must have the options CONFIG_CONECTOR and CONFIG_PROC_EVENTS enabled. +// The kernel must have the options CONFIG_CONNECTOR and CONFIG_PROC_EVENTS enabled. func ProcEventsMonitor(done <-chan struct{}) { log.Info("ProcEventMonitor started\n") runtime.LockOSThread() diff --git a/daemon/netlink/socket.go b/daemon/netlink/socket.go index 886a2b08d9..17c559937c 100644 --- a/daemon/netlink/socket.go +++ b/daemon/netlink/socket.go @@ -75,7 +75,7 @@ func GetSocketInfo(proto string, srcIP net.IP, srcPort uint, dstIP net.IP, dstPo log.Debug("GetSocketInfo() invalid: %d:%v -> %v:%d", sock.ID.SourcePort, sock.ID.Source, sock.ID.Destination, sock.ID.DestinationPort) } - // handle special cases (see function description): ntp queries (123), broadcasts, incomming connections. + // handle special cases (see function description): ntp queries (123), broadcasts, incoming connections. if len(inodes) == 0 && len(sockList) > 0 { for n, sock := range sockList { if sockList[n].ID.Destination.Equal(net.IPv4zero) || sockList[n].ID.Destination.Equal(net.IPv6zero) { @@ -216,7 +216,7 @@ func FlushConnections() { log.Error("error flushing ConntrackTable %s", err) } if err := netlink.ConntrackTableFlush(netlink.ConntrackExpectTable); err != nil { - log.Error("error flusing ConntrackExpectTable %s", err) + log.Error("error flushing ConntrackExpectTable %s", err) } // Force established connections to reestablish again. diff --git a/daemon/procmon/cache_events_test.go b/daemon/procmon/cache_events_test.go index 62b212c306..b89daafbdb 100644 --- a/daemon/procmon/cache_events_test.go +++ b/daemon/procmon/cache_events_test.go @@ -77,7 +77,7 @@ func TestCacheEvents2(t *testing.T) { }) // This process does not exist, so it should be removed from cache - // inmediately. We wait a couple of seconds, before deleting it. + // immediately. We wait a couple of seconds, before deleting it. // See exitDelay description for more info. t.Run("Delete() !isAlive()", func(t *testing.T) { evtsCache.Delete(fakePid) diff --git a/daemon/procmon/details.go b/daemon/procmon/details.go index dcec8767a7..7a28383649 100644 --- a/daemon/procmon/details.go +++ b/daemon/procmon/details.go @@ -345,7 +345,7 @@ func (p *Process) ReadCmdline() { } // CleanArgs applies fixes on the cmdline arguments. -// - AppImages cmdline reports the execuable launched as /proc/self/exe, +// - AppImages cmdline reports the executable launched as /proc/self/exe, // instead of the actual path to the binary. // - For processes launched from a file descriptor, leave them with the orig // path, which usually starts with /proc/*/fd/. @@ -508,7 +508,7 @@ func (p *Process) ResetChecksums() { } // ComputeChecksums calculates the checksums of a the process path to the binary. -// Users may want to use different hashing alogrithms. +// Users may want to use different hashing algorithms. func (p *Process) ComputeChecksums(hashes map[string]uint) { if p.IsAlive() && len(p.Checksums) > 0 { log.Debug("process.ComputeChecksums() already hashed: %d, path: %s, %v", p.ID, p.Path, p.Checksums) diff --git a/daemon/procmon/ebpf/utils.go b/daemon/procmon/ebpf/utils.go index 13d559239a..00de370f8f 100644 --- a/daemon/procmon/ebpf/utils.go +++ b/daemon/procmon/ebpf/utils.go @@ -96,7 +96,7 @@ func getItems(proto string, isIPv6 bool) (items uint) { } // deleteOldItems deletes maps' elements in order to keep them below maximum capacity. -// If ebpf maps are full they don't allow any more insertions, ending up lossing events. +// If ebpf maps are full they don't allow any more insertions, ending up losing events. func deleteOldItems(proto string, isIPv6 bool, maxToDelete uint) (deleted uint) { var lookupKey []byte var nextKey []byte diff --git a/daemon/rule/loader_test.go b/daemon/rule/loader_test.go index 262f231565..9290e5eb51 100644 --- a/daemon/rule/loader_test.go +++ b/daemon/rule/loader_test.go @@ -99,7 +99,7 @@ func TestRuleLoaderInvalidRegexp(t *testing.T) { // Test rules of type operator.list. There're these scenarios: // - Enabled rules: // * operator Data field is ignored if it contains the list of operators as json string. -// * the operarots list is expanded as json objecs under "list": [] +// * the operarots list is expanded as json objects under "list": [] // For new rules (> v1.6.3), Data field will be empty. // // - Disabled rules diff --git a/daemon/rule/operator_lists.go b/daemon/rule/operator_lists.go index 1f94c89b8b..67d0197353 100644 --- a/daemon/rule/operator_lists.go +++ b/daemon/rule/operator_lists.go @@ -122,7 +122,7 @@ func (o *Operator) monitorLists() { if needReload { // we can't reload a single list, because the domains of all lists are added to the same map. // we could have the domains separated by lists/files, but then we'd need to iterate the map in order - // to match a domain. Reloading the lists shoud only occur once a day. + // to match a domain. Reloading the lists should only occur once a day. if err := o.readLists(); err != nil { log.Warning("%s", err) } diff --git a/daemon/rule/operator_test.go b/daemon/rule/operator_test.go index 62509d4a3f..af6e85fd03 100644 --- a/daemon/rule/operator_test.go +++ b/daemon/rule/operator_test.go @@ -1204,7 +1204,7 @@ func TestNetListsCmpSupportsExactAndCIDRFallback(t *testing.T) { } // Must be launched with -race to test that we don't cause leaks -// Race occured on operator.go:241 reListCmp().MathString() +// Race occurred on operator.go:241 reListCmp().MathString() // fixed here: 53419fe func TestRaceNewOperatorListsDomainsRegexp(t *testing.T) { t.Log("Test NewOperator() Lists domains_regexp") diff --git a/daemon/statistics/stats.go b/daemon/statistics/stats.go index 3719c33301..0c2bc69687 100644 --- a/daemon/statistics/stats.go +++ b/daemon/statistics/stats.go @@ -14,7 +14,7 @@ import ( "github.com/evilsocket/opensnitch/daemon/ui/protocol" ) -// StatsConfig holds the stats confguration +// StatsConfig holds the stats configuration type StatsConfig struct { MaxEvents int `json:"MaxEvents"` MaxStats int `json:"MaxStats"` diff --git a/daemon/tasks/nodemonitor/main_test.go b/daemon/tasks/nodemonitor/main_test.go index 101818069b..b36fdc03b2 100644 --- a/daemon/tasks/nodemonitor/main_test.go +++ b/daemon/tasks/nodemonitor/main_test.go @@ -68,7 +68,7 @@ func TestNodeMonitor(t *testing.T) { var sysinfo syscall.Sysinfo_t err = json.Unmarshal([]byte(sysinfoRaw), &sysinfo) if err != nil { - t.Error("Error unmarshaling response:", err) + t.Error("Error unmarshalling response:", err) } }) diff --git a/daemon/tasks/pidmonitor/main_test.go b/daemon/tasks/pidmonitor/main_test.go index ca886c9644..df0296eb8c 100644 --- a/daemon/tasks/pidmonitor/main_test.go +++ b/daemon/tasks/pidmonitor/main_test.go @@ -70,7 +70,7 @@ func TestPIDMonitor(t *testing.T) { var proc procmon.Process err = json.Unmarshal([]byte(procRaw), &proc) if err != nil { - t.Error("Error unmarshaling response:", err) + t.Error("Error unmarshalling response:", err) } if proc.ID != ourPID { t.Error("invalid Process object received:", ourPID, proc) diff --git a/daemon/ui/alerts.go b/daemon/ui/alerts.go index 1496979ae7..adac60021c 100644 --- a/daemon/ui/alerts.go +++ b/daemon/ui/alerts.go @@ -102,7 +102,7 @@ func (c *Client) alertsDispatcher() { case ready := <-c.isConnected: connected = ready if ready { - log.Important("UI connected, dispathing queued alerts: %d", len(c.alertsChan)) + log.Important("UI connected, dispatching queued alerts: %d", len(c.alertsChan)) for { if isQueueEmpty(queuedAlerts) { // no more queued alerts, exit diff --git a/ui/opensnitch/actions/__init__.py b/ui/opensnitch/actions/__init__.py index c3287b17f9..a17ac05060 100644 --- a/ui/opensnitch/actions/__init__.py +++ b/ui/opensnitch/actions/__init__.py @@ -67,7 +67,7 @@ class Actions(QObject): "actions" is the list of actions to execute: - the name of the action defines the python plugin to load: - "highligh" -> plugins/highligh/highlight.py + "highlight" -> plugins/highligh/highlight.py "downloader" -> plugins/downloader/downloader.py, etc. - every action has its own plugin (*.py file) which is in charge of parse and compile to configuration if needed. diff --git a/ui/opensnitch/customwidgets/firewalltableview.py b/ui/opensnitch/customwidgets/firewalltableview.py index e862df2412..a98284ec1a 100644 --- a/ui/opensnitch/customwidgets/firewalltableview.py +++ b/ui/opensnitch/customwidgets/firewalltableview.py @@ -136,7 +136,7 @@ def sort(self, column, order=QtCore.Qt.SortOrder.AscendingOrder): def refresh(self, force=False): self.fillVisibleRows(0, force, *self.lastQueryArgs) - #Some QSqlQueryModel methods must be mimiced so that this class can serve as a drop-in replacement + #Some QSqlQueryModel methods must be mimicked so that this class can serve as a drop-in replacement #mimic QSqlQueryModel.query() def query(self): return self diff --git a/ui/opensnitch/customwidgets/generictableview.py b/ui/opensnitch/customwidgets/generictableview.py index 335e1fc9ef..aaf3489882 100644 --- a/ui/opensnitch/customwidgets/generictableview.py +++ b/ui/opensnitch/customwidgets/generictableview.py @@ -70,7 +70,7 @@ def getLimitQuery(self, offset, forward=True): return qstr, limit_n - #Some QSqlQueryModel methods must be mimiced so that this class can serve as a drop-in replacement + #Some QSqlQueryModel methods must be mimicked so that this class can serve as a drop-in replacement #mimic QSqlQueryModel.query() def query(self): return self @@ -156,7 +156,7 @@ def setQuery(self, q, db, binds=None, limit=None, offset=None): if not ok: return # this call is mandatory, the query must be positioned on a valid - # record. Otherwise it'll segfault or won't display any data. + # record. Otherwise, it'll segfault or won't display any data. tmpQuery.last() if offset is not None: @@ -196,7 +196,7 @@ def prevRecord(self, offset): def refreshViewport(self, scrollValue, maxRowsInViewport, force=False): """Refresh the viewport with data from the db. Before making any changes, emit a signal which will perform several operations - (save current selected row, etc). + (save current selected row, etc.). force var will force a refresh if the scrollbar is at the top or bottom of the viewport, otherwise skip it to allow rows analyzing without refreshing. """ @@ -393,7 +393,7 @@ def refresh(self): self.calculateRowsInViewport() self.model().setRowCount(min(self.maxRowsInViewport, self.model().totalRowCount)) self.model().refreshViewport(self.vScrollBar.value(), self.maxRowsInViewport, force=True) - # Note: on PyQt6 we need to update the viewport explicitely. + # Note: on PyQt6 we need to update the viewport explicitly. self.viewport().update() def forceViewRefresh(self): @@ -539,7 +539,7 @@ def mousePressEvent(self, event): else: deselectCurRow = len(self._rows_selection) == 1 and not rightBtnPressed # discard current selection: - # - if the user right clicked on a row not part of a selection. + # - if the user right-clicked on a row not part of a selection. # - if the user clicked on a row, and there's only one row # selected. # - if the user clicked on a row already selected. diff --git a/ui/opensnitch/customwidgets/main.py b/ui/opensnitch/customwidgets/main.py index f26434d170..d3609d56ee 100644 --- a/ui/opensnitch/customwidgets/main.py +++ b/ui/opensnitch/customwidgets/main.py @@ -92,7 +92,7 @@ def __init__(self): QStandardItemModel.__init__(self, 0, len(self.headerLabels)) self.setHorizontalHeaderLabels(self.headerLabels) - #Some QSqlQueryModel methods must be mimiced so that this class can serve as a drop-in replacement + #Some QSqlQueryModel methods must be mimicked so that this class can serve as a drop-in replacement #mimic QSqlQueryModel.query() def query(self): return self diff --git a/ui/opensnitch/dialogs/events/base.py b/ui/opensnitch/dialogs/events/base.py index 2026ac7c52..bcfe612faa 100644 --- a/ui/opensnitch/dialogs/events/base.py +++ b/ui/opensnitch/dialogs/events/base.py @@ -25,7 +25,7 @@ def set_current_tab(self, idx, block_events=False): if block_events: self.get_central_widget().blockSignals(False) - def add_toolbar_buton(self): + def add_toolbar_button(self): #self.horizontalLayout_10 pass diff --git a/ui/opensnitch/dialogs/events/dialog.py b/ui/opensnitch/dialogs/events/dialog.py index c971d5d863..6188074197 100644 --- a/ui/opensnitch/dialogs/events/dialog.py +++ b/ui/opensnitch/dialogs/events/dialog.py @@ -641,7 +641,7 @@ def _cb_tab_changed(self, index): self.netstat.monitor_node() else: if index == constants.TAB_RULES: - # display the clean buton only if not in detail view + # display the clean button only if not in detail view self.TABLES[index]['cmdCleanStats'].setVisible( self.in_detail_view(index) ) self._add_rulesTree_nodes() diff --git a/ui/opensnitch/dialogs/events/views.py b/ui/opensnitch/dialogs/events/views.py index 5a29492e53..6b71f3276b 100644 --- a/ui/opensnitch/dialogs/events/views.py +++ b/ui/opensnitch/dialogs/events/views.py @@ -649,7 +649,7 @@ def restore_last_selected_row(self): def restore_details_view_columns(self, header, settings_key): header.blockSignals(True) # In order to resize the last column of a view, we firstly force a - # resizeToContens call. + # resizeToContents call. # Secondly set resizeMode to Interactive (allow to move columns by # users + programmatically) header.setSectionResizeMode(QtWidgets.QHeaderView.ResizeMode.ResizeToContents) diff --git a/ui/opensnitch/dialogs/firewall_rule/utils.py b/ui/opensnitch/dialogs/firewall_rule/utils.py index adcfbe8964..b9b3e35fff 100644 --- a/ui/opensnitch/dialogs/firewall_rule/utils.py +++ b/ui/opensnitch/dialogs/firewall_rule/utils.py @@ -94,7 +94,7 @@ def reset_fields(win): win.addr = "" def enable_save(win, enable=True): - """Enable Save buton whenever some detail of a rule changes. + """Enable Save button whenever some detail of a rule changes. The button may or not be hidden. If we're editing a rule it'll be shown but disabled/enabled. """ diff --git a/ui/opensnitch/plugins/__init__.py b/ui/opensnitch/plugins/__init__.py index 8cfdc7f896..8591a65012 100644 --- a/ui/opensnitch/plugins/__init__.py +++ b/ui/opensnitch/plugins/__init__.py @@ -74,7 +74,7 @@ class PluginBase(PluginsList, ABC): When calling compile(), every plugin must create the python objects needed, so they can be reused later when run() is called. - When calling configure(), every plugin is responsable to modify the GUI + When calling configure(), every plugin is responsible to modify the GUI as needed, adding new buttons, modifying existing widgets, behaviour, ... """ name = "PluginBase" diff --git a/ui/opensnitch/plugins/downloader/downloader.py b/ui/opensnitch/plugins/downloader/downloader.py index 166ae8f44a..85b066f210 100644 --- a/ui/opensnitch/plugins/downloader/downloader.py +++ b/ui/opensnitch/plugins/downloader/downloader.py @@ -26,7 +26,7 @@ class Downloader(PluginBase): This plugin may require to create a rule to allow connections to the configured urls, to avoid popups. """ - # fields overriden from parent class + # fields overridden from parent class name = "Downloader" version = 0 author = "opensnitch" diff --git a/ui/opensnitch/plugins/sample/sample.py b/ui/opensnitch/plugins/sample/sample.py index fcd119545a..6537a8c737 100644 --- a/ui/opensnitch/plugins/sample/sample.py +++ b/ui/opensnitch/plugins/sample/sample.py @@ -2,7 +2,7 @@ class Sample(PluginBase): - # fields overriden from parent class + # fields overridden from parent class name = "Sample" version = 0 author = "opensnitch" diff --git a/ui/opensnitch/rules.py b/ui/opensnitch/rules.py index a97229ae31..afa3d36f58 100644 --- a/ui/opensnitch/rules.py +++ b/ui/opensnitch/rules.py @@ -72,7 +72,7 @@ def new_from_records(records): ]) rule.operator.data = "" except Exception as e: - log.warning("new_from_records exception parsing operartor list: %s", repr(e)) + log.warning("new_from_records exception parsing operator list: %s", repr(e)) return rule