Skip to content

Add FIPS compliance to agents plugin#372

Open
stafot wants to merge 18 commits intomasterfrom
CLD-9438-build-agents-fips-complaint
Open

Add FIPS compliance to agents plugin#372
stafot wants to merge 18 commits intomasterfrom
CLD-9438-build-agents-fips-complaint

Conversation

@stafot
Copy link
Copy Markdown

@stafot stafot commented Aug 11, 2025

Add FIPS Compliance to Agents Plugin

Summary

This PR adds Federal Information Processing Standards (FIPS) compliance support to the Mattermost Agents Plugin, enabling the plugin to be deployed in FIPS-compliant environments such as government agencies, financial institutions, and other regulated industries.

🎯 What's Changed

Core FIPS Support

  • New FIPS Build Target: Added make dist-fips command to build FIPS-compliant plugin distributions
  • Docker-based FIPS Builds: Uses official Mattermost FIPS-compliant Go image (cgr.dev/mattermost.com/go-msft-fips:1.24.4) for building
  • Dual Distribution Support: Plugin now builds both standard and FIPS-compliant versions simultaneously

Build System Enhancements

  • Updated Go Version: Upgraded from Go 1.23 to Go 1.24.0 for better FIPS compliance
  • Enhanced Makefile: Added comprehensive FIPS build targets and helper functions
  • Improved CI/CD: Updated GitHub Actions to build and distribute both plugin versions

CI/CD Improvements

  • Dependabot Integration: Added automated dependency updates for GitHub Actions
  • Enhanced Build Pipeline: CI now builds both normal and FIPS distributions
  • Artifact Management: Improved artifact handling and retention policies
  • Security Hardening: Pinned GitHub Actions to specific commit hashes for better security

🔧 Technical Details

FIPS Build Process

The FIPS build process:

  1. Uses the official Mattermost FIPS-compliant Go image
  2. Builds server binaries with FIPS-compliant cryptographic libraries
  3. Creates separate distribution packages with -fips suffix
  4. Maintains compatibility with existing plugin deployment workflows

New Make Targets

  • make dist-fips - Builds FIPS-compliant plugin distribution
  • make dist-all - Builds both standard and FIPS distributions
  • make server-fips - Builds only the FIPS-compliant server binaries

File Structure

dist/ # Standard plugin distribution
dist-fips/ # FIPS-compliant plugin distribution
├── plugin-linux-amd64-fips
└── plugin.json

🚀 Usage

Building FIPS Plugin

# Build FIPS-compliant plugin
make dist-fips

# Build both versions
make dist-all

Deployment

Both plugin versions are automatically built in CI and available as release artifacts. The FIPS version can be deployed to FIPS-compliant environments while maintaining the standard version for regular deployments.

🧪 Testing

  • FIPS build process tested locally
  • CI pipeline updated and tested
  • Both distributions build successfully
  • Plugin functionality verified in both versions

📋 Checklist

  • Add FIPS build support to Makefile
  • Update CI workflow for dual distribution builds
  • Pin GitHub Actions to specific versions
  • Add dependabot configuration
  • Update Go version to 1.24.0
  • Test FIPS build process
  • Verify plugin functionality in both distributions

🔒 Security & Compliance

This change enables the plugin to meet FIPS 140-2 compliance requirements by:

  • Using FIPS-validated cryptographic modules
  • Building with FIPS-compliant Go toolchain
  • Maintaining separate build processes for compliance verification

�� Related

  • Issues: CLD-9438, CLD-9440
  • Type: Enhancement
  • Breaking Changes: None
  • Migration: No migration required - existing deployments continue to work unchanged

🎉 Impact

This enhancement significantly expands the plugin's deployment capabilities, making it suitable for:

  • Government and military environments
  • Financial services and healthcare organizations
  • Any environment requiring FIPS compliance
  • Enterprise customers with strict security requirements

The change maintains full backward compatibility while adding enterprise-grade compliance features.

@stafot stafot marked this pull request as ready for review August 18, 2025 08:44
@stafot stafot changed the title WIP: Add FIPS compliance to agents plugin Add FIPS compliance to agents plugin Aug 21, 2025
@stafot stafot force-pushed the CLD-9438-build-agents-fips-complaint branch from 9f684e3 to f678b92 Compare August 21, 2025 10:13
Copy link
Copy Markdown
Member

@agarciamontoro agarciamontoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I left a couple of nits below, and I have a general suggestion that can actually be applied to the other plugins PRs: can we add a check like the one proposed for the server to verify the FIPS builds?

