chromium

package
v0.0.0-...-f53e1c9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package chromium is responsible for running checks on Chromium based browsers.

Exported function(s): ExtensionsChromium, HistoryChromium

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtensionsChromium

func ExtensionsChromium(browser string) checks.Check

ExtensionsChromium checks for the presence of an ad blocker extension in a specified Chromium-based browser.

Parameters:

  • browser: A string representing the name of the Chromium-based browser to check. Currently, this function supports "Chrome" and "Edge".

Returns:

  • A checks.Check object representing the result of the check. If an ad blocker is installed, the result will be "Ad blocker installed". If no ad blocker is found, the result will be "No ad blocker installed". If an error occurs during the check, the function will return a checks.CheckError with the error message.

This function works by reading the extensions directory of the specified browser in the user's home directory, and checking each installed extension against a list of known ad blocker names. The function uses the extensionNameChromium helper function to fetch the name of each extension from the Chrome Web Store or the Microsoft Edge Addons Store.

func HistoryChromium

func HistoryChromium(browser string) checks.Check

HistoryChromium checks the browsing history in a specified Chromium-based browser for visits to phishing domains.

Parameters:

  • browser: A string representing the name of the Chromium-based browser to check. This could be "Chrome", "Edge", etc.

Returns:

  • A checks.Check object representing the result of the check. If phishing domains are found in the browsing history, the result will contain the domains visited in the last week and the timestamps of the visits. If no phishing domains are found, the result will indicate that no phishing domains were found in the last week.

This function works by accessing the browser's history database, querying for URLs visited in the last week, and checking each URL against a list of known phishing domains. The function uses the utils.GetPhishingDomains helper function to fetch the list of known phishing domains.

func SearchEngineChromium

func SearchEngineChromium(browser string) checks.Check

SearchEngineChromium inspects the default search engine setting in Chromium-based browsers.

Parameters:

  • browser: A string representing the name of the Chromium-based browser to inspect. This could be "Chrome", "Edge", etc.

Returns:

  • A checks.Check object representing the result of the check. The result contains the name of the default search engine used in the specified browser. If an error occurs during the check, the result will contain a description of the error.

This function works by locating the preferences file in the user's home directory, which contains the browser's settings. It opens and reads this file, then parses it as JSON to access the settings. It specifically looks for the "default_search_provider_data" key in the JSON data, which holds the name of the default search engine. If this key is found, its value is returned as the result of the check. If any error occurs during this process, such as an error reading the file or parsing the JSON, this error is returned as the result of the check.

Types

type Response

type Response struct {
	Name string `json:"name"`
}

Response is a struct that represents the JSON response from the Microsoft Edge Addons Store

Fields: Name (string) - The name of the extension

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL