apache-airflow-ctl

v0.1.5 suspicious
6.0
Medium Risk

Apache Airflow command line tool for communicating with an Apache Airflow, using the API.

🤖 AI Analysis

Final verdict: SUSPICIOUS

The package has a moderate risk score due to potential insecure credential handling and incomplete metadata. While there are no direct indications of malicious intent, the risks associated with credential collection and incomplete author details warrant further scrutiny.

  • credential risk due to collection via keyring and getpass
  • incomplete metadata and author details
Per-check LLM notes
  • Network: The absence of network call patterns is typical and not indicative of malicious activity, especially if the package's functionality does not require external communications.
  • Shell: The absence of shell execution patterns suggests that the package does not execute commands on the underlying system, which is generally safe unless it contradicts known behavior of the package.
  • Obfuscation: The obfuscation pattern is not typical of secure coding practices but does not necessarily indicate malicious intent.
  • Credentials: The code appears to be collecting credentials via keyring and getpass, which could pose a risk if not handled securely.
  • Metadata: The author's details are incomplete and the license link is non-secure, but there are no clear signs of malicious intent or typosquatting.

📦 Package Quality Overall: Medium (7.4/10)

✦ High Test Suite 9.0

Test suite present — 16 test file(s) found

  • Test runner config found: conftest.py
  • Test runner config found: pyproject.toml
  • 16 test file(s) detected (e.g. conftest.py)
✦ High Documentation 9.0

Well-documented package

  • Documentation URL: "Documentation" -> https://airflow.apache.org/docs/apache-airflow-ctl/stable/in
  • 2 documentation file(s) (e.g. conf.py)
  • Detailed PyPI description (2852 chars)
○ Low Contributing Guide 2.0

No contributing guide or governance files found

  • No CONTRIBUTING, CODE_OF_CONDUCT, or governance files found
◈ Medium Type Annotations 7.0

Partial type annotation coverage

  • Type checker (mypy / pyright / pytype) referenced in project
  • 222 type-annotated function signatures detected in source
✦ High Multiple Contributors 10.0

Active multi-contributor project

  • 46 unique contributor(s) across 100 commits in apache/airflow
  • Active community — 5 or more distinct contributors

🔬 Heuristic Checks

Outbound Network Calls

No suspicious network call patterns found

Code Obfuscation score 4.0

Found 2 obfuscation pattern(s)

  • mport annotations __path__ = __import__("pkgutil").extend_path(__path__, __name__) __version__ = "0.1.5" #!/
  • mport annotations __path__ = __import__("pkgutil").extend_path(__path__, __name__) #!/usr/bin/env python # #
Shell / Subprocess Execution

No shell execution patterns detected

Credential Harvesting score 10.0

Found 6 credential access pattern(s)

  • self.api_token = keyring.get_password( "airflowctl", self.token_key_fo
  • yring token = keyring.get_password("airflowctl", Credentials.token_key_for_environment(env_name
  • ATTEMPTS): password = getpass.getpass("Please set a password for your new keyring: ") conf
  • keyring: ") confirm = getpass.getpass("Please confirm the password: ") if password != conf
  • sword: password = getpass.getpass(f"[{args.env}] Password: ") # Username + password login
  • password = args.password or getpass.getpass("Password: ") try: api_client.refresh_base_url(
Typosquatting

No typosquatting candidates detected

Registered Email Domain

No author email provided

Suspicious Page Links score 2.0

Found 1 suspicious link(s) on the package page

  • Non-HTTPS external link: http://www.apache.org/licenses/LICENSE-2.0
Git Repository History

Repository apache/airflow appears legitimate

Maintainer History score 4.0

2 maintainer concern(s) found

  • Author name is missing or very short
  • Author "" appears to have only 1 package on PyPI (new or inactive account)
Known CVE Vulnerabilities

No known vulnerabilities found in OSV database.

💡 AI App Starter Prompt

Use this prompt to build a project with apache-airflow-ctl
Your task is to develop a Python-based utility called 'AirflowTaskScheduler' which leverages the 'apache-airflow-ctl' package to interact with an Apache Airflow instance. This utility aims to provide a simplified interface for managing and scheduling tasks within Airflow. The application should have the following functionalities:

1. **Task Creation**: Allow users to create new tasks in their Airflow environment via a command-line interface. Users should be able to specify details such as task name, DAG ID, start date, and execution time.
2. **Task Deletion**: Implement a feature to delete tasks from the Airflow environment based on user input. This should include options to delete a single task or multiple tasks at once.
3. **Task Status Check**: Provide a function to check the status of one or more tasks. The utility should return the current state of the task(s), including whether they are running, failed, succeeded, etc.
4. **DAG Management**: Integrate features for managing DAGs (Directed Acyclic Graphs). Users should be able to activate, suspend, or list all available DAGs in their Airflow instance.
5. **Scheduling Control**: Offer the ability to trigger a specific DAG run or pause/resume scheduled runs of a DAG.
6. **Logging Integration**: Include functionality to retrieve logs for specific tasks or DAG runs directly from the command line.
7. **Configuration Management**: Allow users to configure settings such as connection URLs, API keys, and default parameters through a configuration file.

To achieve these functionalities, you will extensively use the 'apache-airflow-ctl' package. Specifically, utilize its methods for making API calls to perform operations like creating, deleting, and querying tasks and DAGs. Ensure your implementation handles exceptions gracefully and provides informative error messages when issues arise.

For development, consider using a modular approach where each major feature (task creation, deletion, status check, etc.) is implemented as a separate function or class method. Additionally, implement unit tests for each feature to ensure reliability.

This utility should serve as a powerful yet easy-to-use tool for anyone working with Apache Airflow, enabling them to manage their workflows more efficiently from the command line.