ifeq ($(FIPS_ENABLED),true)
	cp $(GOBIN_HOST)/$(MM_BIN_NAME) $(GOBIN_HOST)/$(MMCTL_BIN_NAME) $(DIST_PATH_GENERIC)/bin # from native bin dir, not cross-compiled
	@# FIPS verification checks
	@echo "Verifying FIPS build settings..."
	$(GO) version -m $(GOBIN_HOST)/$(MM_BIN_NAME) | grep -q "GOEXPERIMENT=systemcrypto" || (echo "ERROR: FIPS binary missing GOEXPERIMENT=systemcrypto" && exit 1)
	$(GO) version -m $(GOBIN_HOST)/$(MM_BIN_NAME) | grep -q "\-tags=requirefips" || (echo "ERROR: FIPS binary missing -tags=requirefips" && exit 1)
	@echo "Verifying OpenSSL integration..."
	$(GO) tool nm $(GOBIN_HOST)/$(MM_BIN_NAME) | grep -q "func_go_openssl_OpenSSL_version" || (echo "ERROR: FIPS binary missing OpenSSL integration" && exit 1)
	@echo "FIPS verification checks passed"
else

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
Comment thread .github/dependabot.yml
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not opposed to this, but it seems out of scope for this PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, please remove.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agarciamontoro @crspeller While I understand dependabot is out of scope for this specific PR, I believe it should remain for the following security and maintenance reasons:

Security Posture Benefits:

  • Automated vulnerability detection: Dependabot automatically identifies and creates PRs for security vulnerabilities in our GitHub Actions dependencies
  • Reduces manual oversight: Eliminates the need for manual monitoring of security advisories across multiple action repositories
  • Timely updates: Ensures we stay current with security patches without relying on manual processes

Operational Benefits:

  • Consistency with Mattermost practices: Other Mattermost repositories use dependabot for the same security benefits
  • Low maintenance overhead: Weekly schedule with limited open PRs (max 10) prevents spam while maintaining security
  • Team ownership: Configured with mattermost/ai-framework as reviewers/assignees for proper oversight

The security benefits of keeping our CI dependencies current significantly outweigh the minor addition to this PR. This follows security best practices and aligns with our responsibility to maintain a secure CI/CD pipeline.

cc @esarafianou

I used this PR as opportunity to improve security posture and I did the same in the push-proxy one.

Comment thread Makefile Outdated

## Builds both normal and FIPS distributions.
.PHONY: dist-all
dist-all: clean
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why depend on clean here?

Copy link
Copy Markdown
Member

@agarciamontoro agarciamontoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I meant to Request changes, sorry)

Comment thread Makefile

## Builds the server with FIPS compliance using Docker (requires Docker)
.PHONY: server-fips
server-fips: generate
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lot of complexity to add to the Makefile. If we need to support fips is there some reason for having fips and non-fips builds? Why not just have all builds be fips?

If we do need to add this complexity, maybe we can have a separate makefile with all of this extra complexity contained in there.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need both fips and non-fips. cc @esarafianou

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crspeller FIPS builds require a specialized runtime, which we provide in our FIPS docker image. FIPS-only would mean that customers deploying Matteermost via a tar.gz would need to have their runtime configured, even if they don't care about FIPS.

That's why we're taking the dual approach across Mattermost Server, plugins and other services.

Comment thread .github/dependabot.yml
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, please remove.

Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
@agarciamontoro agarciamontoro force-pushed the CLD-9438-build-agents-fips-complaint branch from a83ccea to dd8b0c1 Compare September 12, 2025 08:39
@agarciamontoro
Copy link
Copy Markdown
Member

Rebased this branch on top of the v1.3.1 tag to build off the latest prepackaged version. Sorry for the force-push!

@mattermost-build
Copy link
Copy Markdown
Collaborator

This PR has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

@crspeller crspeller closed this Oct 27, 2025
@lieut-data lieut-data reopened this Oct 27, 2025
@lieut-data
Copy link
Copy Markdown
Member

@crspeller, can we keep this open until we ship proper FIPS support in the plugin? We're using this PR to build FIPS-compliant versions with each release (a manual effort @agarciamontoro has been kind enough to juggle).

Bumping mattermost-plugin-agents to Minor version 1.4.0
@agarciamontoro
Copy link
Copy Markdown
Member

Merged up to the v1.4.0 tag for prepackaging for MM v11.1

