Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.
/ go-ftd Public archive

Cisco FirePower bindings in Go for FirePower Device Manager

License

Notifications You must be signed in to change notification settings

remiphilippe/go-ftd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-ftd

Go Bindings for Cisco FirePower NGFW. These bindings talk to Firepower Device Manager.

Example

Open a Session using env vars:

params := make(map[string]string)
params["grant_type"] = "password"
params["username"] = os.Getenv("FTD_USER")
params["password"] = os.Getenv("FTD_PASSWORD")
params["debug"] = "true"
params["insecure"] = "true"

ftd, err := NewFTD(os.Getenv("FTD_HOST"), params)
if err != nil {
    glog.Errorf("error: %s\n", err)
    return nil, err
}

return ftd, nil

Creating a Network Object:

// Create a Network Object for a single host 1.1.1.1
n := new(NetworkObject)
n.Name = "testObj001"
n.SubType = "HOST"
n.Value = "1.1.1.1"

err = ftd.CreateNetworkObject(n, DuplicateActionReplace)
if err != nil {
    glog.Errorf("error: %s\n", err)
    return
}

Creating an Access Rule:

// Allow any traffic between any and network object n1 and network object group g1
a := new(AccessRule)
a.Name = "testPolicy001"
a.RuleAction = RuleActionPermit
a.EventLogAction = LogActionNone
// n1.Refence() returns a reference object of a Network Object
a.DestinationNetworks = append(a.DestinationNetworks, n1.Reference())
// g1.Refence() returns a reference object of a Network Object Group
a.DestinationNetworks = append(a.DestinationNetworks, g1.Reference())

err = ftd.CreateAccessRule(a, "default")
if err != nil {
    glog.Errorf("error: %s\n", err)
    return
}

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the Apache 2 License - see the LICENSE file for details

About

Cisco FirePower bindings in Go for FirePower Device Manager

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages