baton-file is a connector built using the Baton SDK.
Check out Baton to learn more the project in general.
baton-file is a Baton connector designed to ingest identity and access data directly from structured data files like Microsoft Excel (.xlsx), YAML (.yaml/.yml), and JSON (.json). It translates the data from specific structures or tabs within these files into Baton resources, entitlements, and grants.
This connector allows you to model users, groups, roles, applications, and their relationships defined in common file formats, making it suitable for scenarios where the managed application does not have a method to currently integrate directly with ConductorOne either through cloud or on-premises connectors. The baton-file connector allows for the modeling of even the most complex application resource relationship data models and provides visibility into its full permission/access inheritance model.
- Multiple File Formats: Reads data directly from
.xlsx,.yaml/.yml, and.jsonfiles. - Structured Input: Expects data organized into specific tabs (Excel) or top-level keys (YAML/JSON) (
users,resources,entitlements,grants) with defined fields/columns. - Explicit Trait Definition: Uses the
Resource Functionfield in theresourcesdata to assign Baton traits (user, group, role, app, secret) to discovered resource types. - Per-Sync Reloading: Re-reads the input file data during every sync cycle.
- Standard Baton Functionality: Supports both C1Z file generation and direct connector mode.
- Custom User Attribute Support: Ingests user profile attributes via dedicated
Profile: *columns (Excel) or nestedprofileobjects (YAML/JSON).
- Familiarity with your application's identity and access data model.
- An input file (
.xlsx,.yaml, or.json) structured according to the expected format (see File Formats below). Example templates illustrating the structure are provided in thetemplates/directory. - Access to a ConductorOne instance (required for direct connector mode).
# Add the ConductorOne tap (if you haven't already)
brew tap conductorone/baton
# Install Baton and the file connector
brew install baton conductorone/baton/baton-file
# Verify installation
baton-file --help
baton --help# Pull the latest images
docker pull ghcr.io/conductorone/baton:latest
docker pull ghcr.io/conductorone/baton-file:latest
# Example: Run connector to generate C1Z file (replace path/to/your/data.file)
docker run --rm -v $(pwd):/out -e BATON_INPUT=path/to/your/data.file ghcr.io/conductorone/baton-file:latest
# Example: Run Baton against the generated C1Z
docker run --rm -v $(pwd):/out ghcr.io/conductorone/baton:latest -f "/out/sync.c1z" resources# Install Baton CLI
go install github.com/conductorone/baton/cmd/baton@main
# Install baton-file connector
go install github.com/conductorone/baton-file/cmd/baton-file@main
# Verify installation
baton-file --help
baton --helpThe baton-file connector requires the path to your input data file specified via the --input (or -i) flag or the BATON_INPUT environment variable.
This is the default behavior when tenant client credentials are not provided.
# Example using Excel
baton-file -i templates/template.xlsx
# Example using YAML
baton-file -i templates/template.yaml
# Example using JSON
baton-file -i templates/template.json
# Specify output file name
baton-file -i path/to/your/data.file --file my-sync.c1z
This command will:
- Read and parse the data from the specified file.
- Process the resources, entitlements, and grants.
- Create a C1Z file (
sync.c1zby default).
Providing your ConductorOne tenant client ID and client secret via flags automatically triggers Continuous Service Mode. This mode is recommended for production deployments.
# Example using flags (replace path and credentials)
./bin/baton-file -i path/to/your/data.file \
--client-id $BATON_CLIENT_ID \
--client-secret $BATON_CLIENT_SECRETIn this mode, the connector starts, authenticates with ConductorOne, and waits for sync tasks. When a sync is triggered, it re-reads the input file data as needed for each phase of the sync.
baton-file supports standard Baton SDK flags:
-i,--input: (Required) Path to the input data file (.xlsx,.yaml,.yml,.json).-c,--client-id: ConductorOne Client ID (for direct mode).-s,--client-secret: ConductorOne Client Secret (for direct mode).--file: Path to output C1Z file (default:sync.c1z).--log-level: Set logging level (debug,info,warn,error).--log-format: Set log format (consoleorjson).-h,--help: Display help information.
The connector expects an input file (.xlsx, .yaml, .yml, or .json) containing specific data structures. Templates are provided in the templates/ directory:
Detailed instructions and explanations for each file format are available:
Core Structure Summary:
- Excel: Data organized into specific tabs (
users,resources,entitlements,grants) with defined columns. Column order does not matter, but header names must match required fields (case-insensitive for standard headers, case-sensitive forProfile: *keys after the prefix). - YAML/JSON: Data organized under top-level keys (
users,resources,entitlements,grants), where each key holds a list of objects. Object keys must match expected field names (lowercase snake_case, e.g.,display_name,resource_type).
Refer to the detailed instruction files linked above for specific field names and requirements for each format.
users: Defines all user resources (including service accounts).- Required Fields:
Name,Display Name - Optional Fields:
Email,Status(enabled/active, disabled/inactive/suspended),LastLogin(string, formatMM/DD/YYYY),Type(human/user/person, service/system/bot/machine),Profile(map/object).
- Required Fields:
resources: Defines all non-user resources (groups, roles, apps, etc.) and their Baton trait (Resource Function).- Required Fields:
Resource Type(string, e.g., "role", "team"),Resource Function(string matching keys inTraitMap, e.g., "role", "group"),Name(unique ID),Display Name. - Optional Fields:
Description,Parent Resource(Name of parent).
- Required Fields:
entitlements: Defines specific permissions, membership types, or role assignments on resources.grants: Defines which principals (users or group/role entitlements) are granted which entitlements.
We started Baton because we were tired of taking screenshots and manually building spreadsheets. We welcome contributions and ideas, no matter how small—our goal is to make identity and permissions sprawl less painful for everyone. If you have questions, problems, or ideas: Please open a GitHub Issue!
See CONTRIBUTING.md for more details.