Bumping mattermost-plugin-agents to Minor version 1.6.0

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEPRP5d5L03rt/wvKse019lts08b8FAmkUzusACgkQe019lts0
# 8b9vDg/+I4JGs2tD7Spbi2bEvQ96hMn8CGiTl4Kf2lDryevWamOQ+pQpxERf2LAQ
# 10jPhGdkONodJ3v2YytS/z1y+rHXMeQXRZF+TeZ0xdCLS4qrFXnLjXz+L9l4U9Ju
# 8QykVKc5qGlkLK/BXZQt2yvjVGMW26wDTbXZRnfmCMzLfTDcNMmp5s5s3CySzZFW
# jU+4eVqqyIuQGKzVEq/3OBqKuDvhLXbe5psr/uFmyXjHv1atv3sJ7ggL77eU5BCi
# MbT8yvTPncynsFxyy1OQiG4DqOIwKHU8Ik8nJ9Ck/xQKHtgTM7ElJ0PlvZmYXNqm
# GCWPIp2wk7M34ln1uyPDUdWwPPbidJXnknovyKU1awV95QiW5uUoM8eJzqZuGguT
# NyOle5ipqJI2sXQ6+NdWXuRVEVyNW+LVz3m4qUodBAu7cSWeLStv3gVjB4jORYKU
# wOA7ay656ylS0YwNz+GA8EzZhqkYZnZNJDa6aD5cZibfu73EvHk8g05mJM0xg0Ty
# 5n3wADbEyDFizH2sptUDvILgCYyqkSdjnbddYMtdj5lgR0+Op/26LbrGOKgEvUe/
# zWw1R1uaSmfiLizVrEveTrXx6a3pjreXRV9EwFRXbYmjgEVh8XxHJIfw+0c0Hr4q
# FoTTgW8Nt+JXNrVKkv8t+ueuJav1JTwRbLzvrNdcIVZ7XMY0mao=
# =AhbM
# -----END PGP SIGNATURE-----
# gpg: Signature made mié 12 nov 2025 19:16:11 CET
# gpg:                using RSA key 3D13F97792F4DEBB7FC2F2AC7B4D7D96DB34F1BF
# gpg: Can't check signature: No public key
@agarciamontoro
Copy link
Copy Markdown
Member

agarciamontoro commented Nov 12, 2025

Merged up to the v1.6.0 tag for prepackaging for MM v11.2

Bumping mattermost-plugin-agents to Patch version 1.6.1

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEPRP5d5L03rt/wvKse019lts08b8FAmkeDnAACgkQe019lts0
# 8b+3mRAAvehfZs7NoAdzWzHQCiYWZlbJ5NYIXPJ2GodktbEQ24xVVPWWlD+uY/Ay
# UM5mm/VroUXlA9f314eC6PwWLkk20uIU+w7jEnJNACzd5PHd5W0H3Gx2uM2B8ZeS
# ifhvJqtXXlBDBgOtoD+oVosB1gTZoUI1uAnW+PcDIU45vs0/QhDPKgFYrOwWklUZ
# m38jZv3gnQ2eMNqQlK/Ohxci/v96Qt8IFLjqcmBBgt5xQqsZeJyhYzno1kY0F18N
# epVjZsVJRt62x8JRCVB4fNM12wIbRPydZhira0Xkxk0kNBqpyGPzuJ0t/xYsjTSu
# pCYbkypjQhmzpVJ7zNN3nUHoB6nCnl1NNWMc8anhyd/XwZo+SZvnfq3Uwb7co714
# HmOlAq3Luv5LC5zh8AzJQb9Uvryg/QHjbR8UZpD/9v4AoLrtaOYjFI8R3JA/eJ+r
# McQCCD7oC7HwuLdRhX5ZXa55Ry9ZqyRIFTHrPKPQtajD9fZVfk1tRZnJCESW4xgK
# PpvuWEUrEIgmm5pYB3UwsFF64LFBe/+KFSl4igebgR7qszhQIJgti4FVbDp7O3EC
# +VAq4IdOWTbqwg6M/TlqTKxOWL53DxLm0/asUI3GDOYF/xYGIYegPcr2nOqSD/9C
# QWNGqPEQ7HhC9WBPMtnd0UBI64rEeGQn6dsETsfbv5d2jVgedaU=
# =luQL
# -----END PGP SIGNATURE-----
# gpg: Signature made mié 19 nov 2025 19:37:36 CET
# gpg:                using RSA key 3D13F97792F4DEBB7FC2F2AC7B4D7D96DB34F1BF
# gpg: Can't check signature: No public key
@agarciamontoro
Copy link
Copy Markdown
Member

