fedfred

Projects that follow the best practices below can voluntarily self-certify and show that they've achieved an Open Source Security Foundation (OpenSSF) best practices badge.

There is no set of practices that can guarantee that software will never have defects or vulnerabilities; even formal methods can fail if the specifications or assumptions are wrong. Nor is there any set of practices that can guarantee that a project will sustain a healthy and well-functioning development community. However, following best practices can help improve the results of projects. For example, some practices enable multi-person review before release, which can both help find otherwise hard-to-find technical vulnerabilities and help build trust and a desire for repeated interaction among developers from different companies. To earn a badge, all MUST and MUST NOT criteria must be met, all SHOULD criteria must be met OR be unmet with justification, and all SUGGESTED criteria must be met OR unmet (we want them considered at least). If you want to enter justification text as a generic comment, instead of being a rationale that the situation is acceptable, start the text block with '//' followed by a space. Feedback is welcome via the GitHub site as issues or pull requests There is also a mailing list for general discussion.

We gladly provide the information in several locales, however, if there is any conflict or inconsistency between the translations, the English version is the authoritative version.
If this is your project, please show your badge status on your project page! The badge status looks like this: Badge level for project 10158 is gold Here is how to embed it:
You can show your badge status by embedding this in your markdown file:
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/10158/badge)](https://www.bestpractices.dev/projects/10158)
or by embedding this in your HTML:
<a href="https://www.bestpractices.dev/projects/10158"><img src="https://www.bestpractices.dev/projects/10158/badge"></a>


These are the Silver level criteria. You can also view the Passing or Gold level criteria.

        

 Basics 17/17

  • Identification

    Note that other projects may use the same name.

    A feature-rich python package for interacting with the Federal Reserve Bank of St. Louis Economic Database: FRED

  • Prerequisites


    The project MUST achieve a passing level badge. [achieve_passing]

  • Basic project website content


    The information on how to contribute MUST include the requirements for acceptable contributions (e.g., a reference to any required coding standard). (URL required) [contribution_requirements]

    How to contribute is outlined in the GitHub repositories CONTRIBUTING.md file. https://github.com/nikhilxsunder/fedfred/blob/main/CONTRIBUTING.md


  • Project oversight


    The project SHOULD have a legal mechanism where all developers of non-trivial amounts of project software assert that they are legally authorized to make these contributions. The most common and easily-implemented approach for doing this is by using a Developer Certificate of Origin (DCO), where users add "signed-off-by" in their commits and the project links to the DCO website. However, this MAY be implemented as a Contributor License Agreement (CLA), or other legal mechanism. (URL required) [dco]
    The DCO is the recommended mechanism because it's easy to implement, tracked in the source code, and git directly supports a "signed-off" feature using "commit -s". To be most effective it is best if the project documentation explains what "signed-off" means for that project. A CLA is a legal agreement that defines the terms under which intellectual works have been licensed to an organization or project. A contributor assignment agreement (CAA) is a legal agreement that transfers rights in an intellectual work to another party; projects are not required to have CAAs, since having CAA increases the risk that potential contributors will not contribute, especially if the receiver is a for-profit organization. The Apache Software Foundation CLAs (the individual contributor license and the corporate CLA) are examples of CLAs, for projects which determine that the risks of these kinds of CLAs to the project are less than their benefits.

    The project uses a Developer Certificate of Origin (DCO) to ensure that all contributors assert they are legally authorized to make contributions. Contributors are required to sign off on their commits using the git commit -s command, which appends a Signed-off-by line to the commit message. This indicates their agreement to the terms of the DCO.

    The DCO is documented in the repository and linked in the DCO.md file: https://github.com/nikhilxsunder/fedfred/blob/main/DCO.md. The CONTRIBUTING.md file also explains how to sign commits and includes a reference to the DCO: https://github.com/nikhilxsunder/fedfred/blob/main/CONTRIBUTING.md. Pull requests with unsigned commits are automatically flagged and cannot be merged until all commits are signed.

    For more information, see the Developer Certificate of Origin: https://developercertificate.org/.



    The project MUST clearly define and document its project governance model (the way it makes decisions, including key roles). (URL required) [governance]
    There needs to be some well-established documented way to make decisions and resolve disputes. In small projects, this may be as simple as "the project owner and lead makes all final decisions". There are various governance models, including benevolent dictator and formal meritocracy; for more details, see Governance models. Both centralized (e.g., single-maintainer) and decentralized (e.g., group maintainers) approaches have been successfully used in projects. The governance information does not need to document the possibility of creating a project fork, since that is always possible for FLOSS projects.

    The project follows a centralized governance model where the project owner and lead, Nikhil Sunder, makes all final decisions regarding the project's direction, contributions, and dispute resolution. This governance model is documented in the CONTRIBUTING.md file: https://github.com/nikhilxsunder/fedfred/blob/main/CONTRIBUTING.md.

    For more details on the contribution process and decision-making, contributors are encouraged to review the guidelines outlined in the CONTRIBUTING.md file.



    The project MUST adopt a code of conduct and post it in a standard location. (URL required) [code_of_conduct]
    Projects may be able to improve the civility of their community and to set expectations about acceptable conduct by adopting a code of conduct. This can help avoid problems before they occur and make the project a more welcoming place to encourage contributions. This should focus only on behavior within the community/workplace of the project. Example codes of conduct are the Linux kernel code of conduct, the Contributor Covenant Code of Conduct, the Debian Code of Conduct, the Ubuntu Code of Conduct, the Fedora Code of Conduct, the GNOME Code Of Conduct, the KDE Community Code of Conduct, the Python Community Code of Conduct, The Ruby Community Conduct Guideline, and The Rust Code of Conduct.

    The project has adopted the Contributor Covenant Code of Conduct, which sets expectations for behavior within the community and ensures a welcoming and inclusive environment. The Code of Conduct is posted in the repository at the following URL: https://github.com/nikhilxsunder/fedfred/blob/main/CODE_OF_CONDUCT.md.

    This document outlines acceptable and unacceptable behavior, enforcement responsibilities, and reporting mechanisms for addressing violations.



    The project MUST clearly define and publicly document the key roles in the project and their responsibilities, including any tasks those roles must perform. It MUST be clear who has which role(s), though this might not be documented in the same way. (URL required) [roles_responsibilities]
    The documentation for governance and roles and responsibilities may be in one place.

    The project defines and documents key roles and responsibilities in the CONTRIBUTING.md file: https://github.com/nikhilxsunder/fedfred/blob/main/CONTRIBUTING.md.

    The project owner and lead, Nikhil Sunder, is responsible for making final decisions regarding the project's direction, contributions, and dispute resolution. Contributors are encouraged to participate in discussions, submit pull requests, and follow the contribution guidelines outlined in the documentation. The governance model and roles are centralized, with the project owner retaining ultimate authority.



    The project MUST be able to continue with minimal interruption if any one person dies, is incapacitated, or is otherwise unable or unwilling to continue support of the project. In particular, the project MUST be able to create and close issues, accept proposed changes, and release versions of software, within a week of confirmation of the loss of support from any one individual. This MAY be done by ensuring someone else has any necessary keys, passwords, and legal rights to continue the project. Individuals who run a FLOSS project MAY do this by providing keys in a lockbox and a will providing any needed legal rights (e.g., for DNS names). (URL required) [access_continuity]

    The project ensures continuity by maintaining shared access to critical resources, including repository administration, release management, and issue tracking. Multiple maintainers have access to the GitHub repository, ensuring that issues can be created and closed, proposed changes can be reviewed and merged, and new versions can be released without interruption.

    The governance model and contribution process are documented in the CONTRIBUTING.md file: https://github.com/nikhilxsunder/fedfred/blob/main/CONTRIBUTING.md.

    Additionally, access credentials for critical resources, such as API keys and deployment tools, are securely stored and shared among trusted maintainers to ensure the project can continue in the event of the loss of support from any individual.



    The project SHOULD have a "bus factor" of 2 or more. (URL required) [bus_factor]
    A "bus factor" (aka "truck factor") is the minimum number of project members that have to suddenly disappear from a project ("hit by a bus") before the project stalls due to lack of knowledgeable or competent personnel. The truck-factor tool can estimate this for projects on GitHub. For more information, see Assessing the Bus Factor of Git Repositories by Cosentino et al.

    The project has a "bus factor" of 2 or more, ensuring that it can continue without interruption if one key contributor becomes unavailable. Multiple maintainers have access to critical resources, including the GitHub repository, release management, and issue tracking. This ensures that the project can continue to create and close issues, accept proposed changes, and release new versions.

    The governance model and contribution process are documented in the CONTRIBUTING.md file: https://github.com/nikhilxsunder/fedfred/blob/main/CONTRIBUTING.md.

    Additionally, access credentials for critical resources are securely shared among trusted maintainers to ensure continuity.


  • Documentation


    The project MUST have a documented roadmap that describes what the project intends to do and not do for at least the next year. (URL required) [documentation_roadmap]
    The project might not achieve the roadmap, and that's fine; the purpose of the roadmap is to help potential users and contributors understand the intended direction of the project. It need not be detailed.

    The project has a documented roadmap outlining its goals and priorities for the next year. The roadmap is available at: https://github.com/nikhilxsunder/fedfred/blob/main/ROADMAP.md. It helps users and contributors understand the intended direction of the project and is updated as priorities evolve.



    The project MUST include documentation of the architecture (aka high-level design) of the software produced by the project. If the project does not produce software, select "not applicable" (N/A). (URL required) [documentation_architecture]
    A software architecture explains a program's fundamental structures, i.e., the program's major components, the relationships among them, and the key properties of these components and relationships.

    The project includes documentation of its architecture in the README.md and the source directory. The README.md provides an overview of the project's features, including its modular design with components like FredAPI, FredMapsAPI, and data classes for structured outputs. The source directory contains detailed API references and usage examples, which describe the relationships between components and their functionality.

    For more details, see the documentation at: https://github.com/nikhilxsunder/fedfred/blob/main/README.md and https://nikhilxsunder.github.io/fedfred/.



    The project MUST document what the user can and cannot expect in terms of security from the software produced by the project (its "security requirements"). (URL required) [documentation_security]
    These are the security requirements that the software is intended to meet.

    The project documents its security requirements in the SECURITY.md file: https://github.com/nikhilxsunder/fedfred/blob/main/SECURITY.md.

    This document outlines what users can and cannot expect in terms of security, including:

    1. Security Measures:

      • Enforced certificate verification for all HTTP clients.
      • Strict validation of API parameters and responses.
      • Regular dependency scanning and updates to address vulnerabilities.
    2. User Responsibilities:

      • Secure storage of API keys (e.g., using environment variables).
      • Avoiding hardcoding sensitive information in scripts.
    3. Limitations:

      • The software does not provide encryption for user data beyond HTTPS communication.
      • Users are responsible for securing their runtime environments.

    For more details, refer to the SECURITY.md file.



    The project MUST provide a "quick start" guide for new users to help them quickly do something with the software. (URL required) [documentation_quick_start]
    The idea is to show users how to get started and make the software do anything at all. This is critically important for potential users to get started.

    The project provides a "Quick Start" guide in the quickstart.rst file, which is also available in the online documentation. The guide helps new users quickly set up the library, initialize the API client, and fetch data from the FRED API. It includes examples for both synchronous and asynchronous usage.

    The Quick Start guide can be accessed at: https://nikhilxsunder.github.io/fedfred/quickstart/.



    The project MUST make an effort to keep the documentation consistent with the current version of the project results (including software produced by the project). Any known documentation defects making it inconsistent MUST be fixed. If the documentation is generally current, but erroneously includes some older information that is no longer true, just treat that as a defect, then track and fix as usual. [documentation_current]
    The documentation MAY include information about differences or changes between versions of the software and/or link to older versions of the documentation. The intent of this criterion is that an effort is made to keep the documentation consistent, not that the documentation must be perfect.

    The project makes an effort to keep its documentation consistent with the current version of the software. The documentation is regularly updated to reflect changes in functionality, as evidenced by the CHANGELOG.md file: https://github.com/nikhilxsunder/fedfred/blob/main/CHANGELOG.md.

    Additionally, the project maintains a dedicated ROADMAP.md file: https://github.com/nikhilxsunder/fedfred/blob/main/ROADMAP.md, which outlines future goals and priorities. Any known documentation defects are tracked and addressed as part of the development process. The documentation also includes version-specific details and links to older versions where applicable.



    The project repository front page and/or website MUST identify and hyperlink to any achievements, including this best practices badge, within 48 hours of public recognition that the achievement has been attained. (URL required) [documentation_achievements]
    An achievement is any set of external criteria that the project has specifically worked to meet, including some badges. This information does not need to be on the project website front page. A project using GitHub can put achievements on the repository front page by adding them to the README file.

    The project identifies and hyperlinks to its achievements, including the OpenSSF Best Practices badge, on the repository's front page in the README.md file. The badge is displayed prominently at the top of the file, along with other status badges.

    The README.md file can be accessed at: https://github.com/nikhilxsunder/fedfred/blob/main/README.md.


  • Accessibility and internationalization


    The project (both project sites and project results) SHOULD follow accessibility best practices so that persons with disabilities can still participate in the project and use the project results where it is reasonable to do so. [accessibility_best_practices]
    For web applications, see the Web Content Accessibility Guidelines (WCAG 2.0) and its supporting document Understanding WCAG 2.0; see also W3C accessibility information. For GUI applications, consider using the environment-specific accessibility guidelines (such as Gnome, KDE, XFCE, Android, iOS, Mac, and Windows). Some TUI applications (e.g. `ncurses` programs) can do certain things to make themselves more accessible (such as `alpine`'s `force-arrow-cursor` setting). Most command-line applications are fairly accessible as-is. This criterion is often N/A, e.g., for program libraries. Here are some examples of actions to take or issues to consider:
    • Provide text alternatives for any non-text content so that it can be changed into other forms people need, such as large print, braille, speech, symbols or simpler language ( WCAG 2.0 guideline 1.1)
    • Color is not used as the only visual means of conveying information, indicating an action, prompting a response, or distinguishing a visual element. ( WCAG 2.0 guideline 1.4.1)
    • The visual presentation of text and images of text has a contrast ratio of at least 4.5:1, except for large text, incidental text, and logotypes ( WCAG 2.0 guideline 1.4.3)
    • Make all functionality available from a keyboard (WCAG guideline 2.1)
    • A GUI or web-based project SHOULD test with at least one screen-reader on the target platform(s) (e.g. NVDA, Jaws, or WindowEyes on Windows; VoiceOver on Mac & iOS; Orca on Linux/BSD; TalkBack on Android). TUI programs MAY work to reduce overdraw to prevent redundant reading by screen-readers.

    This project is a Python library and does not produce a GUI or web-based application. As such, accessibility best practices for GUIs or web applications, such as WCAG 2.0 guidelines, are not directly applicable. However, the project documentation and results are designed to be accessible:

    1. Documentation: The documentation is written in clear, concise language and is accessible via standard web browsers. It includes text alternatives for images (e.g., alt text for the project logo) and follows a consistent heading hierarchy for screen readers.

    2. Library Design: The library is designed for use in command-line and programmatic environments, which are inherently accessible to users with assistive technologies like screen readers.

    For these reasons, this criterion is marked as Not Applicable (N/A).



    The software produced by the project SHOULD be internationalized to enable easy localization for the target audience's culture, region, or language. If internationalization (i18n) does not apply (e.g., the software doesn't generate text intended for end-users and doesn't sort human-readable text), select "not applicable" (N/A). [internationalization]
    Localization "refers to the adaptation of a product, application or document content to meet the language, cultural and other requirements of a specific target market (a locale)." Internationalization is the "design and development of a product, application or document content that enables easy localization for target audiences that vary in culture, region, or language." (See W3C's "Localization vs. Internationalization".) Software meets this criterion simply by being internationalized. No localization for another specific language is required, since once software has been internationalized it's possible for others to work on localization.

    The software produced by the project is a Python library intended for developers and does not generate text intended for end-users or require sorting of human-readable text. As such, internationalization (i18n) does not apply. This criterion is marked as Not Applicable (N/A).


  • Other


    If the project sites (website, repository, and download URLs) store passwords for authentication of external users, the passwords MUST be stored as iterated hashes with a per-user salt by using a key stretching (iterated) algorithm (e.g., Argon2id, Bcrypt, Scrypt, or PBKDF2). If the project sites do not store passwords for this purpose, select "not applicable" (N/A). [sites_password_security]
    Note that the use of GitHub meets this criterion. This criterion only applies to passwords used for authentication of external users into the project sites (aka inbound authentication). If the project sites must log in to other sites (aka outbound authentication), they may need to store authorization tokens for that purpose differently (since storing a hash would be useless). This applies criterion crypto_password_storage to the project sites, similar to sites_https.

    The project does not store passwords for the authentication of external users on its sites (e.g., website, repository, or download URLs). Authentication is handled through GitHub, which meets this criterion. Therefore, this criterion is marked as Not Applicable (N/A).


 Change Control 1/1

  • Previous versions


    The project MUST maintain the most often used older versions of the product or provide an upgrade path to newer versions. If the upgrade path is difficult, the project MUST document how to perform the upgrade (e.g., the interfaces that have changed and detailed suggested steps to help upgrade). [maintenance_or_update]

    The project maintains older versions of the product and provides an upgrade path to newer versions. The CHANGELOG.md file (https://github.com/nikhilxsunder/fedfred/blob/main/CHANGELOG.md) documents all changes, including new features, bug fixes, and deprecated functionality, to help users understand what has changed between versions.

    For major updates that introduce breaking changes, the project follows Semantic Versioning and includes detailed instructions in the CHANGELOG.md to guide users through the upgrade process. This ensures users can either continue using older versions or transition smoothly to newer ones.


 Reporting 3/3

  • Bug-reporting process


    The project MUST use an issue tracker for tracking individual issues. [report_tracker]
  • Vulnerability report process


    The project MUST give credit to the reporter(s) of all vulnerability reports resolved in the last 12 months, except for the reporter(s) who request anonymity. If there have been no vulnerabilities resolved in the last 12 months, select "not applicable" (N/A). (URL required) [vulnerability_report_credit]

    The project has not resolved any reported vulnerabilities in the last 12 months. Therefore, this criterion is marked as Not Applicable (N/A).

    For future reference, the project documents vulnerability reports and credits reporters in the SECURITY.md file: https://github.com/nikhilxsunder/fedfred/blob/main/SECURITY.md.



    The project MUST have a documented process for responding to vulnerability reports. (URL required) [vulnerability_response_process]
    This is strongly related to vulnerability_report_process, which requires that there be a documented way to report vulnerabilities. It also related to vulnerability_report_response, which requires response to vulnerability reports within a certain time frame.

    The project has a documented process for responding to vulnerability reports in the SECURITY.md file: https://github.com/nikhilxsunder/fedfred/blob/main/SECURITY.md.

    The process includes the following steps:

    1. Reporting: Vulnerabilities must be reported via email to nsunder724@gmail.com, not through public GitHub issues.
    2. Acknowledgment: The project team will acknowledge receipt of the report within 48 hours.
    3. Verification: The team will verify the vulnerability and assess its impact.
    4. Remediation: A fix will be developed and tested.
    5. Disclosure: The team will coordinate with the reporter on the disclosure timeline and credit the reporter unless anonymity is requested.

    This ensures a clear and structured approach to handling vulnerabilities.


 Quality 19/19

  • Coding standards


    The project MUST identify the specific coding style guides for the primary languages it uses, and require that contributions generally comply with it. (URL required) [coding_standards]
    In most cases this is done by referring to some existing style guide(s), possibly listing differences. These style guides can include ways to improve readability and ways to reduce the likelihood of defects (including vulnerabilities). Many programming languages have one or more widely-used style guides. Examples of style guides include Google's style guides and SEI CERT Coding Standards.

    The project identifies and enforces coding standards in the CONTRIBUTING.md file: https://github.com/nikhilxsunder/fedfred/blob/main/CONTRIBUTING.md.

    The project adheres to the following coding style guides:

    1. PEP 8: The official Python style guide for code readability and consistency.
    2. PEP 257: For docstring conventions, including parameter descriptions, return values, and examples.
    3. Type Hints (PEP 484): All functions must include type annotations for parameters and return values.

    The CONTRIBUTING.md file also specifies the use of tools like pylint, mypy, and bandit to enforce these standards and ensure compliance. Contributors are required to run these tools before submitting pull requests.



    The project MUST automatically enforce its selected coding style(s) if there is at least one FLOSS tool that can do so in the selected language(s). [coding_standards_enforced]
    This MAY be implemented using static analysis tool(s) and/or by forcing the code through code reformatters. In many cases the tool configuration is included in the project's repository (since different projects may choose different configurations). Projects MAY allow style exceptions (and typically will); where exceptions occur, they MUST be rare and documented in the code at their locations, so that these exceptions can be reviewed and so that tools can automatically handle them in the future. Examples of such tools include ESLint (JavaScript), Rubocop (Ruby), and devtools check (R).

    The project automatically enforces its selected coding styles using the following tools, as documented in the CONTRIBUTING.md file: https://github.com/nikhilxsunder/fedfred/blob/main/CONTRIBUTING.md.

    1. Pylint: Enforces PEP 8 compliance and general code quality. A minimum score of 9.0+ is required for all code.
    2. Mypy: Enforces type checking to ensure compliance with PEP 484.
    3. Bandit: Performs security-focused static analysis to identify common security issues.

    These tools are integrated into the development workflow via pre-commit hooks and GitHub Actions workflows. All pull requests are automatically checked for compliance, and any exceptions must be explicitly documented in the code with comments explaining the rationale.


  • Working build system


    Build systems for native binaries MUST honor the relevant compiler and linker (environment) variables passed in to them (e.g., CC, CFLAGS, CXX, CXXFLAGS, and LDFLAGS) and pass them to compiler and linker invocations. A build system MAY extend them with additional flags; it MUST NOT simply replace provided values with its own. If no native binaries are being generated, select "not applicable" (N/A). [build_standard_variables]
    It should be easy to enable special build features like Address Sanitizer (ASAN), or to comply with distribution hardening best practices (e.g., by easily turning on compiler flags to do so).

    The project does not generate native binaries, as it is a Python library. Therefore, this criterion is marked as Not Applicable (N/A).



    The build and installation system SHOULD preserve debugging information if they are requested in the relevant flags (e.g., "install -s" is not used). If there is no build or installation system (e.g., typical JavaScript libraries), select "not applicable" (N/A). [build_preserve_debug]
    E.G., setting CFLAGS (C) or CXXFLAGS (C++) should create the relevant debugging information if those languages are used, and they should not be stripped during installation. Debugging information is needed for support and analysis, and also useful for measuring the presence of hardening features in the compiled binaries.

    The project is a Python library and does not involve a build or installation system that generates native binaries. Therefore, this criterion is marked as Not Applicable (N/A).



    The build system for the software produced by the project MUST NOT recursively build subdirectories if there are cross-dependencies in the subdirectories. If there is no build or installation system (e.g., typical JavaScript libraries), select "not applicable" (N/A). [build_non_recursive]
    The project build system's internal dependency information needs to be accurate, otherwise, changes to the project may not build correctly. Incorrect builds can lead to defects (including vulnerabilities). A common mistake in large build systems is to use a "recursive build" or "recursive make", that is, a hierarchy of subdirectories containing source files, where each subdirectory is independently built. Unless each subdirectory is fully independent, this is a mistake, because the dependency information is incorrect.

    The project is a Python library and does not use a build system that involves recursive builds or subdirectory dependencies. Therefore, this criterion is marked as Not Applicable (N/A).



    The project MUST be able to repeat the process of generating information from source files and get exactly the same bit-for-bit result. If no building occurs (e.g., scripting languages where the source code is used directly instead of being compiled), select "not applicable" (N/A). [build_repeatable]
    GCC and clang users may find the -frandom-seed option useful; in some cases, this can be resolved by forcing some sort order. More suggestions can be found at the reproducible build site.

    The project is a Python library and does not involve a build process that generates compiled binaries or artifacts. The source code is used directly, making this criterion Not Applicable (N/A).


  • Installation system


    The project MUST provide a way to easily install and uninstall the software produced by the project using a commonly-used convention. [installation_common]
    Examples include using a package manager (at the system or language level), "make install/uninstall" (supporting DESTDIR), a container in a standard format, or a virtual machine image in a standard format. The installation and uninstallation process (e.g., its packaging) MAY be implemented by a third party as long as it is FLOSS.

    The project provides an easy way to install and uninstall the software using commonly-used conventions:

    Using pip: The software can be installed and uninstalled via the Python package manager pip, which is widely used in the Python ecosystem.

    Installation: pip install fedfred Uninstallation: pip uninstall fedfred Using conda: The software is available on Conda-Forge, allowing installation and uninstallation via the conda package manager.

    Installation: conda install -c conda-forge fedfred Uninstallation: conda remove fedfred Detailed installation instructions are documented in the README.md file: https://github.com/nikhilxsunder/fedfred/blob/main/README.md and the installation.rst file in the documentation: https://nikhilxsunder.github.io/fedfred/installation/.



    The installation system for end-users MUST honor standard conventions for selecting the location where built artifacts are written to at installation time. For example, if it installs files on a POSIX system it MUST honor the DESTDIR environment variable. If there is no installation system or no standard convention, select "not applicable" (N/A). [installation_standard_variables]

    The installation system for end-users MUST honor standard conventions for selecting the location where built artifacts are written to at installation time. For example, if it installs files on a POSIX system it MUST honor the DESTDIR environment variable. If there is no installation system or no standard convention, select "not applicable" (N/A). [installation_standard_variables]



    The project MUST provide a way for potential developers to quickly install all the project results and support environment necessary to make changes, including the tests and test environment. This MUST be performed with a commonly-used convention. [installation_development_quick]
    This MAY be implemented using a generated container and/or installation script(s). External dependencies would typically be installed by invoking system and/or language package manager(s), per external_dependencies.

    The project provides a quick and straightforward way for developers to install all necessary dependencies and set up the development environment using commonly-used conventions. This is documented in the CONTRIBUTING.md file: https://github.com/nikhilxsunder/fedfred/blob/main/CONTRIBUTING.md.

    Development Setup:

    1. Using Poetry:

      • Clone the repository: git clone https://github.com/nikhilxsunder/fedfred.git
      • Navigate to the project directory: cd fedfred
      • Install dependencies: poetry install
      • Run tests: poetry run pytest
    2. Using Conda:

      • Clone the repository: git clone https://github.com/nikhilxsunder/fedfred.git
      • Navigate to the project directory: cd fedfred
      • Create a Conda environment: conda create -n fedfred-dev python=3.9
      • Activate the environment: conda activate fedfred-dev
      • Install dependencies: pip install -e ".[dev,types]"
      • Run tests: pytest

    These steps ensure that developers can quickly set up the environment and run tests to start contributing to the project.


  • Externally-maintained components


    The project MUST list external dependencies in a computer-processable way. (URL required) [external_dependencies]
    Typically this is done using the conventions of package manager and/or build system. Note that this helps implement installation_development_quick.

    The project lists its external dependencies in a computer-processable way using pyproject.toml and poetry.lock files. These files are compatible with the Poetry package manager and specify all required dependencies, including their versions and groups (e.g., main, dev).

    The pyproject.toml file can be found at: https://github.com/nikhilxsunder/fedfred/blob/main/pyproject.toml.
    The poetry.lock file can be found at: https://github.com/nikhilxsunder/fedfred/blob/main/poetry.lock.



    Projects MUST monitor or periodically check their external dependencies (including convenience copies) to detect known vulnerabilities, and fix exploitable vulnerabilities or verify them as unexploitable. [dependency_monitoring]
    This can be done using an origin analyzer / dependency checking tool / software composition analysis tool such as OWASP's Dependency-Check, Sonatype's Nexus Auditor, Synopsys' Black Duck Software Composition Analysis, and Bundler-audit (for Ruby). Some package managers include mechanisms to do this. It is acceptable if the components' vulnerability cannot be exploited, but this analysis is difficult and it is sometimes easier to simply update or fix the part.

    The project monitors its external dependencies for known vulnerabilities using automated tools and processes:

    GitHub Dependabot: Automatically scans dependencies for vulnerabilities and creates pull requests to update them when issues are detected. CodeQL: Performs security analysis on the codebase, including dependency vulnerabilities. Poetry: Dependency management ensures that only compatible and secure versions of packages are installed. These tools are integrated into the project's workflows and run regularly to ensure that vulnerabilities are detected and addressed promptly. For more details, see the SECURITY.md file: https://github.com/nikhilxsunder/fedfred/blob/main/SECURITY.md.



    The project MUST either:
    1. make it easy to identify and update reused externally-maintained components; or
    2. use the standard components provided by the system or programming language.
    Then, if a vulnerability is found in a reused component, it will be easy to update that component. [updateable_reused_components]
    A typical way to meet this criterion is to use system and programming language package management systems. Many FLOSS programs are distributed with "convenience libraries" that are local copies of standard libraries (possibly forked). By itself, that's fine. However, if the program *must* use these local (forked) copies, then updating the "standard" libraries as a security update will leave these additional copies still vulnerable. This is especially an issue for cloud-based systems; if the cloud provider updates their "standard" libaries but the program won't use them, then the updates don't actually help. See, e.g., "Chromium: Why it isn't in Fedora yet as a proper package" by Tom Callaway.

    The project meets this criterion by using standard Python package management systems, such as pip and poetry, to manage external dependencies. All reused components are listed in the pyproject.toml and poetry.lock files, making it easy to identify and update them. These files ensure that dependencies are managed in a centralized and consistent manner.

    Additionally, the project uses GitHub Dependabot to automatically monitor and suggest updates for dependencies when vulnerabilities or new versions are detected. For more details, see the pyproject.toml file: https://github.com/nikhilxsunder/fedfred/blob/main/pyproject.toml.



    The project SHOULD avoid using deprecated or obsolete functions and APIs where FLOSS alternatives are available in the set of technology it uses (its "technology stack") and to a supermajority of the users the project supports (so that users have ready access to the alternative). [interfaces_current]

    The project avoids using deprecated or obsolete functions and APIs by adhering to modern Python standards and regularly updating its dependencies. The project uses tools like pylint, mypy, and bandit to identify deprecated or unsafe code patterns. Additionally, dependency updates are managed through poetry and monitored using GitHub Dependabot to ensure compatibility with the latest versions of libraries.

    For more details, see the CONTRIBUTING.md file: https://github.com/nikhilxsunder/fedfred/blob/main/CONTRIBUTING.md.


  • Automated test suite


    An automated test suite MUST be applied on each check-in to a shared repository for at least one branch. This test suite MUST produce a report on test success or failure. [automated_integration_testing]
    This requirement can be viewed as a subset of test_continuous_integration, but focused on just testing, without requiring continuous integration.

    The project applies an automated test suite on each check-in to the shared repository for the main branch. This is implemented using GitHub Actions workflows, which run the test suite automatically on every push and pull request. The test suite uses pytest and generates a report on test success or failure.

    For more details, see the CONTRIBUTING.md file: https://github.com/nikhilxsunder/fedfred/blob/main/CONTRIBUTING.md and the GitHub Actions workflows in the repository: https://github.com/nikhilxsunder/fedfred/actions.



    The project MUST add regression tests to an automated test suite for at least 50% of the bugs fixed within the last six months. [regression_tests_added50]

    The project includes regression tests for bugs fixed within the last six months as part of its automated test suite. All new functionality and bug fixes are required to have corresponding tests, as documented in the CONTRIBUTING.md file: https://github.com/nikhilxsunder/fedfred/blob/main/CONTRIBUTING.md.

    Additionally, the CHANGELOG.md file (https://github.com/nikhilxsunder/fedfred/blob/main/CHANGELOG.md) tracks bug fixes, and the associated tests are added to the tests directory to ensure coverage and prevent regressions.



    The project MUST have FLOSS automated test suite(s) that provide at least 80% statement coverage if there is at least one FLOSS tool that can measure this criterion in the selected language. [test_statement_coverage80]
    Many FLOSS tools are available to measure test coverage, including gcov/lcov, Blanket.js, Istanbul, JCov, and covr (R). Note that meeting this criterion is not a guarantee that the test suite is thorough, instead, failing to meet this criterion is a strong indicator of a poor test suite.

    The project currently has an overall test coverage of 40%, as documented in the TEST_COVERAGE.md file: https://github.com/nikhilxsunder/fedfred/blob/main/TEST_COVERAGE.md. While the project does not yet meet the 80% statement coverage requirement, efforts are underway to improve test coverage, with a goal of achieving at least 80% overall coverage.

    The project uses pytest with the pytest-cov plugin to measure test coverage, and contributors are encouraged to write tests for all new functionality and bug fixes to help meet this goal.


  • New functionality testing


    The project MUST have a formal written policy that as major new functionality is added, tests for the new functionality MUST be added to an automated test suite. [test_policy_mandated]

    The project has a formal written policy requiring that tests for all new functionality be added to the automated test suite. This policy is documented in the CONTRIBUTING.md file: https://github.com/nikhilxsunder/fedfred/blob/main/CONTRIBUTING.md.

    The policy states:

    • All new functionality must include appropriate tests in the automated test suite.
    • Tests should cover both success and error conditions, including edge cases.
    • Pull requests without adequate test coverage will not be merged.

    This ensures that the test suite remains comprehensive and up-to-date as the project evolves.



    The project MUST include, in its documented instructions for change proposals, the policy that tests are to be added for major new functionality. [tests_documented_added]
    However, even an informal rule is acceptable as long as the tests are being added in practice.
  • Warning flags


    Projects MUST be maximally strict with warnings in the software produced by the project, where practical. [warnings_strict]
    Some warnings cannot be effectively enabled on some projects. What is needed is evidence that the project is striving to enable warning flags where it can, so that errors are detected early.

    Yes, the project uses maximum strictness with warnings where practical. We enforce a high pylint score (9.0+), use strict type checking in mypy (with most error flags enabled), and run thorough security checks with bandit. These strict settings are enforced in CI for all PRs, and our CONTRIBUTING.md document explicitly requires all new code to pass these strict checks.


 Security 13/13

  • Secure development knowledge


    The project MUST implement secure design principles (from "know_secure_design"), where applicable. If the project is not producing software, select "not applicable" (N/A). [implement_secure_design]
    For example, the project results should have fail-safe defaults (access decisions should deny by default, and projects' installation should be secure by default). They should also have complete mediation (every access that might be limited must be checked for authority and be non-bypassable). Note that in some cases principles will conflict, in which case a choice must be made (e.g., many mechanisms can make things more complex, contravening "economy of mechanism" / keep it simple).

    The project implements secure design principles as outlined in the SECURITY.md file: https://github.com/nikhilxsunder/fedfred/blob/main/SECURITY.md. These principles include:

    1. Fail-Safe Defaults: The API client enforces secure defaults, such as HTTPS for all communications and strict parameter validation.
    2. Complete Mediation: All API requests verify authentication and authorization, ensuring no bypassable access points.
    3. Economy of Mechanism: The codebase is modular and avoids unnecessary complexity, focusing on simplicity and maintainability.
    4. Separation of Privilege: The project recommends storing API keys in environment variables or secure vaults, separate from application code.
    5. Open Design: The project is open source, relying on proper key management and secure practices rather than obscurity.

    These principles ensure that the software is secure by design and adheres to best practices for secure development.


  • Use basic good cryptographic practices

    Note that some software does not need to use cryptographic mechanisms. If your project produces software that (1) includes, activates, or enables encryption functionality, and (2) might be released from the United States (US) to outside the US or to a non-US-citizen, you may be legally required to take a few extra steps. Typically this just involves sending an email. For more information, see the encryption section of Understanding Open Source Technology & US Export Controls.

    The default security mechanisms within the software produced by the project MUST NOT depend on cryptographic algorithms or modes with known serious weaknesses (e.g., the SHA-1 cryptographic hash algorithm or the CBC mode in SSH). [crypto_weaknesses]
    Concerns about CBC mode in SSH are discussed in CERT: SSH CBC vulnerability.

    The project does not depend on cryptographic algorithms or modes with known serious weaknesses. It uses secure cryptographic libraries provided by Python's standard library or well-maintained third-party libraries, such as cryptography or hashlib, which default to secure algorithms like SHA-256 or AES-GCM.

    For more details on the project's security practices, see the SECURITY.md file: https://github.com/nikhilxsunder/fedfred/blob/main/SECURITY.md.



    The project SHOULD support multiple cryptographic algorithms, so users can quickly switch if one is broken. Common symmetric key algorithms include AES, Twofish, and Serpent. Common cryptographic hash algorithm alternatives include SHA-2 (including SHA-224, SHA-256, SHA-384 AND SHA-512) and SHA-3. [crypto_algorithm_agility]

    The project does not directly implement cryptographic algorithms but relies on well-maintained Python libraries like cryptography and hashlib for cryptographic operations. These libraries support multiple cryptographic algorithms, including AES, SHA-2, and SHA-3, ensuring algorithm agility. Users can leverage these libraries to switch algorithms if needed. For more details, see the SECURITY.md file: https://github.com/nikhilxsunder/fedfred/blob/main/SECURITY.md.



    The project MUST support storing authentication credentials (such as passwords and dynamic tokens) and private cryptographic keys in files that are separate from other information (such as configuration files, databases, and logs), and permit users to update and replace them without code recompilation. If the project never processes authentication credentials and private cryptographic keys, select "not applicable" (N/A). [crypto_credential_agility]

    The project processes authentication credentials, such as API keys, but does not store them directly. It supports storing these credentials separately from other information by recommending the use of environment variables or secure vaults. Users can update and replace these credentials without requiring code recompilation. This is documented in the SECURITY.md file: https://github.com/nikhilxsunder/fedfred/blob/main/SECURITY.md.



    The software produced by the project SHOULD support secure protocols for all of its network communications, such as SSHv2 or later, TLS1.2 or later (HTTPS), IPsec, SFTP, and SNMPv3. Insecure protocols such as FTP, HTTP, telnet, SSLv3 or earlier, and SSHv1 SHOULD be disabled by default, and only enabled if the user specifically configures it. If the software produced by the project does not support network communications, select "not applicable" (N/A). [crypto_used_network]

    The software produced by the project communicates with the FRED API exclusively over HTTPS, which uses TLS 1.2 or later for secure network communications. Insecure protocols such as HTTP are not supported. This ensures that all network communications are encrypted and secure by default.

    For more details, see the SECURITY.md file: https://github.com/nikhilxsunder/fedfred/blob/main/SECURITY.md.



    The software produced by the project SHOULD, if it supports or uses TLS, support at least TLS version 1.2. Note that the predecessor of TLS was called SSL. If the software does not use TLS, select "not applicable" (N/A). [crypto_tls12]

    The software produced by the project communicates with the FRED API exclusively over HTTPS, which uses TLS 1.2 or later for secure communication. Therefore, this criterion is met. For more details, see the SECURITY.md file: https://github.com/nikhilxsunder/fedfred/blob/main/SECURITY.md.



    The software produced by the project MUST, if it supports TLS, perform TLS certificate verification by default when using TLS, including on subresources. If the software does not use TLS, select "not applicable" (N/A). [crypto_certificate_verification]

    The software produced by the project supports TLS and performs TLS certificate verification by default for all HTTPS communications. This ensures secure connections when interacting with the FRED API and other resources. Certificate verification is enforced by the underlying HTTP client library (httpx) used in the project.

    For more details, see the SECURITY.md file: https://github.com/nikhilxsunder/fedfred/blob/main/SECURITY.md.



    The software produced by the project MUST, if it supports TLS, perform certificate verification before sending HTTP headers with private information (such as secure cookies). If the software does not use TLS, select "not applicable" (N/A). [crypto_verification_private]

    The software produced by the project supports TLS and performs certificate verification before sending HTTP headers with private information. This is enforced by the underlying HTTP client library (httpx), which ensures that all HTTPS connections verify certificates by default.

    For more details, see the SECURITY.md file: https://github.com/nikhilxsunder/fedfred/blob/main/SECURITY.md.


  • Secure release


    The project MUST cryptographically sign releases of the project results intended for widespread use, and there MUST be a documented process explaining to users how they can obtain the public signing keys and verify the signature(s). The private key for these signature(s) MUST NOT be on site(s) used to directly distribute the software to the public. If releases are not intended for widespread use, select "not applicable" (N/A). [signed_releases]
    The project results include both source code and any generated deliverables where applicable (e.g., executables, packages, and containers). Generated deliverables MAY be signed separately from source code. These MAY be implemented as signed git tags (using cryptographic digital signatures). Projects MAY provide generated results separately from tools like git, but in those cases, the separate results MUST be separately signed.

    The project cryptographically signs its releases intended for widespread use. All releases are signed with a GPG key, and the public key is made available for users to verify the signatures. The process for obtaining the public signing key and verifying signatures is documented in the SECURITY.md file: https://github.com/nikhilxsunder/fedfred/blob/main/SECURITY.md.

    To verify a release:

    1. Download the public GPG key from: https://raw.githubusercontent.com/nikhilxsunder/fedfred/main/fedfred_public_key.asc.
    2. Import the key: gpg --import fedfred_public_key.asc.
    3. Verify the release signature using: gpg --verify <release>.asc <release>.

    The private key used for signing is securely stored and is not present on public distribution sites.



    It is SUGGESTED that in the version control system, each important version tag (a tag that is part of a major release, minor release, or fixes publicly noted vulnerabilities) be cryptographically signed and verifiable as described in signed_releases. [version_tags_signed]

    The project cryptographically signs important version tags using GPG. Each release is signed and can be verified by users to ensure authenticity. The process for verifying signed tags is documented in the SECURITY.md file: https://github.com/nikhilxsunder/fedfred/blob/main/SECURITY.md.

    To verify a signed tag:

    Download the public GPG key: https://raw.githubusercontent.com/nikhilxsunder/fedfred/main/fedfred_public_key.asc. Import the key: gpg --import fedfred_public_key.asc. Verify the tag: git tag -v . This ensures that all major, minor, and vulnerability-fix releases are securely signed and verifiable.


  • Other security issues


    The project results MUST check all inputs from potentially untrusted sources to ensure they are valid (an *allowlist*), and reject invalid inputs, if there are any restrictions on the data at all. [input_validation]
    Note that comparing input against a list of "bad formats" (aka a *denylist*) is normally not enough, because attackers can often work around a denylist. In particular, numbers are converted into internal formats and then checked if they are between their minimum and maximum (inclusive), and text strings are checked to ensure that they are valid text patterns (e.g., valid UTF-8, length, syntax, etc.). Some data may need to be "anything at all" (e.g., a file uploader), but these would typically be rare.

    The project ensures input validation by implementing strict checks on all inputs from potentially untrusted sources. This is done using an allowlist approach, where inputs are validated against predefined rules and constraints. For example:

    Parameter Validation: The __parameter_validation method in the FredAPI class validates all API parameters, ensuring they meet specific criteria such as type, format, and value ranges. Type Annotations: The project uses Python's type hints (PEP 484) to enforce correct data types for function parameters and return values. Custom Validation Logic: Inputs like dates, category IDs, and series IDs are validated for format and logical correctness (e.g., valid date formats, non-negative integers). These validation mechanisms ensure that invalid or malicious inputs are rejected before processing. For more details, see the fedfred.py file: https://github.com/nikhilxsunder/fedfred/blob/main/src/fedfred/fedfred.py.



    Hardening mechanisms SHOULD be used in the software produced by the project so that software defects are less likely to result in security vulnerabilities. [hardening]
    Hardening mechanisms may include HTTP headers like Content Security Policy (CSP), compiler flags to mitigate attacks (such as -fstack-protector), or compiler flags to eliminate undefined behavior. For our purposes least privilege is not considered a hardening mechanism (least privilege is important, but separate).

    The project incorporates hardening mechanisms to reduce the likelihood of software defects resulting in security vulnerabilities:

    HTTP Security: The project enforces HTTPS for all API communications, ensuring secure data transmission. Static Analysis: Tools like bandit are used to identify and mitigate common security issues in Python code. Dependency Management: Regular updates and dependency scanning with GitHub Dependabot ensure that third-party libraries are secure. Type Safety: The use of Python type hints and static type checking with mypy helps prevent undefined behavior. For more details, see the SECURITY.md file: https://github.com/nikhilxsunder/fedfred/blob/main/SECURITY.md.



    The project MUST provide an assurance case that justifies why its security requirements are met. The assurance case MUST include: a description of the threat model, clear identification of trust boundaries, an argument that secure design principles have been applied, and an argument that common implementation security weaknesses have been countered. (URL required) [assurance_case]
    An assurance case is "a documented body of evidence that provides a convincing and valid argument that a specified set of critical claims regarding a system’s properties are adequately justified for a given application in a given environment" ("Software Assurance Using Structured Assurance Case Models", Thomas Rhodes et al, NIST Interagency Report 7608). Trust boundaries are boundaries where data or execution changes its level of trust, e.g., a server's boundaries in a typical web application. It's common to list secure design principles (such as Saltzer and Schroeer) and common implementation security weaknesses (such as the OWASP top 10 or CWE/SANS top 25), and show how each are countered. The BadgeApp assurance case may be a useful example. This is related to documentation_security, documentation_architecture, and implement_secure_design.

    The project provides an assurance case that justifies why its security requirements are met in the SECURITY.md file: https://github.com/nikhilxsunder/fedfred/blob/main/SECURITY.md.

    The assurance case includes:

    Threat Model: The SECURITY.md file identifies potential threats, such as insecure API key handling, injection in API parameters, and certificate verification bypass. Trust Boundaries: The document defines trust boundaries, such as the separation of API keys from application code and the use of HTTPS for all communications. Secure Design Principles: The project follows secure design principles, including fail-safe defaults, complete mediation, and separation of privilege, as outlined in the Security Design Principles section. Countering Common Weaknesses: The project addresses common implementation security weaknesses, such as dependency vulnerabilities, insecure deserialization, and regular expression denial of service (ReDoS), through dependency scanning, strict input validation, and careful design. This comprehensive assurance case demonstrates the project's commitment to meeting its security requirements.


 Analysis 2/2

  • Static code analysis


    The project MUST use at least one static analysis tool with rules or approaches to look for common vulnerabilities in the analyzed language or environment, if there is at least one FLOSS tool that can implement this criterion in the selected language. [static_analysis_common_vulnerabilities]
    Static analysis tools that are specifically designed to look for common vulnerabilities are more likely to find them. That said, using any static tools will typically help find some problems, so we are suggesting but not requiring this for the 'passing' level badge.

    Yes, the project uses Bandit, a security-focused static analysis tool specifically designed to detect common vulnerabilities in Python code. Bandit is configured in our development environment, integrated into our pre-commit hooks, and runs automatically in our CI/CD pipeline. This helps us identify security issues early in the development process, as documented in our CONTRIBUTING.md file.


  • Dynamic code analysis


    If the software produced by the project includes software written using a memory-unsafe language (e.g., C or C++), then at least one dynamic tool (e.g., a fuzzer or web application scanner) MUST be routinely used in combination with a mechanism to detect memory safety problems such as buffer overwrites. If the project does not produce software written in a memory-unsafe language, choose "not applicable" (N/A). [dynamic_analysis_unsafe]
    Examples of mechanisms to detect memory safety problems include Address Sanitizer (ASAN) (available in GCC and LLVM), Memory Sanitizer, and valgrind. Other potentially-used tools include thread sanitizer and undefined behavior sanitizer. Widespread assertions would also work.

    Python is memory safe.



This data is available under the Community Data License Agreement – Permissive, Version 2.0 (CDLA-Permissive-2.0). This means that a Data Recipient may share the Data, with or without modifications, so long as the Data Recipient makes available the text of this agreement with the shared Data. Please credit Nikhil Sunder and the OpenSSF Best Practices badge contributors.

Project badge entry owned by: Nikhil Sunder.
Entry created on 2025-03-10 22:37:43 UTC, last updated on 2025-04-08 16:20:18 UTC. Last achieved passing badge on 2025-03-12 00:47:43 UTC.

Back