Aaaaand merged up to the v1.6.1 tag for prepackaging for MM v11.2.

nickmisasi and others added 2 commits December 2, 2025 18:15
When there were no bots AND no old services to migrate, migrateServicesToBots()
was incorrectly returning true, causing unnecessary config saves and potential
infinite OnConfigurationChange loops.

Added early return when old services array is empty.
Bumping mattermost-plugin-agents to Patch version 1.6.2
@agarciamontoro agarciamontoro changed the base branch from master to release-1.6 December 2, 2025 18:06
@agarciamontoro
Copy link
Copy Markdown
Member

Merged up to the v1.6.2 tag for prepackaging for MM v11.2. Changed base branch to release-1.6

Bumping mattermost-plugin-agents to Minor version 1.7.0
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 11, 2025

🤖 LLM Evaluation Results

OpenAI

Overall: 20/20 tests passed (100.0%)

Provider Total Passed Failed Pass Rate
✅ OPENAI 20 20 0 100.0%

Anthropic

Overall: 21/21 tests passed (100.0%)

Provider Total Passed Failed Pass Rate
✅ ANTHROPIC 21 21 0 100.0%

Azure OpenAI

Overall: 17/17 tests passed (100.0%)

Provider Total Passed Failed Pass Rate
✅ AZURE 17 17 0 100.0%

Mistral

Overall: 15/15 tests passed (100.0%)

Provider Total Passed Failed Pass Rate
✅ MISTRAL 15 15 0 100.0%

AWS Bedrock

Overall: 18/18 tests passed (100.0%)

Provider Total Passed Failed Pass Rate
✅ BEDROCK 18 18 0 100.0%

This comment was automatically generated by the eval CI pipeline.

Bumping mattermost-plugin-agents to Patch version 1.7.1

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEPRP5d5L03rt/wvKse019lts08b8FAmk68X8ACgkQe019lts0
# 8b+TWRAAsyOmWx6ut89xQWq98HYAFBSLxy+rPD/WRd3tG1HCLshzL8htQYnalySV
# fQqwKgHMoThKR66EksXKt7fXqr35BYC3xMOaa1a100n6jS58FPxHVPw6UrGYiu1J
# 99prtnekpB85Pv0TjbOeRmqpFBqXavtIDsGl/5/lFaKYkQlBwCHhX48OCLZOUc8x
# SRcSp0LZF3j3eEGXEBXXDcK+S9M++Tsd6zQQAwSdECViSa3Xysf3+mOYIMADi5Qj
# wCQ0OYENa40ZoZDjtEUu1XQwTQiIyi/Fm3qejvL1wAMNIeagLPM0P80397aEtfxm
# xi/JHAPTLfVmwzFMiO0RHj+cQj2nkmPJ8vCoUcmiHi24UUcvjrVYhG5sBiUIUAYD
# kgNUNu+wifFmr+a1JPEoJ8La3hZav2tkMtUIqsYzDdvyBSQb8p5/xt6eq/Ejyhd9
# WnvStFJ9UQ9ix1GSlI2CiO9eYNPYbxUqs6RGh7fOtfWwNskUNYLtB5y/i75xKJfv
# urdp6zcwFB3GpOGvJbw4GQIKmcL2Ucn385RdkTjO4UucW3TsoLEDk+Us0q3w7NW+
# lXxBDLBKAhjtCLILa5iVqEpI7HKdPpQRD6zi0Gjo34r3yV90LHQlH7han3+ZypRD
# W0eQE8yErXOO/GCRBvC9P5AyFrQHGy9Mr1hAtyOy/rR5PJ13oLk=
# =JPmp
# -----END PGP SIGNATURE-----
# gpg: Signature made jue 11 dic 2025 17:29:51 CET
# gpg:                using RSA key 3D13F97792F4DEBB7FC2F2AC7B4D7D96DB34F1BF
# gpg: Can't check signature: No public key
@agarciamontoro agarciamontoro changed the base branch from release-1.6 to master December 11, 2025 18:11
@agarciamontoro
Copy link
Copy Markdown
Member

Merged up to the v1.7.1 tag for prepackaging for MM v11.3. Changed base branch back to master

@agarciamontoro agarciamontoro mentioned this pull request Dec 15, 2025
@lieut-data lieut-data removed their request for review March 2, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants